• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python toonbase.TTLocalizer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中toontown.toonbase.TTLocalizer的典型用法代码示例。如果您正苦于以下问题:Python TTLocalizer类的具体用法?Python TTLocalizer怎么用?Python TTLocalizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

 def __init__(self, doneEvent, petSeed, petNameIndex):
     zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId())
     name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId)
     name = TTLocalizer.getPetName(petNameIndex)
     cost = PetUtil.getPetCostFromSeed(petSeed, zoneId)
     model = loader.loadModel('phase_4/models/gui/AdoptPet')
     modelPos = (0, 0, -0.3)
     modelScale = 0.055
     DirectFrame.__init__(self, relief=None, state='normal', geom=model, geom_color=ToontownGlobals.GlobalDialogColor, geom_scale=modelScale, frameSize=(-1, 1, -1, 1), pos=modelPos, text=TTLocalizer.PetshopAdoptConfirm % (name, cost), text_wordwrap=12, text_scale=0.05, text_pos=(0, 0.55), text_fg=text0Color)
     self.initialiseoptions(PetshopGUI.AdoptPetDlg)
     self.petView = self.attachNewNode('petView')
     self.petView.setPos(-0.13, 0, 0.8)
     self.petModel = Pet.Pet(forGui=1)
     self.petModel.setDNA(dna)
     self.petModel.fitAndCenterHead(0.395, forGui=1)
     self.petModel.reparentTo(self.petView)
     self.petModel.setH(130)
     self.petModel.setScale(0.125)
     self.petModel.enterNeutralHappy()
     self.moneyDisplay = DirectLabel(parent=self, relief=None, text=str(base.localAvatar.getTotalMoney()), text_scale=0.075, text_fg=(0.95, 0.95, 0, 1), text_shadow=(0, 0, 0, 1), text_pos=(0.225, 0.33), text_font=ToontownGlobals.getSignFont())
     self.accept(localAvatar.uniqueName('moneyChange'), self.__moneyChange)
     self.accept(localAvatar.uniqueName('bankMoneyChange'), self.__moneyChange)
     okImageList = (model.find('**/CheckButtonUp'), model.find('**/CheckButtonDown'), model.find('**/CheckButtonRollover'))
     cancelImageList = (model.find('**/CancelButtonUp'), model.find('**/CancelButtonDown'), model.find('**/CancelRollover'))
     cancelIcon = model.find('**/CancelIcon')
     checkIcon = model.find('**/CheckIcon')
     self.cancelButton = DirectButton(parent=self, relief=None, image=cancelImageList, geom=cancelIcon, scale=modelScale, text=('', TTLocalizer.PetshopGoBack), text_pos=(-5.8, 4.4), text_scale=0.7, pressEffect=False, command=lambda : messenger.send(doneEvent, [0]))
     self.okButton = DirectButton(parent=self, relief=None, image=okImageList, geom=checkIcon, scale=modelScale, text=('', TTLocalizer.PetshopAdopt), text_pos=(5.8, 4.4), text_scale=0.7, pressEffect=False, command=lambda : messenger.send(doneEvent, [1]))
     model.removeNode()
     return
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:30,代码来源:PetshopGUI.py


示例2: __handleFlowerPlantingDone

 def __handleFlowerPlantingDone(self, willPlant = 0, recipeStr = '', special = -1):
     self.ignore(self.plantingGuiDoneEvent)
     self.ignore('stoppedAsleep')
     self.plantingGui.destroy()
     self.plantingGui = None
     base.localAvatar.showGardeningGui()
     base.localAvatar.removeShovelRelatedDoId(self.doId)
     successPlanting = False
     if willPlant:
         recipeKey = GardenGlobals.getRecipeKey(recipeStr, special)
         if recipeKey >= 0:
             species, variety = GardenGlobals.getSpeciesVarietyGivenRecipe(recipeKey)
             if species >= 0 and variety >= 0:
                 self.sendUpdate('plantFlower', [species, variety])
                 successPlanting = True
         else:
             self.notify.debug('%s %d is not a valid recipe' % (recipeStr, special))
             burntBeans = len(recipeStr)
             self.sendUpdate('plantNothing', [burntBeans])
     if successPlanting:
         flowerName = GardenGlobals.getFlowerVarietyName(species, variety)
         stringToShow = TTLocalizer.getResultPlantedSomethingSentence(flowerName)
     elif willPlant:
         self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.ResultPlantedNothing, command=self.popupFlowerPlantingGuiAgain)
     else:
         self.finishInteraction()
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:26,代码来源:DistributedGardenPlot.py


