本文整理汇总了Python中toontown.toonbase.TTLocalizer.getPetNameId方法的典型用法代码示例。如果您正苦于以下问题:Python TTLocalizer.getPetNameId方法的具体用法?Python TTLocalizer.getPetNameId怎么用?Python TTLocalizer.getPetNameId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.toonbase.TTLocalizer
的用法示例。
在下文中一共展示了TTLocalizer.getPetNameId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from toontown.toonbase import TTLocalizer [as 别名]
# 或者: from toontown.toonbase.TTLocalizer import getPetNameId [as 别名]
def __init__(self, doneEvent, petSeed, gender):
zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId())
name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId)
self.gui = loader.loadModel('phase_4/models/gui/PetNamePanel')
self.guiScale = 0.09
DirectFrame.__init__(self, relief=None, geom=self.gui, geom_scale=self.guiScale, state='normal', frameSize=(-1, 1, -1, 1))
self.initialiseoptions(PetshopGUI.NamePicker)
self.petView = self.attachNewNode('petView')
self.petView.setPos(-0.21, 0, -0.04)
self.petModel = Pet.Pet(forGui=1)
self.petModel.setDNA(dna)
self.petModel.fitAndCenterHead(0.435, forGui=1)
self.petModel.reparentTo(self.petView)
self.petModel.setH(225)
self.petModel.setScale(0.125)
self.petModel.enterNeutralHappy()
self.allNames = TTLocalizer.NeutralPetNames
if gender == 0:
self.allNames += TTLocalizer.BoyPetNames
else:
self.allNames += TTLocalizer.GirlPetNames
self.allNames.sort()
self.letters = []
for name in self.allNames:
if name[0:TTLocalizer.PGUIcharLength] not in self.letters:
self.letters.append(name[0:TTLocalizer.PGUIcharLength])
self.curLetter = self.letters[0]
self.curNames = []
self.curName = ''
self.alphabetList = self.makeScrollList(self.gui, (-0.012, 0, -0.075), (1, 0.8, 0.8, 1), self.letters, self.makeLabel, [TextNode.ACenter, 'alphabet'], 6)
self.nameList = None
self.rebuildNameList()
self.randomButton = DirectButton(parent=self, relief=None, image=(self.gui.find('**/RandomUpButton'), self.gui.find('**/RandomDownButton'), self.gui.find('**/RandomRolloverButton')), scale=self.guiScale, text=TTLocalizer.RandomButton, text_pos=(-0.8, -5.7), text_scale=0.8, text_fg=text2Color, pressEffect=False, command=self.randomName)
self.nameResult = DirectLabel(parent=self, relief=None, scale=self.guiScale, text='', text_align=TextNode.ACenter, text_pos=(-1.85, 2.6), text_fg=text0Color, text_scale=0.6, text_wordwrap=8)
self.submitButton = DirectButton(parent=self, relief=None, image=(self.gui.find('**/SubmitUpButton'), self.gui.find('**/SubmitDownButton'), self.gui.find('**/SubmitRolloverButton')), scale=self.guiScale, text=TTLocalizer.PetshopAdopt, text_pos=(3.3, -5.7), text_scale=TTLocalizer.PGUIsubmitButton, text_fg=text0Color, pressEffect=False, command=lambda : messenger.send(doneEvent, [TTLocalizer.getPetNameId(self.curName)]))
model = loader.loadModel('phase_4/models/gui/PetShopInterface')
modelScale = 0.1
cancelImageList = (model.find('**/CancelButtonUp'), model.find('**/CancelButtonDown'), model.find('**/CancelButtonRollover'))
cancelIcon = model.find('**/CancelIcon')
self.cancelButton = DirectButton(parent=self, relief=None, pos=(-0.04, 0, -0.47), image=cancelImageList, geom=cancelIcon, scale=modelScale, pressEffect=False, command=lambda : messenger.send(doneEvent, [-1]))
self.randomName()
return