def enter(self, requestStatus, visibilityFlag = 1, arrowsOn = 1):
        teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus,))
        self._ttfToken = None
        self.fsm.enterInitialState()
        base.playMusic(self.loader.music, looping=1, volume=0.8)
        self.loader.geom.reparentTo(render)
        if visibilityFlag:
            self.visibilityOn()
        base.localAvatar.setGeom(self.loader.geom)
        base.localAvatar.setOnLevelGround(1)
        self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH)
        NametagGlobals.setMasterArrowsOn(arrowsOn)
        self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId'])

        def __lightDecorationOn__():
            geom = base.cr.playGame.getPlace().loader.geom
            self.halloweenLights = geom.findAllMatches('**/*light*')
            self.halloweenLights += geom.findAllMatches('**/*lamp*')
            self.halloweenLights += geom.findAllMatches('**/prop_snow_tree*')
            for light in self.halloweenLights:
                light.setColorScaleOff(1)

        if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile:
            lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky))
            lightsOff.start()
        else:
            self.loader.hood.startSky()
            lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
            lightsOn.start()
        self.accept('doorDoneEvent', self.handleDoorDoneEvent)
        self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
        self.enterZone(requestStatus['zoneId'])
        self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
        self.fsm.request(requestStatus['how'], [requestStatus])
    def enter(self, requestStatus):
        CogHQExterior.CogHQExterior.enter(self, requestStatus)

        for train in self.trains:
            train.show()

        # Load the CogHQ DNA file:
        dnaStore = DNAStorage()
        dnaFileName = self.genDNAFileName(self.zoneId)
        loadDNAFileAI(dnaStore, dnaFileName)

        # Collect all of the vis group zone IDs:
        self.zoneVisDict = {}
        for i in xrange(dnaStore.getNumDNAVisGroupsAI()):
            groupFullName = dnaStore.getDNAVisGroupName(i)
            visGroup = dnaStore.getDNAVisGroupAI(i)
            visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
            visibles = []
            for i in xrange(visGroup.getNumVisibles()):
                visibles.append(int(visGroup.getVisible(i)))
            visibles.append(ZoneUtil.getBranchZone(visZoneId))
            self.zoneVisDict[visZoneId] = visibles

        # Next, we want interest in all vis groups due to this being a Cog HQ:
        base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])
 def handleToonInteriorDone(self):
     status = self.place.doneStatus
     if ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         messenger.send(self.doneEvent)
     return
 def streetDone(self):
     self.requestStatus = self.place.doneStatus
     status = self.place.doneStatus
     if status['loader'] == 'townLoader' and ZoneUtil.getBranchZone(status['zoneId']) == self.branchZone and status['shardId'] == None:
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         messenger.send(self.doneEvent)
     return
 def handlePlaygroundDone(self):
     status = self.place.doneStatus
     if self.enteringARace(status) and status.get('shardId') == None:
         zoneId = status['zoneId']
         self.fsm.request('quietZone', [status])
     elif ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         messenger.send(self.doneEvent)
Beispiel #6
0
 def streetDone(self):
     self.requestStatus = self.place.doneStatus
     status = self.place.doneStatus
     if status['loader'] == 'townLoader' and ZoneUtil.getBranchZone(
             status['zoneId']
     ) == self.branchZone and status['shardId'] == None:
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         messenger.send(self.doneEvent)
     return
 def load(self, zoneId):
     self.zoneId = zoneId
     self.parentFSMState.addChild(self.fsm)
     self.loadBattleAnims()
     self.branchZone = ZoneUtil.getBranchZone(zoneId)
     self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId)
     self.music = base.loadMusic(self.musicFile)
     self.activityMusic = base.loadMusic(self.activityMusicFile)
     self.battleMusic = base.loadMusic('phase_3.5/audio/bgm/encntr_general_bg.ogg')
     self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent)
     self.townBattle.load()
 def handlePlaygroundDone(self):
     status = self.place.doneStatus
     if self.enteringAGolfCourse(status) and status.get('shardId') == None:
         zoneId = status['zoneId']
         self.fsm.request('quietZone', [status])
     elif ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         messenger.send(self.doneEvent)
     return
 def handlePlaygroundDone(self):
     status = self.place.doneStatus
     teleportDebug(status, 'handlePlaygroundDone, doneStatus=%s' % (status,))
     if ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
         teleportDebug(status, 'same branch')
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         teleportDebug(status, 'different hood')
         messenger.send(self.doneEvent)
     return
Beispiel #10
0
 def load(self, zoneId):
     self.zoneId = zoneId
     self.parentFSMState.addChild(self.fsm)
     self.loadBattleAnims()
     self.branchZone = ZoneUtil.getBranchZone(zoneId)
     self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId)
     self.music = base.loadMusic(self.musicFile)
     self.activityMusic = base.loadMusic(self.activityMusicFile)
     self.battleMusic = base.loadMusic(
         'phase_3.5/audio/bgm/encntr_general_bg.ogg')
     self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent)
     self.townBattle.load()
    def recoverItems(self, av, suitsKilled, taskZoneId):
        # Get the avatars current quests.
        avQuests = av.getQuests()
        questList = []
        recoveredItems = []
        unrecoveredItems = []
        taskZoneId = ZoneUtil.getBranchZone(taskZoneId)

        # Iterate through the avatars current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex], av.doId)

            # Check if the Quest isnt already complete
            if questClass.getCompletionStatus(av, questDesc) == Quests.INCOMPLETE:

                # Check if we are dealing with a RecoverItemQuest
                if isinstance(questClass, Quests.RecoverItemQuest):

                    # Iterate through all the Cogs that were killed in the battle
                    for suit in suitsKilled:

                        # Because the RecoveItemQuest class doesn't have a
                        # function to see if a Cog counts. We need to manually
                        # check if the Cog is valid for the Quest
                        if (questClass.getHolder() == Quests.Any) or \
                            (questClass.getHolderType() == 'type' and \
                            questClass.getHolder() == suit['type']) or \
                            (questClass.getHolderType() == 'track' and \
                            questClass.getHolder() == suit['track']) or \
                            (questClass.getHolderType() == 'level' and \
                            questClass.getHolder() <= suit['level']):

                            # It looks like the Cog was valid. Lets see if they
                            # found what they were looking for.
                            baseChance = questClass.getPercentChance()
                            amountRemaining = questClass.getNumItems() - questDesc[QuestProgressIndex]
                            chance = Quests.calcRecoverChance(amountRemaining, baseChance)

                            # They found it! Give them their reward!
                            if chance >= baseChance:
                                questDesc[QuestProgressIndex] += 1
                                recoveredItems.append(questClass.getItem())

                            # Better luck next time :(
                            else:
                                unrecoveredItems.append(questClass.getItem())

            questList.append(questDesc)

        av.b_setQuests(questList)

        return (recoveredItems, unrecoveredItems)
    def makeDictionaries(self, dnaStore):
        self.nodeDict = {}
        self.zoneDict = {}
        self.zoneVisDict = {}
        self.nodeList = []
        self.fadeInDict = {}
        self.fadeOutDict = {}
        a1 = Vec4(1, 1, 1, 1)
        a0 = Vec4(1, 1, 1, 0)
        numVisGroups = dnaStore.getNumDNAVisGroupsAI()
        for i in xrange(numVisGroups):
            groupFullName = dnaStore.getDNAVisGroupName(i)
            visGroup = dnaStore.getDNAVisGroupAI(i)
            groupName = base.cr.hoodMgr.extractGroupName(groupFullName)
            zoneId = int(groupName)
            groupNode = self.geom.find('**/' + groupFullName)
            if groupNode.isEmpty():
                self.notify.error('Could not find visgroup')
            else:
                if ':' in groupName:
                    groupName = '%s%s' % (zoneId, groupName[groupName.index(':'):])
                else:
                    groupName = '%s' % zoneId
                groupNode.setName(groupName)
            groupNode.flattenMedium()
            self.nodeDict[zoneId] = []
            self.nodeList.append(groupNode)
            self.zoneDict[zoneId] = groupNode
            visibles = []
            for i in xrange(visGroup.getNumVisibles()):
                visibles.append(int(visGroup.getVisible(i)))
            visibles.append(ZoneUtil.getBranchZone(zoneId))
            self.zoneVisDict[zoneId] = visibles
            fadeDuration = 0.5
            self.fadeOutDict[groupNode] = Sequence(Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a0, startColorScale=a1), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), Func(groupNode.stash), name='fadeZone-' + str(zoneId), autoPause=1)
            self.fadeInDict[groupNode] = Sequence(Func(groupNode.unstash), Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a1, startColorScale=a0), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), name='fadeZone-' + str(zoneId), autoPause=1)

        for i in xrange(numVisGroups):
            groupFullName = dnaStore.getDNAVisGroupName(i)
            zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
            for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)):
                visName = dnaStore.getVisibleName(i, j)
                groupName = base.cr.hoodMgr.extractGroupName(visName)
                nextZoneId = int(groupName)
                visNode = self.zoneDict[nextZoneId]
                self.nodeDict[zoneId].append(visNode)

        self.hood.dnaStore.resetPlaceNodes()
        self.hood.dnaStore.resetDNAGroups()
        self.hood.dnaStore.resetDNAVisGroups()
        self.hood.dnaStore.resetDNAVisGroupsAI()
 def handlePlaygroundDone(self):
     status = self.place.doneStatus
     teleportDebug(status,
                   'handlePlaygroundDone, doneStatus=%s' % (status, ))
     if ZoneUtil.getBranchZone(
             status['zoneId']
     ) == self.hood.hoodId and status['shardId'] == None:
         teleportDebug(status, 'same branch')
         self.fsm.request('quietZone', [status])
     else:
         self.doneStatus = status
         teleportDebug(status, 'different hood')
         messenger.send(self.doneEvent)
     return
 def __teleportOutDone(self, requestStatus):
     hoodId = requestStatus['hoodId']
     zoneId = requestStatus['zoneId']
     shardId = requestStatus['shardId']
     if hoodId == self.loader.hood.id and shardId == None:
         if zoneId == self.zoneId:
             self.fsm.request('teleportIn', [requestStatus])
         elif requestStatus['where'] == 'street' and ZoneUtil.getBranchZone(zoneId) == self.loader.branchZone:
             self.fsm.request('quietZone', [requestStatus])
         else:
             self.doneStatus = requestStatus
             messenger.send(self.doneEvent)
     elif hoodId == ToontownGlobals.MyEstate:
         self.getEstateZoneAndGoHome(requestStatus)
     else:
         self.doneStatus = requestStatus
         messenger.send(self.doneEvent)
     return
    def toonKilledBuilding(self, av, type, difficulty, floors, zoneId, cogdo):
        # Get the avatars current quests.
        avQuests = av.getQuests()
        questList = []
        zoneId = ZoneUtil.getBranchZone(zoneId)

        # Iterate through the avatars current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex], av.doId)
            if isinstance(questClass, Quests.BuildingQuest) and questClass.getCompletionStatus(av, questDesc) == Quests.INCOMPLETE:
                if questClass.isLocationMatch(zoneId) and questClass.doesBuildingTypeCount(type):
                    if questClass.isCogdo() == cogdo:
                        if floors >= questClass.getNumFloors():
                            questDesc[QuestProgressIndex] += 1
            questList.append(questDesc)

        av.b_setQuests(questList)
