2022-12-16 18:40:57 -06:00
|
|
|
from panda3d.core import *
|
2019-11-02 17:27:54 -05:00
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import CogHood
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.toonbase import ToontownGlobals, TTLocalizer
|
|
|
|
from toontown.hood import ZoneUtil
|
|
|
|
from toontown.coghq import CashbotCogHQLoader
|
|
|
|
|
|
|
|
class CashbotHQ(CogHood.CogHood):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory('CashbotHQ')
|
|
|
|
|
|
|
|
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId):
|
|
|
|
CogHood.CogHood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId)
|
|
|
|
self.id = ToontownGlobals.CashbotHQ
|
|
|
|
self.cogHQLoaderClass = CashbotCogHQLoader.CashbotCogHQLoader
|
|
|
|
self.storageDNAFile = None
|
|
|
|
self.skyFile = 'phase_3.5/models/props/TT_sky'
|
|
|
|
self.titleColor = (0.5, 0.5, 0.5, 1.0)
|
|
|
|
return
|
|
|
|
|
|
|
|
def load(self):
|
|
|
|
CogHood.CogHood.load(self)
|
|
|
|
self.parentFSM.getStateNamed('CashbotHQ').addChild(self.fsm)
|
|
|
|
|
|
|
|
def unload(self):
|
|
|
|
self.parentFSM.getStateNamed('CashbotHQ').removeChild(self.fsm)
|
|
|
|
del self.cogHQLoaderClass
|
|
|
|
CogHood.CogHood.unload(self)
|
|
|
|
|
|
|
|
def enter(self, *args):
|
|
|
|
CogHood.CogHood.enter(self, *args)
|
|
|
|
localAvatar.setCameraFov(ToontownGlobals.CogHQCameraFov)
|
|
|
|
base.camLens.setNearFar(ToontownGlobals.CashbotHQCameraNear, ToontownGlobals.CashbotHQCameraFar)
|
|
|
|
|
|
|
|
def exit(self):
|
|
|
|
localAvatar.setCameraFov(ToontownGlobals.DefaultCameraFov)
|
|
|
|
base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, ToontownGlobals.DefaultCameraFar)
|
|
|
|
CogHood.CogHood.exit(self)
|
|
|
|
|
|
|
|
def spawnTitleText(self, zoneId, floorNum = None):
|
|
|
|
if ZoneUtil.isMintInteriorZone(zoneId):
|
|
|
|
text = '%s\n%s' % (ToontownGlobals.StreetNames[zoneId][-1], TTLocalizer.MintFloorTitle % (floorNum + 1))
|
|
|
|
self.doSpawnTitleText(text)
|
|
|
|
else:
|
|
|
|
CogHood.CogHood.spawnTitleText(self, zoneId)
|