2022-12-16 18:40:57 -06:00
|
|
|
from panda3d.core import *
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.toontowngui import TTDialog
|
|
|
|
from toontown.toonbase import TTLocalizer
|
|
|
|
from direct.showbase import Transitions
|
|
|
|
from direct.gui.DirectGui import *
|
2022-12-16 18:40:57 -06:00
|
|
|
from panda3d.core import *
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import LaffMeter
|
2019-11-02 17:27:54 -05:00
|
|
|
|
|
|
|
class DeathForceAcknowledge:
|
|
|
|
|
|
|
|
def __init__(self, doneEvent):
|
|
|
|
fadeModel = loader.loadModel('phase_3/models/misc/fade')
|
|
|
|
if fadeModel:
|
|
|
|
self.fade = DirectFrame(
|
|
|
|
parent=aspect2dp,
|
|
|
|
relief=None,
|
|
|
|
image=fadeModel,
|
|
|
|
image_color=(0, 0, 0, 0.4),
|
|
|
|
image_scale=3.0,
|
|
|
|
state=DGG.NORMAL)
|
2019-12-01 16:38:32 -06:00
|
|
|
self.fade.reparentTo(aspect2d, DGG.FADE_SORT_INDEX)
|
2019-11-02 17:27:54 -05:00
|
|
|
fadeModel.removeNode()
|
|
|
|
else:
|
2019-12-30 00:07:56 -06:00
|
|
|
print('Problem loading fadeModel.')
|
2019-11-02 17:27:54 -05:00
|
|
|
self.fade = None
|
|
|
|
self.dialog = TTDialog.TTGlobalDialog(
|
|
|
|
message=TTLocalizer.PlaygroundDeathAckMessage,
|
|
|
|
doneEvent=doneEvent,
|
|
|
|
style=TTDialog.Acknowledge,
|
|
|
|
suppressKeys=True)
|
|
|
|
self.dialog['text_pos'] = (-.26, 0.1)
|
|
|
|
scale = self.dialog.component('image0').getScale()
|
|
|
|
scale.setX(scale[0] * 1.3)
|
|
|
|
self.dialog.component('image0').setScale(scale)
|
|
|
|
av = base.localAvatar
|
|
|
|
self.laffMeter = LaffMeter.LaffMeter(av.style, av.hp, av.maxHp)
|
|
|
|
self.laffMeter.reparentTo(self.dialog)
|
|
|
|
if av.style.getAnimal() == 'monkey':
|
|
|
|
self.laffMeter.setPos(-0.46, 0, -0.035)
|
|
|
|
self.laffMeter.setScale(0.085)
|
|
|
|
else:
|
|
|
|
self.laffMeter.setPos(-0.48, 0, -0.035)
|
|
|
|
self.laffMeter.setScale(0.1)
|
|
|
|
self.laffMeter.start()
|
|
|
|
self.dialog.show()
|
|
|
|
return
|
|
|
|
|
|
|
|
def cleanup(self):
|
|
|
|
if self.fade:
|
|
|
|
self.fade.destroy()
|
|
|
|
if self.laffMeter:
|
|
|
|
self.laffMeter.destroy()
|
|
|
|
del self.laffMeter
|
|
|
|
if self.dialog:
|
|
|
|
self.dialog.cleanup()
|
|
|
|
self.dialog = None
|
|
|
|
return
|