Beispiel #16
0
 def __teleportOutDone(self, requestStatus):
     hoodId = requestStatus['hoodId']
     zoneId = requestStatus['zoneId']
     shardId = requestStatus['shardId']
     if hoodId == self.loader.hood.id and shardId == None:
         if zoneId == self.zoneId:
             self.fsm.request('teleportIn', [requestStatus])
         elif requestStatus['where'] == 'street' and ZoneUtil.getBranchZone(
                 zoneId) == self.loader.branchZone:
             self.fsm.request('quietZone', [requestStatus])
         else:
             self.doneStatus = requestStatus
             messenger.send(self.doneEvent)
     elif hoodId == ToontownGlobals.MyEstate:
         self.getEstateZoneAndGoHome(requestStatus)
     else:
         self.doneStatus = requestStatus
         messenger.send(self.doneEvent)
     return
Beispiel #17
0
    def enter(self, requestStatus, visibilityFlag=1, arrowsOn=1):
        teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus, ))
        self._ttfToken = None
        self.fsm.enterInitialState()
        base.playMusic(self.loader.music, looping=1, volume=0.8)
        self.loader.geom.reparentTo(render)
        if visibilityFlag:
            self.visibilityOn()
        base.localAvatar.setGeom(self.loader.geom)
        base.localAvatar.setOnLevelGround(1)
        self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH)
        NametagGlobals.setMasterArrowsOn(arrowsOn)
        self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId'])

        def __lightDecorationOn__():
            geom = base.cr.playGame.getPlace().loader.geom
            self.halloweenLights = geom.findAllMatches('**/*light*')
            self.halloweenLights += geom.findAllMatches('**/*lamp*')
            self.halloweenLights += geom.findAllMatches('**/prop_snow_tree*')
            for light in self.halloweenLights:
                light.setColorScaleOff(1)

        if base.cr.newsManager.isHolidayRunning(
                ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile:
            lightsOff = Sequence(
                LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1,
                                       Vec4(0.55, 0.55, 0.65, 1)),
                Func(self.loader.hood.startSpookySky))
            lightsOff.start()
        else:
            self.loader.hood.startSky()
            lightsOn = LerpColorScaleInterval(
                base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
            lightsOn.start()
        self.accept('doorDoneEvent', self.handleDoorDoneEvent)
        self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
        self.enterZone(requestStatus['zoneId'])
        self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(
            self, self.loader.nodeList)
        self.fsm.request(requestStatus['how'], [requestStatus])
Beispiel #18
0
    def enter(self, requestStatus):
        self.zoneId = requestStatus['zoneId']

        # Load the CogHQ DNA file:
        dnaStore = DNAStorage()
        dnaFileName = self.genDNAFileName(self.zoneId)

        if not dnaFileName.endswith('13200.pdna'):

            loadDNAFileAI(dnaStore, dnaFileName)

            # Collect all of the vis group zone IDs:
            self.zoneVisDict = {}
            for i in xrange(dnaStore.getNumDNAVisGroupsAI()):
                groupFullName = dnaStore.getDNAVisGroupName(i)
                visGroup = dnaStore.getDNAVisGroupAI(i)
                visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
                visibles = []
                for i in xrange(visGroup.getNumVisibles()):
                    visibles.append(int(visGroup.getVisible(i)))
                visibles.append(ZoneUtil.getBranchZone(visZoneId))
                self.zoneVisDict[visZoneId] = visibles

            # Next, we want interest in all vis groups due to this being a Cog HQ:
            base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])

        BattlePlace.BattlePlace.enter(self)
        self.fsm.enterInitialState()
        base.playMusic(self.loader.music, looping=1, volume=0.8)
        self.loader.geom.reparentTo(render)
        self.nodeList = [self.loader.geom]
        self.loader.hood.startSky()
        self._telemLimiter = TLGatherAllAvs('FactoryExterior', RotationLimitToH)
        self.accept('doorDoneEvent', self.handleDoorDoneEvent)
        self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
        NametagGlobals.setMasterArrowsOn(1)
        self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList)
        how = requestStatus['how']
        self.fsm.request(how, [requestStatus])
    def enter(self, requestStatus):
        CogHQExterior.CogHQExterior.enter(self, requestStatus)

        # Load the CogHQ DNA file:
        dnaStore = DNAStorage()
        dnaFileName = self.genDNAFileName(self.zoneId)
        loadDNAFileAI(dnaStore, dnaFileName)

        # Collect all of the vis group zone IDs:
        self.zoneVisDict = {}
        for i in xrange(dnaStore.getNumDNAVisGroupsAI()):
            groupFullName = dnaStore.getDNAVisGroupName(i)
            visGroup = dnaStore.getDNAVisGroupAI(i)
            visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
            visibles = []
            for i in xrange(visGroup.getNumVisibles()):
                visibles.append(int(visGroup.getVisible(i)))
            visibles.append(ZoneUtil.getBranchZone(visZoneId))
            self.zoneVisDict[visZoneId] = visibles

        # Next, we want interest in all vis groups due to this being a Cog HQ:
        base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])