示例3: __showData

 def __showData(self):
     av = self.avatar
     online = 1
     if base.cr.isFriend(self.avId):
         online = base.cr.isFriendOnline(self.avId)
     if online:
         shardName = base.cr.getShardName(av.defaultShard)
         hoodName = base.cr.hoodMgr.getFullnameFromId(av.lastHood)
         if ZoneUtil.isWelcomeValley(av.lastHood):
             shardName = '%s (%s)' % (TTLocalizer.WelcomeValley[-1], shardName)
         if self.playerInfo:
             guiButton = loader.loadModel('phase_3/models/gui/quit_button')
             self.gotoAvatarButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.1, text=TTLocalizer.AvatarShowPlayer, text_scale=0.07, text_pos=(0.0, -0.02), textMayChange=0, pos=(0.44, 0, 0.41), command=self.__showAvatar)
             text = TTLocalizer.AvatarDetailPanelOnlinePlayer % {'district': shardName,
              'location': hoodName,
              'player': self.playerInfo.playerName}
         else:
             text = TTLocalizer.AvatarDetailPanelOnline % {'district': shardName,
              'location': hoodName}
     else:
         text = TTLocalizer.AvatarDetailPanelOffline % {'last_seen': TTLocalizer.getLastSeenString(self.avatar.getLastSeen())}
     self.dataText['text'] = text
     self.__updateTrackInfo()
     self.__updateTrophyInfo()
     self.__updateLaffInfo()
     return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:26,代码来源:ToonAvatarDetailPanel.py


示例4: doResultDialog

 def doResultDialog(self):
     self.startInteraction()
     flowerName = GardenGlobals.getFlowerVarietyName(self.species, self.variety)
     stringToShow = TTLocalizer.getResultPlantedSomethingSentence(flowerName)
     self.resultDialog = TTDialog.TTDialog(
         style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback
     )
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:7,代码来源:DistributedFlower.py


示例5: getCardName

def getCardName(value):
    if value == Unknown:
        return TTLocalizer.PlayingCardUnknown
    else:
        rank = value % MaxRank
        suit = value / MaxRank
        return TTLocalizer.getPlayingCardName(suit, rank)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:7,代码来源:PlayingCardGlobals.py


示例6: doResultDialog

 def doResultDialog(self):
     self.startInteraction()
     curTrack, curLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
     species = GardenGlobals.getTreeTypeIndex(curTrack, curLevel)
     treeName = GardenGlobals.PlantAttributes[species]['name']
     stringToShow = TTLocalizer.getResultPlantedSomethingSentence(treeName)
     self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:7,代码来源:DistributedGagTree.py


示例7: getPetInfoFromSeed

def getPetInfoFromSeed(seed, safezoneId):
    S = random.getstate()
    random.seed(seed)
    dnaArray = PetDNA.getRandomPetDNA(safezoneId)
    gender = PetDNA.getGender(dnaArray)
    nameString = TTLocalizer.getRandomPetName(gender=gender, seed=seed)
    traitSeed = PythonUtil.randUint31()
    random.setstate(S)
    return (nameString, dnaArray, traitSeed)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:9,代码来源:PetUtil.py


示例8: display

 def display(self, pTrackTitle = 'Track Title', pPeriodTitle = 'Period Title', pLeaderList = []):
     self.titleTextNode.setText(pPeriodTitle)
     self.trackNameNode.setText(pTrackTitle)
     self.updateCount += 1
     for i in xrange(10):
         if i >= len(pLeaderList):
             self.nameTextNodes[i].setText('-')
             self.timeTextNodes[i].setText('-')
         else:
             self.nameTextNodes[i].setText(pLeaderList[i][0][:22])
             self.timeTextNodes[i].setText(TTLocalizer.convertSecondsToDate(pLeaderList[i][1]))
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:11,代码来源:DistributedLeaderBoard.py


示例9: getPlantItWithString

def getPlantItWithString(special):
    retval = ''
    recipeKey = getRecipeKeyUsingSpecial(special)
    if not recipeKey == -1:
        beanTuple = []
        beanStr = Recipes[recipeKey]['beans']
        for letter in beanStr:
            index = BeanColorLetters.index(letter)
            beanTuple.append(index)

        beanText = TTLocalizer.getRecipeBeanText(beanTuple)
        retval += TTLocalizer.PlantItWith % beanText
    return retval
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:13,代码来源:GardenGlobals.py


