2022-12-16 18:40:57 -06:00
|
|
|
from panda3d.core import *
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.toonbase import TTLocalizer
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import ZoneUtil
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.toonbase import ToontownGlobals
|
|
|
|
from toontown.toontowngui import TeaserPanel
|
|
|
|
|
|
|
|
class TrialerForceAcknowledge:
|
|
|
|
|
|
|
|
def __init__(self, doneEvent):
|
|
|
|
self.doneEvent = doneEvent
|
|
|
|
self.dialog = None
|
|
|
|
return
|
|
|
|
|
|
|
|
def enter(self, destHood):
|
|
|
|
doneStatus = {}
|
|
|
|
|
|
|
|
def letThrough(self = self, doneStatus = doneStatus):
|
|
|
|
doneStatus['mode'] = 'pass'
|
|
|
|
messenger.send(self.doneEvent, [doneStatus])
|
|
|
|
|
|
|
|
if not base.restrictTrialers:
|
|
|
|
letThrough()
|
|
|
|
return
|
|
|
|
if base.roamingTrialers:
|
|
|
|
letThrough()
|
|
|
|
return
|
|
|
|
if base.cr.isPaid():
|
|
|
|
letThrough()
|
|
|
|
return
|
|
|
|
if ZoneUtil.getCanonicalHoodId(destHood) in (ToontownGlobals.ToontownCentral, ToontownGlobals.MyEstate, ToontownGlobals.GoofySpeedway):
|
|
|
|
letThrough()
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
base.localAvatar.b_setAnimState('neutral', 1)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
|
|
|
doneStatus['mode'] = 'fail'
|
|
|
|
self.doneStatus = doneStatus
|
|
|
|
self.dialog = TeaserPanel.TeaserPanel(pageName='otherHoods', doneFunc=self.handleOk)
|
|
|
|
|
|
|
|
def exit(self):
|
|
|
|
if self.dialog:
|
|
|
|
self.dialog.cleanup()
|
|
|
|
self.dialog.unload()
|
|
|
|
self.dialog = None
|
|
|
|
return
|
|
|
|
|
|
|
|
def handleOk(self):
|
|
|
|
messenger.send(self.doneEvent, [self.doneStatus])
|