def exit(self): if self.loader: self.loader.exit() self.loader.unload() del self.loader Hood.exit(self)
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): Hood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId) self.loader = None self.fsm = ClassicFSM.ClassicFSM('Hood', [ State.State('start', self.enterStart, self.exitStart, ['safeZoneLoader']), State.State('safeZoneLoader', self.enterSafeZoneLoader, self.exitSafeZoneLoader, ['quietZone']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['safeZoneLoader']), State.State('final', self.enterFinal, self.exitFinal, []) ], 'start', 'final') self.fsm.enterInitialState() self.id = MyEstate self.safeZoneLoaderClass = EstateLoader self.storageDNAFile = 'phase_5.5/dna/storage_estate.pdna' self.holidayStorageDNADict = { WINTER_DECORATIONS: ['phase_5.5/dna/winter_storage_estate.pdna'], WACKY_WINTER_DECORATIONS: ['phase_5.5/dna/winter_storage_estate.pdna'], HALLOWEEN_PROPS: ['phase_5.5/dna/halloween_props_storage_estate.pdna'], SPOOKY_PROPS: ['phase_5.5/dna/halloween_props_storage_estate.pdna'] } self.skyFile = 'phase_3.5/models/props/TT_sky' self.spookySkyFile = 'phase_3.5/models/props/BR_sky' self.popupInfo = None
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): Hood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId) self.suitInteriorDoneEvent = 'suitInteriorDone' self.minigameDoneEvent = 'minigameDone' self.whiteFogColor = Vec4(0.8, 0.8, 0.8, 1) self.fsm = ClassicFSM.ClassicFSM('Hood', [State.State('start', self.enterStart, self.exitStart, ['townLoader', 'safeZoneLoader']), State.State('townLoader', self.enterTownLoader, self.exitTownLoader, ['quietZone', 'safeZoneLoader', 'suitInterior', 'cogdoInterior']), State.State('safeZoneLoader', self.enterSafeZoneLoader, self.exitSafeZoneLoader, ['quietZone', 'suitInterior', 'cogdoInterior', 'townLoader', 'minigame']), State.State('purchase', self.enterPurchase, self.exitPurchase, ['quietZone', 'minigame', 'safeZoneLoader']), State.State('suitInterior', self.enterSuitInterior, self.exitSuitInterior, ['quietZone', 'townLoader', 'safeZoneLoader']), State.State('cogdoInterior', self.enterCogdoInterior, self.exitCogdoInterior, ['quietZone', 'townLoader', 'safeZoneLoader']), State.State('minigame', self.enterMinigame, self.exitMinigame, ['purchase']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['safeZoneLoader', 'townLoader', 'suitInterior', 'cogdoInterior', 'minigame']), State.State('final', self.enterFinal, self.exitFinal, [])], 'start', 'final') self.fsm.enterInitialState() self.underwaterColor = None # Until we cleanup Hood, we will need to define some variables self.id = self.ID self.storageDNAFile = self.STORAGE_DNA self.holidayStorageDNADict = self.HOLIDAY_DNA self.skyFile = self.SKY_FILE self.spookySkyFile = self.SPOOKY_SKY_FILE self.titleColor = self.TITLE_COLOR
def unload(self): del self.safeZoneLoaderClass if self.popupInfo: self.popupInfo.destroy() self.popupInfo = None Hood.unload(self)
def exit(self): base.localAvatar.setCameraFov(ToontownGlobals.DefaultCameraFov) base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, ToontownGlobals.DefaultCameraFar) self.setNoFog() Hood.exit(self)
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): Hood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId) self.suitInteriorDoneEvent = 'suitInteriorDone' self.minigameDoneEvent = 'minigameDone' self.whiteFogColor = Vec4(0.8, 0.8, 0.8, 1) self.fsm = ClassicFSM.ClassicFSM('Hood', [ State.State('start', self.enterStart, self.exitStart, ['townLoader', 'safeZoneLoader']), State.State('townLoader', self.enterTownLoader, self.exitTownLoader, [ 'quietZone', 'safeZoneLoader', 'suitInterior', 'cogdoInterior' ]), State.State('safeZoneLoader', self.enterSafeZoneLoader, self.exitSafeZoneLoader, [ 'quietZone', 'suitInterior', 'cogdoInterior', 'townLoader', 'minigame' ]), State.State('purchase', self.enterPurchase, self.exitPurchase, ['quietZone', 'minigame', 'safeZoneLoader']), State.State('suitInterior', self.enterSuitInterior, self.exitSuitInterior, ['quietZone', 'townLoader', 'safeZoneLoader']), State.State('cogdoInterior', self.enterCogdoInterior, self.exitCogdoInterior, ['quietZone', 'townLoader', 'safeZoneLoader']), State.State('minigame', self.enterMinigame, self.exitMinigame, ['purchase']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, [ 'safeZoneLoader', 'townLoader', 'suitInterior', 'cogdoInterior', 'minigame' ]), State.State('final', self.enterFinal, self.exitFinal, []) ], 'start', 'final') self.fsm.enterInitialState() # Load content pack ambience settings: ambience = contentPacksMgr.getAmbience('general') color = ambience.get('underwater-color') if color is not None: try: self.underwaterColor = Vec4(color['r'], color['g'], color['b'], color['a']) except Exception as e: raise ContentPackError(e) else: self.underwaterColor = None # Until we cleanup Hood, we will need to define some variables self.id = self.ID self.storageDNAFile = self.STORAGE_DNA self.holidayStorageDNADict = self.HOLIDAY_DNA self.skyFile = self.SKY_FILE self.spookySkyFile = self.SPOOKY_SKY_FILE self.titleColor = self.TITLE_COLOR
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): Hood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId) self.fsm = ClassicFSM.ClassicFSM('Hood', [State.State('start', self.enterStart, self.exitStart, ['cogHQLoader']), State.State('cogHQLoader', self.enterCogHQLoader, self.exitCogHQLoader, ['quietZone']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['cogHQLoader']), State.State('final', self.enterFinal, self.exitFinal, [])], 'start', 'final') self.fsm.enterInitialState() self.id = self.ID self.storageDNAFile = None self.skyFile = self.SKY_FILE self.titleColor = self.TITLE_COLOR
def load(self): Hood.load(self) skyInner = self.sky.find('**/InnerGroup') skyMiddle = self.sky.find('**/MiddleGroup') skyOuter = self.sky.find('**/OutterSky') if not skyOuter.isEmpty(): skyOuter.setBin('background', 0) if not skyMiddle.isEmpty(): skyMiddle.setDepthWrite(0) skyMiddle.setBin('background', 10) if not skyInner.isEmpty(): skyInner.setDepthWrite(0) skyInner.setBin('background', 20) self.parentFSM.getStateNamed(self.__class__.__name__).addChild(self.fsm)
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): Hood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId) self.suitInteriorDoneEvent = 'suitInteriorDone' self.minigameDoneEvent = 'minigameDone' self.whiteFogColor = Vec4(0.8, 0.8, 0.8, 1) self.fsm = ClassicFSM.ClassicFSM('Hood', [State.State('start', self.enterStart, self.exitStart, ['townLoader', 'safeZoneLoader']), State.State('townLoader', self.enterTownLoader, self.exitTownLoader, ['quietZone', 'safeZoneLoader', 'suitInterior', 'cogdoInterior']), State.State('safeZoneLoader', self.enterSafeZoneLoader, self.exitSafeZoneLoader, ['quietZone', 'suitInterior', 'cogdoInterior', 'townLoader', 'minigame']), State.State('purchase', self.enterPurchase, self.exitPurchase, ['quietZone', 'minigame', 'safeZoneLoader']), State.State('suitInterior', self.enterSuitInterior, self.exitSuitInterior, ['quietZone', 'townLoader', 'safeZoneLoader']), State.State('cogdoInterior', self.enterCogdoInterior, self.exitCogdoInterior, ['quietZone', 'townLoader', 'safeZoneLoader']), State.State('minigame', self.enterMinigame, self.exitMinigame, ['purchase']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['safeZoneLoader', 'townLoader', 'suitInterior', 'cogdoInterior', 'minigame']), State.State('final', self.enterFinal, self.exitFinal, [])], 'start', 'final') self.fsm.enterInitialState() # Load content pack ambience settings: ambience = contentPacksMgr.getAmbience('general') color = ambience.get('underwater-color') if color is not None: try: self.underwaterColor = Vec4(color['r'], color['g'], color['b'], color['a']) except Exception, e: raise ContentPackError(e)
def unload(self): self.parentFSM.getStateNamed(self.__class__.__name__).removeChild( self.fsm) Hood.unload(self)
def load(self): Hood.load(self) self.parentFSM.getStateNamed(self.__class__.__name__).addChild( self.fsm)
def stopSky(self): Hood.stopSky(self) if hasattr(self, 'loader') and self.loader: self.loader.stopCloudPlatforms()
def exit(self): base.localAvatar.setCameraFov(settings['fov']) base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, ToontownGlobals.DefaultCameraFar) Hood.exit(self)
def stopSky(self): Hood.stopSky(self) self.loader.stopCloudPlatforms()