Require player to type in toon's name before deleting

This commit is contained in:
John 2015-07-28 01:09:55 +03:00
parent 28331e7b0a
commit 2bd6230fd3
2 changed files with 5 additions and 9 deletions

View file

@ -165,9 +165,7 @@ class AvatarChoice(DirectButton):
self.verifyDeleteWithPassword()
def verifyDeleteWithPassword(self):
deleteText = TTLocalizer.AvatarChoiceDeleteConfirmText % {
'name': self.name,
'confirm': TTLocalizer.AvatarChoiceDeleteConfirmUserTypes}
deleteText = TTLocalizer.AvatarChoiceDeleteConfirmText % {'name': self.name}
if self.deleteWithPasswordFrame == None:
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
nameBalloon = loader.loadModel('phase_3/models/props/chatbox_input')
@ -190,13 +188,12 @@ class AvatarChoice(DirectButton):
return
def __handleDeleteWithConfirmOK(self, *args):
if self.passwordEntry.get().lower() == TTLocalizer.AvatarChoiceDeleteConfirmUserTypes:
if self.passwordEntry.get().lower() == self.name.lower():
self.deleteWithPasswordFrame.hide()
base.transitions.noTransitions()
messenger.send(self.doneEvent, ['delete', self.position])
else:
self.deleteWithPasswordFrame['text'] = TTLocalizer.AvatarChoiceDeleteWrongConfirm % {'name': self.name,
'confirm': TTLocalizer.AvatarChoiceDeleteConfirmUserTypes}
self.deleteWithPasswordFrame['text'] = TTLocalizer.AvatarChoiceDeleteWrongConfirm % {'name': self.name}
self.passwordEntry['focus'] = 1
self.passwordEntry.enterText('')

View file

@ -3262,12 +3262,11 @@ AvatarChoiceNameRejected = 'Name\nRejected'
AvatarChoiceNameApproved = 'Name\nApproved!'
AvatarChoiceNameReview = 'Under\nReview'
AvatarChoiceNameYourToon = 'Name\nYour Toon!'
AvatarChoiceDeleteConfirmText = 'Careful! This will delete %(name)s forever. If you are sure you want to do this, type "%(confirm)s" and click OK.'
AvatarChoiceDeleteConfirmUserTypes = 'delete'
AvatarChoiceDeleteConfirmText = "Careful! This will delete %(name)s forever. If you are sure you want to do this, type your toon's name and click OK."
AvatarChoiceDeletePasswordTitle = 'Delete Toon?'
AvatarChoiceDeletePasswordOK = lOK
AvatarChoiceDeletePasswordCancel = lCancel
AvatarChoiceDeleteWrongConfirm = 'You didn\'t type the right thing. To delete %(name)s, type "%(confirm)s" and click OK. Do not type the quotation marks. Click Cancel if you have changed your mind.'
AvatarChoiceDeleteWrongConfirm = "You didn\'t type the right thing. To delete %(name)s, type your toon's name and click OK. Do not type the quotation marks. Click Cancel if you have changed your mind."
AvatarChooserPickAToon = 'Pick A Toon To Play'
AvatarChooserQuit = lQuit
DateOfBirthEntryMonths = ['Jan',