mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
33 lines
1 KiB
Python
33 lines
1 KiB
Python
|
from pandac.PandaModules import *
|
||
|
from toontown.toontowngui import TTDialog
|
||
|
from toontown.toonbase import TTLocalizer
|
||
|
|
||
|
class HealthForceAcknowledge:
|
||
|
|
||
|
def __init__(self, doneEvent):
|
||
|
self.doneEvent = doneEvent
|
||
|
self.dialog = None
|
||
|
return
|
||
|
|
||
|
def enter(self, hpLevel):
|
||
|
doneStatus = {}
|
||
|
toonHp = base.localAvatar.getHp()
|
||
|
if toonHp >= hpLevel:
|
||
|
doneStatus['mode'] = 'complete'
|
||
|
messenger.send(self.doneEvent, [doneStatus])
|
||
|
else:
|
||
|
base.localAvatar.b_setAnimState('neutral', 1)
|
||
|
doneStatus['mode'] = 'incomplete'
|
||
|
self.doneStatus = doneStatus
|
||
|
msg = TTLocalizer.HealthForceAcknowledgeMessage
|
||
|
self.dialog = TTDialog.TTDialog(text=msg, command=self.handleOk, style=TTDialog.Acknowledge)
|
||
|
|
||
|
def exit(self):
|
||
|
if self.dialog:
|
||
|
self.dialog.cleanup()
|
||
|
self.dialog = None
|
||
|
return
|
||
|
|
||
|
def handleOk(self, value):
|
||
|
messenger.send(self.doneEvent, [self.doneStatus])
|