예제 #1
0
    def exit(self):
        if self.loader:
            self.loader.exit()
            self.loader.unload()
            del self.loader

        Hood.exit(self)
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
    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)
예제 #6
0
    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
예제 #7
0
 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
예제 #8
0
 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)
예제 #9
0
    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)
예제 #10
0
    def unload(self):
        self.parentFSM.getStateNamed(self.__class__.__name__).removeChild(
            self.fsm)

        Hood.unload(self)
예제 #11
0
    def load(self):
        Hood.load(self)

        self.parentFSM.getStateNamed(self.__class__.__name__).addChild(
            self.fsm)
예제 #12
0
 def stopSky(self):
     Hood.stopSky(self)
     if hasattr(self, 'loader') and self.loader:
         self.loader.stopCloudPlatforms()
예제 #13
0
    def exit(self):
        base.localAvatar.setCameraFov(settings['fov'])
        base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear,
                                ToontownGlobals.DefaultCameraFar)

        Hood.exit(self)
예제 #14
0
    def stopSky(self):
        Hood.stopSky(self)

        self.loader.stopCloudPlatforms()