Fix pick a name button

This commit is contained in:
John 2015-07-04 11:38:44 +03:00
parent 3a29c8995f
commit 3b93cd6596
3 changed files with 2 additions and 7 deletions

View file

@ -87,7 +87,7 @@ def checkName(name, otherCheckFuncs = [], font = None):
tn = TextNode('NameCheck')
tn.setFont(font)
for c in name:
if not tn.hasCharacter(ord(c)):
if not tn.hasCharacter(unicode(c)):
notify.info('name contains bad char: %s' % TextEncoder().encodeWtext(c))
return OTPLocalizer.NCBadCharacter % TextEncoder().encodeWtext(c)

View file

@ -74,7 +74,7 @@ class AvatarChoice(DirectButton):
if self.approvedName != '':
self.nameText['text'] = self.approvedName
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
self.nameYourToonButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), text=(TTLocalizer.AvatarChoiceNameYourToon, TTLocalizer.AvatarChoiceNameYourToon, TTLocalizer.AvatarChoiceNameYourToon), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_scale=0.15, text_pos=(0, 0.03), text_font=ToontownGlobals.getInterfaceFont(), pos=(-0.2, 0, -0.3), scale=0.45, image_scale=(2, 1, 3), command=self.__handleNameYourToon)
self.nameYourToonButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), text=(TTLocalizer.AvatarChoiceNameYourToon, TTLocalizer.AvatarChoiceNameYourToon, TTLocalizer.AvatarChoiceNameYourToon), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_scale=0.15, text_pos=(0, 0.03), text_font=ToontownGlobals.getInterfaceFont(), pos=(-0.2, 0, -0.3), scale=0.45, image_scale=(2, 1, 3), command=self.__handleCreate)
guiButton.removeNode()
self.statusText = DirectLabel(parent=self, relief=None, scale=0.09, pos=(0, 0, -0.24), text='', text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_wordwrap=7.5, text_scale=TTLocalizer.ACstatusText, text_font=ToontownGlobals.getToonFont(), state=DGG.DISABLED)
if self.wantName != '':
@ -156,9 +156,6 @@ class AvatarChoice(DirectButton):
self.verify.show()
self.accept('verifyDone', self.__handleVerifyDelete)
def __handleNameYourToon(self):
messenger.send(self.doneEvent, ['nameIt', self.position])
def __handleVerifyDelete(self):
status = self.verify.doneStatus
self.ignore('verifyDone')

View file

@ -210,8 +210,6 @@ class AvatarChooser(StateData.StateData):
self.choice = panelChoice
if panelDoneStatus == 'chose':
self.__handleChoice()
elif panelDoneStatus == 'nameIt':
self.__handleChoice()
elif panelDoneStatus == 'delete':
self.__handleDelete()
elif panelDoneStatus == 'create':