Beispiel #20
0
    def makeDictionaries(self, dnaStore):
        self.nodeDict = {}
        self.zoneDict = {}
        self.zoneVisDict = {}
        self.nodeList = []
        self.fadeInDict = {}
        self.fadeOutDict = {}
        a1 = Vec4(1, 1, 1, 1)
        a0 = Vec4(1, 1, 1, 0)
        numVisGroups = dnaStore.getNumDNAVisGroupsAI()
        for i in xrange(numVisGroups):
            groupFullName = dnaStore.getDNAVisGroupName(i)
            visGroup = dnaStore.getDNAVisGroupAI(i)
            groupName = base.cr.hoodMgr.extractGroupName(groupFullName)
            zoneId = int(groupName)
            groupNode = self.geom.find('**/' + groupFullName)
            if groupNode.isEmpty():
                self.notify.error('Could not find visgroup')
            else:
                if ':' in groupName:
                    groupName = '%s%s' % (zoneId,
                                          groupName[groupName.index(':'):])
                else:
                    groupName = '%s' % zoneId
                groupNode.setName(groupName)
            groupNode.flattenMedium()
            self.nodeDict[zoneId] = []
            self.nodeList.append(groupNode)
            self.zoneDict[zoneId] = groupNode
            visibles = []
            for i in xrange(visGroup.getNumVisibles()):
                visibles.append(int(visGroup.getVisible(i)))
            visibles.append(ZoneUtil.getBranchZone(zoneId))
            self.zoneVisDict[zoneId] = visibles
            fadeDuration = 0.5
            self.fadeOutDict[groupNode] = Sequence(
                Func(groupNode.setTransparency, 1),
                LerpColorScaleInterval(groupNode,
                                       fadeDuration,
                                       a0,
                                       startColorScale=a1),
                Func(groupNode.clearColorScale),
                Func(groupNode.clearTransparency),
                Func(groupNode.stash),
                name='fadeZone-' + str(zoneId),
                autoPause=1)
            self.fadeInDict[groupNode] = Sequence(
                Func(groupNode.unstash),
                Func(groupNode.setTransparency, 1),
                LerpColorScaleInterval(groupNode,
                                       fadeDuration,
                                       a1,
                                       startColorScale=a0),
                Func(groupNode.clearColorScale),
                Func(groupNode.clearTransparency),
                name='fadeZone-' + str(zoneId),
                autoPause=1)

        for i in xrange(numVisGroups):
            groupFullName = dnaStore.getDNAVisGroupName(i)
            zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
            for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)):
                visName = dnaStore.getVisibleName(i, j)
                groupName = base.cr.hoodMgr.extractGroupName(visName)
                nextZoneId = int(groupName)
                visNode = self.zoneDict[nextZoneId]
                self.nodeDict[zoneId].append(visNode)

        self.hood.dnaStore.resetPlaceNodes()
        self.hood.dnaStore.resetDNAGroups()
        self.hood.dnaStore.resetDNAVisGroups()
        self.hood.dnaStore.resetDNAVisGroupsAI()
    def update(self, questDesc):
        questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
        quest = Quests.getQuest(questId)
        self.teleportButton['command'] = self.teleportToShop
        self.teleportButton['extraArgs'] = [toNpcId]
        if quest == None:
            self.notify.warning(
                'Tried to display poster for unknown quest %s' % questId)
            return
        if rewardId == Quests.NA:
            finalReward = Quests.getFinalRewardId(questId, fAll=1)
            transformedReward = Quests.transformReward(finalReward,
                                                       base.localAvatar)
            reward = Quests.getReward(transformedReward)
        else:
            reward = Quests.getReward(rewardId)
        if reward and questId not in Quests.NoRewardTierZeroQuests:
            rewardString = reward.getPosterString()
        else:
            rewardString = ''
        self.rewardText['text'] = rewardString
        self.fitLabel(self.rewardText)

        if Quests.isQuestJustForFun(questId, rewardId):
            self.funQuest.show()
        else:
            self.funQuest.hide()

        if self._deleteCallback:
            self.showDeleteButton(questDesc)
        else:
            self.hideDeleteButton()
        if self.laffMeter:
            self.laffMeter.destroy()
        fComplete = quest.getCompletionStatus(base.localAvatar,
                                              questDesc) == Quests.COMPLETE

        if Quests.isQuestJustForFun(questId, rewardId):
            if fComplete:
                self.funQuest.hide()
                self.teleportButton.show()
            else:
                self.teleportButton.hide()

        if toNpcId == Quests.ToonHQ:
            self.teleportButton.show()
            self.teleportButton.setPos(0.285, 0, -0.15)
            toNpcName = TTLocalizer.QuestPosterHQOfficer
            toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
            toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
            toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
        elif toNpcId == Quests.ToonTailor:
            self.teleportButton.show()
            self.teleportButton.setPos(0.285, 0, -0.15)
            toNpcName = TTLocalizer.QuestPosterTailor
            toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
            toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
            toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
        else:
            self.teleportButton.show()
            self.teleportButton.setPos(0.285, 0, -0.15)
            toNpcName = NPCToons.getNPCName(toNpcId)
            toNpcZone = NPCToons.getNPCZone(toNpcId)
            toNpcHoodId = ZoneUtil.getCanonicalHoodId(toNpcZone)
            toNpcLocationName = base.cr.hoodMgr.getFullnameFromId(toNpcHoodId)
            toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone)
            toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone)
            toNpcStreetName = ZoneUtil.getStreetName(toNpcBranchId)
        lPos = Vec3(0, 0, 0.13)
        lIconGeom = None
        lIconGeomScale = 1
        rIconGeom = None
        rIconGeomScale = 1
        infoText = ''
        infoZ = TTLocalizer.QPinfoZ
        auxText = None
        auxTextPos = Vec3(0, 0, 0.12)
        headlineString = quest.getHeadlineString()
        objectiveStrings = quest.getObjectiveStrings()
        captions = map(string.capwords, quest.getObjectiveStrings())
        imageColor = Vec4(*self.colors['white'])
        if isinstance(quest, Quests.TexturedQuest) and quest.hasFrame():
            self.teleportButton.hide()
            frame = quest.getFrame()
            frameBgColor = frame[1]
            lIconGeom = frame[0]
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.DeliverGagQuest or quest.getType(
        ) == Quests.DeliverItemQuest:
            frameBgColor = 'red'
            if fComplete:
                self.teleportButton.show()
                self.teleportButton.setPos(0.175, 0, -0.125)
            if quest.getType() == Quests.DeliverGagQuest:
                invModel = loader.loadModel(
                    'phase_3.5/models/gui/inventory_icons')
                track, item = quest.getGagType()
                lIconGeom = invModel.find('**/' + AvPropsNew[track][item])
                invModel.removeNode()
            else:
                bookModel = loader.loadModel(
                    'phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = bookModel.find('**/package')
                lIconGeomScale = 0.12
                bookModel.removeNode()
            if not fComplete:
                captions.append(toNpcName)
                auxText = TTLocalizer.QuestPosterAuxTo
                auxTextPos.setZ(0.12)
                lPos.setX(-0.18)
                infoText = TTLocalizer.QuestPageDestination % (
                    toNpcBuildingName, toNpcStreetName, toNpcLocationName)
                rIconGeom = self.createNpcToonHead(toNpcId)
                rIconGeomScale = IMAGE_SCALE_SMALL
                self.teleportButton.setPos(0.285, 0, -0.15)
        elif quest.getType() == Quests.RecoverItemQuest:
            frameBgColor = 'green'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/package')
            lIconGeomScale = 0.12
            bookModel.removeNode()
            if not fComplete:
                rIconGeomScale = IMAGE_SCALE_SMALL
                holder = quest.getHolder()
                holderType = quest.getHolderType()
                if holder == Quests.Any:
                    cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                    rIconGeom = cogIcons.find('**/cog')
                    cogIcons.removeNode()
                    lPos.setX(-0.18)
                    auxText = TTLocalizer.QuestPosterAuxFrom
                elif holder == Quests.AnyFish:
                    headlineString = TTLocalizer.QuestPosterFishing
                    auxText = TTLocalizer.QuestPosterAuxFor
                    auxTextPos.setX(-0.18)
                    captions = captions[:1]
                else:
                    if holderType == 'track':
                        cogIcons = loader.loadModel(
                            'phase_3/models/gui/cog_icons')
                        if holder in SuitDNA.suitDeptModelPaths:
                            icon = cogIcons.find(
                                SuitDNA.suitDeptModelPaths[holder])
                        rIconGeom = icon.copyTo(hidden)
                        rIconGeom.setColor(Suit.Suit.medallionColors[holder])
                        rIconGeomScale = 0.12
                        cogIcons.removeNode()
                    elif holderType == 'level':
                        cogIcons = loader.loadModel(
                            'phase_3/models/gui/cog_icons')
                        rIconGeom = cogIcons.find('**/cog')
                        rIconGeomScale = IMAGE_SCALE_SMALL
                        cogIcons.removeNode()
                    else:
                        rIconGeom = self.createSuitHead(holder)
                    lPos.setX(-0.18)
                    auxText = TTLocalizer.QuestPosterAuxFrom
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
            else:
                self.teleportButton.show()
        elif quest.getType() == Quests.VisitQuest:
            self.teleportButton.show()
            frameBgColor = 'brown'
            captions[0] = '%s' % toNpcName
            lIconGeom = self.createNpcToonHead(toNpcId)
            lIconGeomScale = IMAGE_SCALE_SMALL
            if not fComplete:
                infoText = TTLocalizer.QuestPageDestination % (
                    toNpcBuildingName, toNpcStreetName, toNpcLocationName)
        elif quest.getType() == Quests.TrackChoiceQuest:
            frameBgColor = 'green'
            filmstrip = loader.loadModel('phase_3.5/models/gui/filmstrip')
            lIconGeom = DirectFrame(parent=self,
                                    relief=None,
                                    image=filmstrip,
                                    image_scale=.5)
            self.question = DirectLabel(parent=lIconGeom,
                                        relief=None,
                                        pos=(0, 0, 0),
                                        text='?',
                                        text_scale=0.2,
                                        text_pos=(0, -0.04),
                                        text_fg=(0.72, 0.72, 0.72, 1))
            lIconGeom['image_color'] = Vec4(0.7, 0.7, 0.7, 1)
            self.question['text_fg'] = Vec4(0.6, 0.6, 0.6, 1)
            rIconGeom = None
            filmstrip.removeNode()
        elif quest.getType() == Quests.BuildingQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            track = quest.getBuildingTrack()
            numFloors = quest.getNumFloors()
            if track == 'c':
                lIconGeom = loader.loadModel(
                    'phase_4/models/modules/suit_landmark_corp')
            elif track == 'l':
                lIconGeom = loader.loadModel(
                    'phase_4/models/modules/suit_landmark_legal')
            elif track == 'm':
                lIconGeom = loader.loadModel(
                    'phase_4/models/modules/suit_landmark_money')
            elif track == 's':
                lIconGeom = loader.loadModel(
                    'phase_4/models/modules/suit_landmark_sales')
            else:
                bookModel = loader.loadModel(
                    'phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = bookModel.find('**/COG_building')
                bookModel.removeNode()
            if lIconGeom and track != Quests.Any:
                self.loadElevator(lIconGeom, numFloors)
                lIconGeom.setH(180)
                self.fitGeometry(lIconGeom, fFlip=0)
                lIconGeomScale = IMAGE_SCALE_SMALL
            else:
                lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.FactoryQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/factoryIcon2')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.MintQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/CashBotMint')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.CogPartQuest:
            self.teleportButton.hide()
            frameBgColor = 'green'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/CogArmIcon2')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.ForemanQuest or quest.getType(
        ) == Quests.SupervisorQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/skelecog5')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.RescueQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            lIconGeom = self.createNpcToonHead(
                random.choice(NPCToons.HQnpcFriends.keys()))
            lIconGeomScale = 0.13
            infoText = quest.getLocationName().strip()
        elif quest.getType() == Quests.FriendQuest:
            self.teleportButton.hide()
            frameBgColor = 'brown'
            gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
            lIconGeom = gui.find('**/FriendsBox_Closed')
            lIconGeomScale = 0.45
            gui.removeNode()
            infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.TrolleyQuest:
            self.teleportButton.hide()
            frameBgColor = 'lightBlue'
            gui = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = gui.find('**/trolley')
            lIconGeomScale = 0.13
            gui.removeNode()
            infoText = TTLocalizer.QuestPosterPlayground
        elif quest.getType() == Quests.MailboxQuest:
            self.teleportButton.hide()
            frameBgColor = 'lightBlue'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/package')
            lIconGeomScale = 0.12
            bookModel.removeNode()
            infoText = TTLocalizer.QuestPosterAtHome
        elif quest.getType() == Quests.PhoneQuest:
            self.teleportButton.hide()
            frameBgColor = 'lightBlue'
            bookModel = loader.loadModel(
                'phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/clarabelleCow')
            lIconGeomScale = 0.12
            bookModel.removeNode()
            infoText = TTLocalizer.QuestPosterOnPhone
        else:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            if quest.getType() == Quests.CogTrackQuest:
                dept = quest.getCogTrack()
                cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                lIconGeomScale = 0.13
                if dept in SuitDNA.suitDeptModelPaths:
                    icon = cogIcons.find(SuitDNA.suitDeptModelPaths[dept])
                lIconGeom = icon.copyTo(hidden)
                lIconGeom.setColor(Suit.Suit.medallionColors[dept])
                cogIcons.removeNode()
            elif quest.getType() == Quests.CogQuest:
                if quest.getCogType() != Quests.Any:
                    lIconGeom = self.createSuitHead(quest.getCogType())
                    lIconGeomScale = IMAGE_SCALE_SMALL
                else:
                    cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                    lIconGeom = cogIcons.find('**/cog')
                    lIconGeomScale = IMAGE_SCALE_SMALL
                    cogIcons.removeNode()
            elif quest.getType() == Quests.CogLevelQuest:
                cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                lIconGeom = cogIcons.find('**/cog')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkelecogTrackQuest:
                dept = quest.getCogTrack()
                cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                lIconGeomScale = 0.13
                if dept in SuitDNA.suitDeptModelPaths:
                    icon = cogIcons.find(SuitDNA.suitDeptModelPaths[dept])
                lIconGeom = icon.copyTo(hidden)
                lIconGeom.setColor(Suit.Suit.medallionColors[dept])
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkelecogQuest:
                cogIcons = loader.loadModel(
                    'phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = cogIcons.find('**/skelecog5')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkelecogLevelQuest:
                cogIcons = loader.loadModel(
                    'phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = cogIcons.find('**/skelecog5')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkeleReviveQuest:
                cogIcons = loader.loadModel(
                    'phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = cogIcons.find('**/skelecog5')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        if fComplete:
            self.teleportButton.show()
            textColor = (0, 0.3, 0, 1)
            imageColor = Vec4(*self.colors['lightGreen'])
            lPos.setX(-0.18)
            rIconGeom = self.createNpcToonHead(toNpcId)
            rIconGeomScale = IMAGE_SCALE_SMALL
            captions = captions[:1]
            captions.append(toNpcName)
            auxText = TTLocalizer.QuestPosterAuxReturnTo
            headlineString = TTLocalizer.QuestPosterComplete
            infoText = TTLocalizer.QuestPageDestination % (
                toNpcBuildingName, toNpcStreetName, toNpcLocationName)
            if self.laffMeter is not None:
                self.laffMeter.reparentTo(hidden)
                self.laffMeter.destroy()
                self.laffMeter = None
        else:
            textColor = self.normalTextColor
        self.show()
        self['image_color'] = imageColor
        self.headline['text_fg'] = textColor
        self.headline['text'] = headlineString
        if quest.getType() != Quests.TrackChoiceQuest:
            self.lPictureFrame.show()
            self.lPictureFrame.setPos(lPos)
            self.lPictureFrame['text_scale'] = TEXT_SCALE
            if lPos[0] != 0:
                self.lPictureFrame['text_scale'] = 0.0325
            self.lPictureFrame['text'] = captions[0]
            self.lPictureFrame['image_color'] = Vec4(
                *self.colors[frameBgColor])
        else:
            self.lPictureFrame['text'] = 'Track Choice'
            self.lPictureFrame['image_color'] = Vec4(
                *self.colors[frameBgColor])
        if len(captions) > 1 and quest.getType() != Quests.TrackChoiceQuest:
            self.rPictureFrame['text'] = captions[1]
            self.rPictureFrame['text_scale'] = 0.0325
            self.rPictureFrame['image_color'] = Vec4(
                *self.colors[frameBgColor])
        else:
            self.rPictureFrame.hide()
        self._deleteGeoms()
        self.lQuestIcon['geom'] = lIconGeom
        self.lQuestIcon['geom_pos'] = (0, 10, 0)
        if lIconGeom:
            try:
                self.lQuestIcon['geom_scale'] = lIconGeomScale
            except:
                pass
            try:
                self.lQuestIcon['geom_pos'] = Point3(lIconGeomPos[0],
                                                     lIconGeomPos[1],
                                                     lIconGeomPos[2])
            except:
                pass
            try:
                self.lQuestIcon['geom_hpr'] = Point3(lIconGeomHpr[0],
                                                     lIconGeomHpr[1],
                                                     lIconGeomHpr[2])
            except:
                pass
        if self.laffMeter != None:
            self.laffMeter.reparentTo(self.lQuestIcon)
        self.rQuestIcon['geom'] = rIconGeom
        self.rQuestIcon['geom_pos'] = (0, 10, 0)
        if rIconGeom:
            self.rQuestIcon['geom_scale'] = rIconGeomScale
        if auxText:
            self.auxText.show()
            self.auxText['text'] = auxText
            self.auxText.setPos(auxTextPos)
        else:
            self.auxText.hide()
        self.bind(DGG.WITHIN, self.mouseEnterPoster)
        self.bind(DGG.WITHOUT, self.mouseExitPoster)
        numQuestItems = quest.getNumQuestItems()
        if fComplete or numQuestItems <= 1:
            self.questProgress.hide()
            if not quest.getType() == Quests.TrackChoiceQuest:
                infoZ = -0.075
        else:
            self.questProgress.show()
            self.questProgress['value'] = toonProgress & pow(2, 16) - 1
            self.questProgress['range'] = numQuestItems
            self.questProgress['text'] = quest.getProgressString(
                base.localAvatar, questDesc)
        self.questInfo['text'] = infoText
        self.questInfo.setZ(infoZ)
        self.fitLabel(self.questInfo)
        if not Quests.QuestDict[questId][0] >= 11:
            self.teleportButton.hide()
        return
    def begin(self, range, label, gui, tipCategory, zoneId):
        self.defaultTex = "phase_3.5/maps/loading/default.jpg"
        self.defaultFont = ToontownGlobals.getInterfaceFont()
        self.defaultFontColor = (0, 0, 0.5, 1)
        self.zone2picture = {
            ToontownGlobals.GoofySpeedway: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.ToontownCentral: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SillyStreet: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.LoopyLane: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.PunchlinePlace: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.DonaldsDock: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.BarnacleBoulevard: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SeaweedStreet: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.LighthouseLane: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.DaisyGardens: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.ElmStreet: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.MapleStreet: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.OakStreet: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.MinniesMelodyland: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.AltoAvenue: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.BaritoneBoulevard: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.TenorTerrace: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.TheBrrrgh: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.WalrusWay: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SleetStreet: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.PolarPlace: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.DonaldsDreamland: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.LullabyLane: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.PajamaPlace: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.OutdoorZone: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.GolfZone: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SellbotHQ: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SellbotFactoryExt: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SellbotFactoryInt: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.SellbotMegaCorpInt: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.CashbotHQ: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.LawbotHQ: "phase_3.5/maps/loading/toon.jpg",
            ToontownGlobals.BossbotHQ: "phase_3.5/maps/loading/toon.jpg",
        }
        self.zone2font = {
            # Toontown Central Loader Fonts
            ToontownGlobals.GoofySpeedway: ToontownGlobals.getSignFont(),
            ToontownGlobals.ToontownCentral: ToontownGlobals.getCentralFont(),
            ToontownGlobals.SillyStreet: ToontownGlobals.getCentralFont(),
            ToontownGlobals.LoopyLane: ToontownGlobals.getCentralFont(),
            ToontownGlobals.PunchlinePlace: ToontownGlobals.getCentralFont(),
            # Donalds Dock Loader Fonts
            ToontownGlobals.DonaldsDock: ToontownGlobals.getDockFont(),
            ToontownGlobals.BarnacleBoulevard: ToontownGlobals.getDockFont(),
            ToontownGlobals.SeaweedStreet: ToontownGlobals.getDockFont(),
            ToontownGlobals.LighthouseLane: ToontownGlobals.getDockFont(),
            # Daisys Gardens Loader Fonts
            ToontownGlobals.DaisyGardens: ToontownGlobals.getGardenFont(),
            ToontownGlobals.ElmStreet: ToontownGlobals.getGardenFont(),
            ToontownGlobals.MapleStreet: ToontownGlobals.getGardenFont(),
            ToontownGlobals.OakStreet: ToontownGlobals.getGardenFont(),
            # Minnies Melodyland Loader Fonts
            ToontownGlobals.MinniesMelodyland: ToontownGlobals.getMelodyFont(),
            ToontownGlobals.AltoAvenue: ToontownGlobals.getMelodyFont(),
            ToontownGlobals.BaritoneBoulevard: ToontownGlobals.getMelodyFont(),
            ToontownGlobals.TenorTerrace: ToontownGlobals.getMelodyFont(),
            # Brghhh Loader Fonts
            ToontownGlobals.TheBrrrgh: ToontownGlobals.getFrostFont(),
            ToontownGlobals.WalrusWay: ToontownGlobals.getFrostFont(),
            ToontownGlobals.SleetStreet: ToontownGlobals.getFrostFont(),
            ToontownGlobals.PolarPlace: ToontownGlobals.getFrostFont(),
            # Donalds Dreamland Loader Fonts
            ToontownGlobals.DonaldsDreamland: ToontownGlobals.getDreamFont(),
            ToontownGlobals.LullabyLane: ToontownGlobals.getDreamFont(),
            ToontownGlobals.PajamaPlace: ToontownGlobals.getDreamFont(),
            # Other Zone Fonts
            ToontownGlobals.OutdoorZone: ToontownGlobals.getSignFont(),
            ToontownGlobals.GolfZone: ToontownGlobals.getSignFont(),
            # Cog Loader Fonts (Never edit, they are good as they currently are)
            ToontownGlobals.SellbotHQ: ToontownGlobals.getSuitFont(),
            ToontownGlobals.SellbotFactoryExt: ToontownGlobals.getSuitFont(),
            ToontownGlobals.SellbotFactoryInt: ToontownGlobals.getSuitFont(),
            ToontownGlobals.SellbotMegaCorpInt: ToontownGlobals.getSuitFont(),
            ToontownGlobals.CashbotHQ: ToontownGlobals.getSuitFont(),
            ToontownGlobals.LawbotHQ: ToontownGlobals.getSuitFont(),
            ToontownGlobals.BossbotHQ: ToontownGlobals.getSuitFont(),
        }
        self.zone2fontcolor = {
            ToontownGlobals.GoofySpeedway: VBase4(0.2, 0.6, 0.9, 1.0),
            ToontownGlobals.ToontownCentral: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
            ToontownGlobals.SillyStreet: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
            ToontownGlobals.LoopyLane: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
            ToontownGlobals.PunchlinePlace: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
            ToontownGlobals.DonaldsDock: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
            ToontownGlobals.BarnacleBoulevard: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
            ToontownGlobals.SeaweedStreet: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
            ToontownGlobals.LighthouseLane: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
            ToontownGlobals.DaisyGardens: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
            ToontownGlobals.ElmStreet: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
            ToontownGlobals.MapleStreet: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
            ToontownGlobals.OakStreet: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
            ToontownGlobals.MinniesMelodyland: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.0),
            ToontownGlobals.AltoAvenue: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.00),
            ToontownGlobals.BaritoneBoulevard: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.0),
            ToontownGlobals.TenorTerrace: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.0),
            ToontownGlobals.TheBrrrgh: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.WalrusWay: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.SleetStreet: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.PolarPlace: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.DonaldsDreamland: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
            ToontownGlobals.LullabyLane: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
            ToontownGlobals.PajamaPlace: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
            ToontownGlobals.OutdoorZone: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
            ToontownGlobals.GolfZone: VBase4(0.2, 0.6, 0.9, 1.0),
            ToontownGlobals.SellbotHQ: (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
            ToontownGlobals.SellbotFactoryExt: (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
            ToontownGlobals.SellbotFactoryInt: (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
            ToontownGlobals.SellbotMegaCorpInt: ((0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0)),
            ToontownGlobals.CashbotHQ: (0.2274509803921569, 0.7215686274509804, 0.0509803921568627, 1.0),
            ToontownGlobals.LawbotHQ: (0.1294117647058824, 0.2549019607843137, 0.8705882352941176, 1.0),
            ToontownGlobals.BossbotHQ: (0.7215686274509804, 0.5098039215686275, 0.2509803921568627, 1.0),
        }

        self.waitBar["range"] = range
        self.title["text"] = label
        self.loadingScreenTex = self.zone2picture.get(ZoneUtil.getBranchZone(zoneId), self.defaultTex)
        self.loadingScreenFont = self.zone2font.get(ZoneUtil.getBranchZone(zoneId), self.defaultFont)
        self.loadingScreenFontColor = self.zone2fontcolor.get(ZoneUtil.getBranchZone(zoneId), self.defaultFontColor)
        self.background = loader.loadTexture(self.loadingScreenTex)
        self.__count = 0
        self.__expectedCount = range
        if gui:
            if base.localAvatarStyle:
                from src.toontown.toon import Toon

                wave = {"emote": "wave", "frame": 25}
                shrug = {"emote": "shrug", "frame": 30}
                duck = {"emote": "duck", "frame": 40}
                up = {"emote": "up", "frame": 60}
                pushup = {"emote": "down", "frame": 23}
                bow = {"emote": "bow", "frame": 45}
                bored = {"emote": "bored", "frame": 135}
                run = {"emote": "run", "frame": 7}
                victory = {"emote": "victory", "frame": 10}
                applause = {"emote": "applause", "frame": 23}
                dust = {"emote": "sprinkle-dust", "frame": 40}
                hypno = {"emote": "hypnotize", "frame": 25}
                cringe = {"emote": "cringe", "frame": 25}
                emotelist = [wave, shrug, duck, up, pushup, bow, bored, run, victory, applause, dust, hypno, cringe]
                emotechosen = random.choice(emotelist)
                self.toon = Toon.Toon()
                self.toon.setDNA(base.localAvatarStyle)
                self.toon.pose(emotechosen["emote"], emotechosen["frame"])
                self.toon.getGeomNode().setDepthWrite(1)
                self.toon.getGeomNode().setDepthTest(1)
                self.toon.setHpr(205, 0, 0)
                self.toon.setScale(0.18)
                self.toon.setPos(base.a2dBottomRight.getX() / 1.25, 0, -0.034)
                self.toon.reparentTo(self.waitBar)
            self.waitBar["frameSize"] = (
                base.a2dLeft + (base.a2dRight / 4.95),
                base.a2dRight - (base.a2dRight / 4.95),
                -0.03,
                0.03,
            )
            self.title["text_font"] = self.loadingScreenFont
            self.title["text_fg"] = self.loadingScreenFontColor
            self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
            self.title.setPos(base.a2dRight / 5, 0, 0.235)
            self.tip["text"] = self.getTip(tipCategory)
            self.gui.setPos(0, -0.1, 0)
            self.gui.reparentTo(aspect2d, LOADING_SCREEN_SORT_INDEX)
            self.gui.setTexture(self.background, 1)
            # if self.loadingScreenTex == self.defaultTex:
            #    self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
            self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
        else:
            self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
            self.gui.reparentTo(hidden)
            self.logo.reparentTo(hidden)
        self.tip.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
        self.waitBar.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
        self.waitBar.update(self.__count)
    def begin(self, range, label, gui, tipCategory, zoneId):
        self.defaultTex = 'phase_3.5/maps/loading/default.jpg'
        self.defaultFont = ToontownGlobals.getInterfaceFont()
        self.defaultFontColor = (0, 0, 0.5, 1)
        self.zone2picture = {
            ToontownGlobals.GoofySpeedway: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.ToontownCentral: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SillyStreet: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.LoopyLane: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.PunchlinePlace: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.DonaldsDock: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.BarnacleBoulevard:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SeaweedStreet: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.LighthouseLane: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.DaisyGardens: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.ElmStreet: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.MapleStreet: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.OakStreet: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.MinniesMelodyland:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.AltoAvenue: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.BaritoneBoulevard:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.TenorTerrace: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.TheBrrrgh: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.WalrusWay: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SleetStreet: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.PolarPlace: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.DonaldsDreamland:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.LullabyLane: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.PajamaPlace: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.OutdoorZone: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.GolfZone: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SellbotHQ: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SellbotFactoryExt:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SellbotFactoryInt:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.SellbotMegaCorpInt:
            'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.CashbotHQ: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.LawbotHQ: 'phase_3.5/maps/loading/toon.jpg',
            ToontownGlobals.BossbotHQ: 'phase_3.5/maps/loading/toon.jpg'
        }
        self.zone2font = {
            #Toontown Central Loader Fonts
            ToontownGlobals.GoofySpeedway:
            ToontownGlobals.getSignFont(),
            ToontownGlobals.ToontownCentral:
            ToontownGlobals.getCentralFont(),
            ToontownGlobals.SillyStreet:
            ToontownGlobals.getCentralFont(),
            ToontownGlobals.LoopyLane:
            ToontownGlobals.getCentralFont(),
            ToontownGlobals.PunchlinePlace:
            ToontownGlobals.getCentralFont(),
            #Donalds Dock Loader Fonts
            ToontownGlobals.DonaldsDock:
            ToontownGlobals.getDockFont(),
            ToontownGlobals.BarnacleBoulevard:
            ToontownGlobals.getDockFont(),
            ToontownGlobals.SeaweedStreet:
            ToontownGlobals.getDockFont(),
            ToontownGlobals.LighthouseLane:
            ToontownGlobals.getDockFont(),
            #Daisys Gardens Loader Fonts
            ToontownGlobals.DaisyGardens:
            ToontownGlobals.getGardenFont(),
            ToontownGlobals.ElmStreet:
            ToontownGlobals.getGardenFont(),
            ToontownGlobals.MapleStreet:
            ToontownGlobals.getGardenFont(),
            ToontownGlobals.OakStreet:
            ToontownGlobals.getGardenFont(),
            #Minnies Melodyland Loader Fonts
            ToontownGlobals.MinniesMelodyland:
            ToontownGlobals.getMelodyFont(),
            ToontownGlobals.AltoAvenue:
            ToontownGlobals.getMelodyFont(),
            ToontownGlobals.BaritoneBoulevard:
            ToontownGlobals.getMelodyFont(),
            ToontownGlobals.TenorTerrace:
            ToontownGlobals.getMelodyFont(),
            #Brghhh Loader Fonts
            ToontownGlobals.TheBrrrgh:
            ToontownGlobals.getFrostFont(),
            ToontownGlobals.WalrusWay:
            ToontownGlobals.getFrostFont(),
            ToontownGlobals.SleetStreet:
            ToontownGlobals.getFrostFont(),
            ToontownGlobals.PolarPlace:
            ToontownGlobals.getFrostFont(),
            #Donalds Dreamland Loader Fonts
            ToontownGlobals.DonaldsDreamland:
            ToontownGlobals.getDreamFont(),
            ToontownGlobals.LullabyLane:
            ToontownGlobals.getDreamFont(),
            ToontownGlobals.PajamaPlace:
            ToontownGlobals.getDreamFont(),
            #Other Zone Fonts
            ToontownGlobals.OutdoorZone:
            ToontownGlobals.getSignFont(),
            ToontownGlobals.GolfZone:
            ToontownGlobals.getSignFont(),
            #Cog Loader Fonts (Never edit, they are good as they currently are)
            ToontownGlobals.SellbotHQ:
            ToontownGlobals.getSuitFont(),
            ToontownGlobals.SellbotFactoryExt:
            ToontownGlobals.getSuitFont(),
            ToontownGlobals.SellbotFactoryInt:
            ToontownGlobals.getSuitFont(),
            ToontownGlobals.SellbotMegaCorpInt:
            ToontownGlobals.getSuitFont(),
            ToontownGlobals.CashbotHQ:
            ToontownGlobals.getSuitFont(),
            ToontownGlobals.LawbotHQ:
            ToontownGlobals.getSuitFont(),
            ToontownGlobals.BossbotHQ:
            ToontownGlobals.getSuitFont()
        }
        self.zone2fontcolor = {
            ToontownGlobals.GoofySpeedway:
            VBase4(0.2, 0.6, 0.9, 1.0),
            ToontownGlobals.ToontownCentral:
            VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098,
                   1.0),
            ToontownGlobals.SillyStreet:
            VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098,
                   1.0),
            ToontownGlobals.LoopyLane:
            VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098,
                   1.0),
            ToontownGlobals.PunchlinePlace:
            VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098,
                   1.0),
            ToontownGlobals.DonaldsDock:
            VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137,
                   1.0),
            ToontownGlobals.BarnacleBoulevard:
            VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137,
                   1.0),
            ToontownGlobals.SeaweedStreet:
            VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137,
                   1.0),
            ToontownGlobals.LighthouseLane:
            VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137,
                   1.0),
            ToontownGlobals.DaisyGardens:
            VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627,
                   1.0),
            ToontownGlobals.ElmStreet:
            VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627,
                   1.0),
            ToontownGlobals.MapleStreet:
            VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627,
                   1.0),
            ToontownGlobals.OakStreet:
            VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627,
                   1.0),
            ToontownGlobals.MinniesMelodyland:
            VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333,
                   1.0),
            ToontownGlobals.AltoAvenue:
            VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333,
                   1.00),
            ToontownGlobals.BaritoneBoulevard:
            VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333,
                   1.0),
            ToontownGlobals.TenorTerrace:
            VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333,
                   1.0),
            ToontownGlobals.TheBrrrgh:
            VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.WalrusWay:
            VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.SleetStreet:
            VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.PolarPlace:
            VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
            ToontownGlobals.DonaldsDreamland:
            VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902,
                   1.0),
            ToontownGlobals.LullabyLane:
            VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902,
                   1.0),
            ToontownGlobals.PajamaPlace:
            VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902,
                   1.0),
            ToontownGlobals.OutdoorZone:
            VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902,
                   1.0),
            ToontownGlobals.GolfZone:
            VBase4(0.2, 0.6, 0.9, 1.0),
            ToontownGlobals.SellbotHQ:
            (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
            ToontownGlobals.SellbotFactoryExt:
            (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
            ToontownGlobals.SellbotFactoryInt:
            (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
            ToontownGlobals.SellbotMegaCorpInt:
            ((0.0056754360035471, 0.0666666666666667, 0.9607843137254902,
              1.0)),
            ToontownGlobals.CashbotHQ: (0.2274509803921569, 0.7215686274509804,
                                        0.0509803921568627, 1.0),
            ToontownGlobals.LawbotHQ: (0.1294117647058824, 0.2549019607843137,
                                       0.8705882352941176, 1.0),
            ToontownGlobals.BossbotHQ: (0.7215686274509804, 0.5098039215686275,
                                        0.2509803921568627, 1.0)
        }

        self.waitBar['range'] = range
        self.title['text'] = label
        self.loadingScreenTex = self.zone2picture.get(
            ZoneUtil.getBranchZone(zoneId), self.defaultTex)
        self.loadingScreenFont = self.zone2font.get(
            ZoneUtil.getBranchZone(zoneId), self.defaultFont)
        self.loadingScreenFontColor = self.zone2fontcolor.get(
            ZoneUtil.getBranchZone(zoneId), self.defaultFontColor)
        self.background = loader.loadTexture(self.loadingScreenTex)
        self.__count = 0
        self.__expectedCount = range
        if gui:
            if base.localAvatarStyle:
                from src.toontown.toon import Toon
                wave = {'emote': 'wave', 'frame': 25}
                shrug = {'emote': 'shrug', 'frame': 30}
                duck = {'emote': 'duck', 'frame': 40}
                up = {'emote': 'up', 'frame': 60}
                pushup = {'emote': 'down', 'frame': 23}
                bow = {'emote': 'bow', 'frame': 45}
                bored = {'emote': 'bored', 'frame': 135}
                run = {'emote': 'run', 'frame': 7}
                victory = {'emote': 'victory', 'frame': 10}
                applause = {'emote': 'applause', 'frame': 23}
                dust = {'emote': 'sprinkle-dust', 'frame': 40}
                hypno = {'emote': 'hypnotize', 'frame': 25}
                cringe = {'emote': 'cringe', 'frame': 25}
                emotelist = [
                    wave, shrug, duck, up, pushup, bow, bored, run, victory,
                    applause, dust, hypno, cringe
                ]
                emotechosen = random.choice(emotelist)
                self.toon = Toon.Toon()
                self.toon.setDNA(base.localAvatarStyle)
                self.toon.pose(emotechosen['emote'], emotechosen['frame'])
                self.toon.getGeomNode().setDepthWrite(1)
                self.toon.getGeomNode().setDepthTest(1)
                self.toon.setHpr(205, 0, 0)
                self.toon.setScale(0.18)
                self.toon.setPos(base.a2dBottomRight.getX() / 1.25, 0, -0.034)
                self.toon.reparentTo(self.waitBar)
            self.waitBar['frameSize'] = (base.a2dLeft + (base.a2dRight / 4.95),
                                         base.a2dRight -
                                         (base.a2dRight / 4.95), -0.03, 0.03)
            self.title['text_font'] = self.loadingScreenFont
            self.title['text_fg'] = self.loadingScreenFontColor
            self.title.reparentTo(base.a2dpBottomLeft,
                                  LOADING_SCREEN_SORT_INDEX)
            self.title.setPos(base.a2dRight / 5, 0, 0.235)
            self.tip['text'] = self.getTip(tipCategory)
            self.gui.setPos(0, -0.1, 0)
            self.gui.reparentTo(aspect2d, LOADING_SCREEN_SORT_INDEX)
            self.gui.setTexture(self.background, 1)
            #if self.loadingScreenTex == self.defaultTex:
            #    self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
            self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
        else:
            self.title.reparentTo(base.a2dpBottomLeft,
                                  LOADING_SCREEN_SORT_INDEX)
            self.gui.reparentTo(hidden)
            self.logo.reparentTo(hidden)
        self.tip.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
        self.waitBar.reparentTo(base.a2dpBottomCenter,
                                LOADING_SCREEN_SORT_INDEX)
        self.waitBar.update(self.__count)
    def update(self, questDesc):
        questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
        quest = Quests.getQuest(questId)
        self.teleportButton['command'] = self.teleportToShop
        self.teleportButton['extraArgs'] = [toNpcId]
        if quest == None:
            self.notify.warning('Tried to display poster for unknown quest %s' % questId)
            return
        if rewardId == Quests.NA:
            finalReward = Quests.getFinalRewardId(questId, fAll=1)
            transformedReward = Quests.transformReward(finalReward, base.localAvatar)
            reward = Quests.getReward(transformedReward)
        else:
            reward = Quests.getReward(rewardId)
        if reward and questId not in Quests.NoRewardTierZeroQuests:
            rewardString = reward.getPosterString()
        else:
            rewardString = ''
        self.rewardText['text'] = rewardString
        self.fitLabel(self.rewardText)

        if Quests.isQuestJustForFun(questId, rewardId):
            self.funQuest.show()
        else:
            self.funQuest.hide()

        if self._deleteCallback:
            self.showDeleteButton(questDesc)
        else:
            self.hideDeleteButton()
        if self.laffMeter:
            self.laffMeter.destroy()
        fComplete = quest.getCompletionStatus(base.localAvatar, questDesc) == Quests.COMPLETE

        if Quests.isQuestJustForFun(questId, rewardId):
            if fComplete:
                self.funQuest.hide()
                self.teleportButton.show()
            else:
                self.teleportButton.hide()

        if toNpcId == Quests.ToonHQ:
            self.teleportButton.show()
            self.teleportButton.setPos(0.285, 0, -0.15)
            toNpcName = TTLocalizer.QuestPosterHQOfficer
            toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
            toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
            toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
        elif toNpcId == Quests.ToonTailor:
            self.teleportButton.show()
            self.teleportButton.setPos(0.285, 0, -0.15)
            toNpcName = TTLocalizer.QuestPosterTailor
            toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
            toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
            toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
        else:
            self.teleportButton.show()
            self.teleportButton.setPos(0.285, 0, -0.15)
            toNpcName = NPCToons.getNPCName(toNpcId)
            toNpcZone = NPCToons.getNPCZone(toNpcId)
            toNpcHoodId = ZoneUtil.getCanonicalHoodId(toNpcZone)
            toNpcLocationName = base.cr.hoodMgr.getFullnameFromId(toNpcHoodId)
            toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone)
            toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone)
            toNpcStreetName = ZoneUtil.getStreetName(toNpcBranchId)
        lPos = Vec3(0, 0, 0.13)
        lIconGeom = None
        lIconGeomScale = 1
        rIconGeom = None
        rIconGeomScale = 1
        infoText = ''
        infoZ = TTLocalizer.QPinfoZ
        auxText = None
        auxTextPos = Vec3(0, 0, 0.12)
        headlineString = quest.getHeadlineString()
        objectiveStrings = quest.getObjectiveStrings()
        captions = map(string.capwords, quest.getObjectiveStrings())
        imageColor = Vec4(*self.colors['white'])
        if isinstance(quest, Quests.TexturedQuest) and quest.hasFrame():
            self.teleportButton.hide()
            frame = quest.getFrame()
            frameBgColor = frame[1]
            lIconGeom = frame[0]
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
            frameBgColor = 'red'
            if fComplete:
                self.teleportButton.show()
                self.teleportButton.setPos(0.175, 0, -0.125)
            if quest.getType() == Quests.DeliverGagQuest:
                invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons')
                track, item = quest.getGagType()
                lIconGeom = invModel.find('**/' + AvPropsNew[track][item])
                invModel.removeNode()
            else:
                bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = bookModel.find('**/package')
                lIconGeomScale = 0.12
                bookModel.removeNode()
            if not fComplete:
                captions.append(toNpcName)
                auxText = TTLocalizer.QuestPosterAuxTo
                auxTextPos.setZ(0.12)
                lPos.setX(-0.18)
                infoText = TTLocalizer.QuestPageDestination % (toNpcBuildingName, toNpcStreetName, toNpcLocationName)
                rIconGeom = self.createNpcToonHead(toNpcId)
                rIconGeomScale = IMAGE_SCALE_SMALL
                self.teleportButton.setPos(0.285, 0, -0.15)
        elif quest.getType() == Quests.RecoverItemQuest:
            frameBgColor = 'green'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/package')
            lIconGeomScale = 0.12
            bookModel.removeNode()
            if not fComplete:
                rIconGeomScale = IMAGE_SCALE_SMALL
                holder = quest.getHolder()
                holderType = quest.getHolderType()
                if holder == Quests.Any:
                    cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                    rIconGeom = cogIcons.find('**/cog')
                    cogIcons.removeNode()
                    lPos.setX(-0.18)
                    auxText = TTLocalizer.QuestPosterAuxFrom
                elif holder == Quests.AnyFish:
                    headlineString = TTLocalizer.QuestPosterFishing
                    auxText = TTLocalizer.QuestPosterAuxFor
                    auxTextPos.setX(-0.18)
                    captions = captions[:1]
                else:
                    if holderType == 'track':
                        cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                        if holder in SuitDNA.suitDeptModelPaths:
                            icon = cogIcons.find(SuitDNA.suitDeptModelPaths[holder])
                        rIconGeom = icon.copyTo(hidden)
                        rIconGeom.setColor(Suit.Suit.medallionColors[holder])
                        rIconGeomScale = 0.12
                        cogIcons.removeNode()
                    elif holderType == 'level':
                        cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                        rIconGeom = cogIcons.find('**/cog')
                        rIconGeomScale = IMAGE_SCALE_SMALL
                        cogIcons.removeNode()
                    else:
                        rIconGeom = self.createSuitHead(holder)
                    lPos.setX(-0.18)
                    auxText = TTLocalizer.QuestPosterAuxFrom
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
            else:
                self.teleportButton.show()
        elif quest.getType() == Quests.VisitQuest:
            self.teleportButton.show()
            frameBgColor = 'brown'
            captions[0] = '%s' % toNpcName
            lIconGeom = self.createNpcToonHead(toNpcId)
            lIconGeomScale = IMAGE_SCALE_SMALL
            if not fComplete:
                infoText = TTLocalizer.QuestPageDestination % (toNpcBuildingName, toNpcStreetName, toNpcLocationName)
        elif quest.getType() == Quests.TrackChoiceQuest:
            frameBgColor = 'green'
            filmstrip = loader.loadModel('phase_3.5/models/gui/filmstrip')
            lIconGeom = DirectFrame(parent=self, relief=None, image=filmstrip, image_scale=.5)
            self.question = DirectLabel(parent=lIconGeom, relief=None, pos=(0, 0, 0), text='?', text_scale=0.2, text_pos=(0, -0.04), text_fg=(0.72, 0.72, 0.72, 1))
            lIconGeom['image_color'] = Vec4(0.7, 0.7, 0.7, 1)
            self.question['text_fg'] = Vec4(0.6, 0.6, 0.6, 1)
            rIconGeom = None
            filmstrip.removeNode()
        elif quest.getType() == Quests.BuildingQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            track = quest.getBuildingTrack()
            numFloors = quest.getNumFloors()
            if track == 'c':
                lIconGeom = loader.loadModel('phase_4/models/modules/suit_landmark_corp')
            elif track == 'l':
                lIconGeom = loader.loadModel('phase_4/models/modules/suit_landmark_legal')
            elif track == 'm':
                lIconGeom = loader.loadModel('phase_4/models/modules/suit_landmark_money')
            elif track == 's':
                lIconGeom = loader.loadModel('phase_4/models/modules/suit_landmark_sales')
            else:
                bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = bookModel.find('**/COG_building')
                bookModel.removeNode()
            if lIconGeom and track != Quests.Any:
                self.loadElevator(lIconGeom, numFloors)
                lIconGeom.setH(180)
                self.fitGeometry(lIconGeom, fFlip=0)
                lIconGeomScale = IMAGE_SCALE_SMALL
            else:
                lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.FactoryQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/factoryIcon2')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.MintQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/CashBotMint')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.CogPartQuest:
            self.teleportButton.hide()
            frameBgColor = 'green'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/CogArmIcon2')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.ForemanQuest or quest.getType() == Quests.SupervisorQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/skelecog5')
            bookModel.removeNode()
            lIconGeomScale = 0.13
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.RescueQuest:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            lIconGeom = self.createNpcToonHead(random.choice(NPCToons.HQnpcFriends.keys()))
            lIconGeomScale = 0.13
            infoText = quest.getLocationName().strip()
        elif quest.getType() == Quests.FriendQuest:
            self.teleportButton.hide()
            frameBgColor = 'brown'
            gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
            lIconGeom = gui.find('**/FriendsBox_Closed')
            lIconGeomScale = 0.45
            gui.removeNode()
            infoText = TTLocalizer.QuestPosterAnywhere
        elif quest.getType() == Quests.TrolleyQuest:
            self.teleportButton.hide()
            frameBgColor = 'lightBlue'
            gui = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = gui.find('**/trolley')
            lIconGeomScale = 0.13
            gui.removeNode()
            infoText = TTLocalizer.QuestPosterPlayground
        elif quest.getType() == Quests.MailboxQuest:
            self.teleportButton.hide()
            frameBgColor = 'lightBlue'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/package')
            lIconGeomScale = 0.12
            bookModel.removeNode()
            infoText = TTLocalizer.QuestPosterAtHome
        elif quest.getType() == Quests.PhoneQuest:
            self.teleportButton.hide()
            frameBgColor = 'lightBlue'
            bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
            lIconGeom = bookModel.find('**/clarabelleCow')
            lIconGeomScale = 0.12
            bookModel.removeNode()
            infoText = TTLocalizer.QuestPosterOnPhone
        else:
            self.teleportButton.hide()
            frameBgColor = 'blue'
            if quest.getType() == Quests.CogTrackQuest:
                dept = quest.getCogTrack()
                cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                lIconGeomScale = 0.13
                if dept in SuitDNA.suitDeptModelPaths:
                    icon = cogIcons.find(SuitDNA.suitDeptModelPaths[dept])
                lIconGeom = icon.copyTo(hidden)
                lIconGeom.setColor(Suit.Suit.medallionColors[dept])
                cogIcons.removeNode()
            elif quest.getType() == Quests.CogQuest:
                if quest.getCogType() != Quests.Any:
                    lIconGeom = self.createSuitHead(quest.getCogType())
                    lIconGeomScale = IMAGE_SCALE_SMALL
                else:
                    cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                    lIconGeom = cogIcons.find('**/cog')
                    lIconGeomScale = IMAGE_SCALE_SMALL
                    cogIcons.removeNode()
            elif quest.getType() == Quests.CogLevelQuest:
                cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                lIconGeom = cogIcons.find('**/cog')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkelecogTrackQuest:
                dept = quest.getCogTrack()
                cogIcons = loader.loadModel('phase_3/models/gui/cog_icons')
                lIconGeomScale = 0.13
                if dept in SuitDNA.suitDeptModelPaths:
                    icon = cogIcons.find(SuitDNA.suitDeptModelPaths[dept])
                lIconGeom = icon.copyTo(hidden)
                lIconGeom.setColor(Suit.Suit.medallionColors[dept])
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkelecogQuest:
                cogIcons = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = cogIcons.find('**/skelecog5')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkelecogLevelQuest:
                cogIcons = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = cogIcons.find('**/skelecog5')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            elif quest.getType() == Quests.SkeleReviveQuest:
                cogIcons = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
                lIconGeom = cogIcons.find('**/skelecog5')
                lIconGeomScale = IMAGE_SCALE_SMALL
                cogIcons.removeNode()
            if not fComplete:
                infoText = quest.getLocationName()
                if infoText == '':
                    infoText = TTLocalizer.QuestPosterAnywhere
        if fComplete:
            self.teleportButton.show()
            textColor = (0, 0.3, 0, 1)
            imageColor = Vec4(*self.colors['lightGreen'])
            lPos.setX(-0.18)
            rIconGeom = self.createNpcToonHead(toNpcId)
            rIconGeomScale = IMAGE_SCALE_SMALL
            captions = captions[:1]
            captions.append(toNpcName)
            auxText = TTLocalizer.QuestPosterAuxReturnTo
            headlineString = TTLocalizer.QuestPosterComplete
            infoText = TTLocalizer.QuestPageDestination % (toNpcBuildingName, toNpcStreetName, toNpcLocationName)
            if self.laffMeter is not None:
                self.laffMeter.reparentTo(hidden)
                self.laffMeter.destroy()
                self.laffMeter = None
        else:
            textColor = self.normalTextColor
        self.show()
        self['image_color'] = imageColor
        self.headline['text_fg'] = textColor
        self.headline['text'] = headlineString
        if quest.getType() != Quests.TrackChoiceQuest:
            self.lPictureFrame.show()
            self.lPictureFrame.setPos(lPos)
            self.lPictureFrame['text_scale'] = TEXT_SCALE
            if lPos[0] != 0:
                self.lPictureFrame['text_scale'] = 0.0325
            self.lPictureFrame['text'] = captions[0]
            self.lPictureFrame['image_color'] = Vec4(*self.colors[frameBgColor])
        else:
            self.lPictureFrame['text'] = 'Track Choice'
            self.lPictureFrame['image_color'] = Vec4(*self.colors[frameBgColor])
        if len(captions) > 1 and quest.getType() != Quests.TrackChoiceQuest:
            self.rPictureFrame['text'] = captions[1]
            self.rPictureFrame['text_scale'] = 0.0325
            self.rPictureFrame['image_color'] = Vec4(*self.colors[frameBgColor])
        else:
            self.rPictureFrame.hide()
        self._deleteGeoms()
        self.lQuestIcon['geom'] = lIconGeom
        self.lQuestIcon['geom_pos'] = (0, 10, 0)
        if lIconGeom:
            try:
                self.lQuestIcon['geom_scale'] = lIconGeomScale
            except: pass
            try:
                self.lQuestIcon['geom_pos'] = Point3(lIconGeomPos[0], lIconGeomPos[1], lIconGeomPos[2])
            except: pass
            try:
                self.lQuestIcon['geom_hpr'] = Point3(lIconGeomHpr[0], lIconGeomHpr[1], lIconGeomHpr[2])
            except: pass
        if self.laffMeter != None:
            self.laffMeter.reparentTo(self.lQuestIcon)
        self.rQuestIcon['geom'] = rIconGeom
        self.rQuestIcon['geom_pos'] = (0, 10, 0)
        if rIconGeom:
            self.rQuestIcon['geom_scale'] = rIconGeomScale
        if auxText:
            self.auxText.show()
            self.auxText['text'] = auxText
            self.auxText.setPos(auxTextPos)
        else:
            self.auxText.hide()
        self.bind(DGG.WITHIN, self.mouseEnterPoster)
        self.bind(DGG.WITHOUT, self.mouseExitPoster)
        numQuestItems = quest.getNumQuestItems()
        if fComplete or numQuestItems <= 1:
            self.questProgress.hide()
            if not quest.getType() == Quests.TrackChoiceQuest:
                infoZ = -0.075
        else:
            self.questProgress.show()
            self.questProgress['value'] = toonProgress & pow(2, 16) - 1
            self.questProgress['range'] = numQuestItems
            self.questProgress['text'] = quest.getProgressString(base.localAvatar, questDesc)
        self.questInfo['text'] = infoText
        self.questInfo.setZ(infoZ)
        self.fitLabel(self.questInfo)
        if not Quests.QuestDict[questId][0] >= 11:
            self.teleportButton.hide()
        return