示例10: generateAchievementInfo

    def generateAchievementInfo(self):
        acievementInfo = TTLocalizer.getAchievementInfo(self.achievementId)

        title = TextNode('title')
        title.setText(acievementInfo[0])
        title.setFont(ToontownGlobals.getSignFont())
        title.setTextColor(1, 1, 1, 1)
        title.setAlign(TextNode.ACenter)

        titleNode = self.attachNewNode(title)
        titleNode.setScale(0.2)
        titleNode.setZ(0.2)

        description = TextNode('description')
        description.setText(acievementInfo[1])
        description.setFont(ToontownGlobals.getSignFont())
        description.setTextColor(1, 1, 1, 1)
        description.setAlign(TextNode.ACenter)

        descriptionNode = self.attachNewNode(description)
        descriptionNode.setScale(0.15)
        descriptionNode.setZ(-0.14)
开发者ID:NostalgicTTR,项目名称:Toontown-Infinite-2016-Leak,代码行数:22,代码来源:AchievementsGUI.py


示例11: __handleItemPlantingDone

 def __handleItemPlantingDone(self, willPlant = 0, recipeStr = '', selectedSpecial = -1):
     self.ignore(self.plantingGuiDoneEvent)
     self.ignore('stoppedAsleep')
     self.plantingGui.destroy()
     self.plantingGui = None
     base.localAvatar.showGardeningGui()
     base.localAvatar.removeShovelRelatedDoId(self.doId)
     gardenSpecials = base.localAvatar.getGardenSpecials()
     special = -1
     if selectedSpecial >= 0:
         special = gardenSpecials[selectedSpecial][0]
     successPlanting = False
     successToonStatue = False
     if willPlant:
         recipeKey = GardenGlobals.getRecipeKey(recipeStr, special)
         if recipeKey >= 0:
             species, variety = GardenGlobals.getSpeciesVarietyGivenRecipe(recipeKey)
             if species >= 0 and variety >= 0:
                 if GardenGlobals.PlantAttributes[species]['plantType'] == GardenGlobals.STATUARY_TYPE:
                     successPlanting = True
                     if species >= 205 and species <= 208:
                         successToonStatue = True
                     else:
                         self.sendUpdate('plantStatuary', [species])
         else:
             self.notify.debug('%s %d is not a valid recipe' % (recipeStr, special))
             burntBeans = len(recipeStr)
             self.sendUpdate('plantNothing', [burntBeans])
     if successPlanting:
         itemName = GardenGlobals.PlantAttributes[species]['name']
         stringToShow = TTLocalizer.getResultPlantedSomethingSentence(itemName)
     elif willPlant:
         self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.ResultPlantedNothing, command=self.popupItemPlantingGuiAgain)
     else:
         self.finishInteraction()
     if successToonStatue:
         self.popupToonStatueSelectionGui(species)
     return
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:38,代码来源:DistributedGardenPlot.py


示例12: createNewPetFromSeed

 def createNewPetFromSeed(self, avId, seed, nameIndex, gender, safeZoneId):
     av = self.air.doId2do[avId]
     
     name = TTLocalizer.getPetName(nameIndex)
     _, dna, traitSeed = PetUtil.getPetInfoFromSeed(seed, safeZoneId)
     head, ears, nose, tail, body, color, cs, eye, _ = dna
     numGenders = len(PetDNA.PetGenders)
     gender %= numGenders
             
     fields = {'setOwnerId' : avId, 'setPetName' : name, 'setTraitSeed' : traitSeed, 'setSafeZone' : safeZoneId,
               'setHead' : head, 'setEars' : ears, 'setNose' : nose, 'setTail' : tail, 'setBodyTexture' : body,
               'setColor' : color, 'setColorScale' : cs, 'setEyeColor' : eye, 'setGender' : gender}
               
     def response(doId):
         if not doId:
             self.air.notify.warning("Cannot create pet for %s!" % avId)
             return
             
         self.air.writeServerEvent('bought-pet', avId, doId)
         av.b_setPetId(doId)
         
     self.air.dbInterface.createObject(self.air.dbId, self.air.dclassesByName['DistributedPetAI'],
                                       {k: (v,) for k,v in fields.items()}, response)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:23,代码来源:PetManagerAI.py


示例13: doResultDialog

 def doResultDialog(self):
     self.startInteraction()
     itemName = GardenGlobals.PlantAttributes[self.typeIndex]['name']
     stringToShow = TTLocalizer.getResultPlantedSomethingSentence(itemName)
     self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:5,代码来源:DistributedStatuary.py


示例14: getName

 def getName(self):
     return TTLocalizer.getHouseNameById(self.houseType)
开发者ID:Captainpopcorn101011,项目名称:src,代码行数:2,代码来源:CatalogHouseItem.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python toonbase.ToontownBattleGlobals类代码示例发布时间:2022-05-27
下一篇:
Python ToonDNA.ToonDNA类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap