当前位置: 首页>>代码示例>>Python>>正文


Python ZoneUtil.getStreetName方法代码示例

本文整理汇总了Python中toontown.hood.ZoneUtil.getStreetName方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.getStreetName方法的具体用法?Python ZoneUtil.getStreetName怎么用?Python ZoneUtil.getStreetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.hood.ZoneUtil的用法示例。


在下文中一共展示了ZoneUtil.getStreetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update

# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getStreetName [as 别名]
    def update(self, questDesc):
        questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
        quest = Quests.getQuest(questId)
        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()
            
        fComplete = quest.getCompletionStatus(base.localAvatar, questDesc) == Quests.COMPLETE

        if Quests.isQuestJustForFun(questId, rewardId):
            if fComplete:
                self.funQuest.hide()
        
        if toNpcId == Quests.ToonHQ:
            toNpcName = TTLocalizer.QuestPosterHQOfficer
            toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
            toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
            toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
            
        elif toNpcId == Quests.ToonTailor:
            toNpcName = TTLocalizer.QuestPosterTailor
            toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
            toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
            toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
            
        else:
            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(lambda x: str(x).title(), quest.getObjectiveStrings())
        imageColor = Vec4(*self.colors['white'])
        if quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
            frameBgColor = 'red'
            
            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
                
        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
#.........这里部分代码省略.........
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:103,代码来源:QuestPoster.py

示例2: update

# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getStreetName [as 别名]
 def update(self, questDesc):
     questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
     quest = Quests.getQuest(questId)
     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()
     fComplete = quest.getCompletionStatus(base.localAvatar, questDesc) == Quests.COMPLETE
     if toNpcId == Quests.ToonHQ:
         toNpcName = TTLocalizer.QuestPosterHQOfficer
         toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
         toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
         toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
     elif toNpcId == Quests.ToonTailor:
         toNpcName = TTLocalizer.QuestPosterTailor
         toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
         toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
         toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
     else:
         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 quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
         frameBgColor = "red"
         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
     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:
#.........这里部分代码省略.........
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:103,代码来源:QuestPoster.py


注:本文中的toontown.hood.ZoneUtil.getStreetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。