本文整理匯總了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