Lock friends list for 1.5 seconds after loading a friend + show text when player is sending gifts too fast.

This commit is contained in:
John 2015-07-17 15:54:12 +03:00
parent f3ca3df3c0
commit 96d78ae33d
5 changed files with 12 additions and 4 deletions

View file

@ -196,6 +196,8 @@ class CatalogItem:
return TTLocalizer.CatalogPurchaseGiftLimitReached
elif retcode == ToontownGlobals.P_NotEnoughMoney:
return TTLocalizer.CatalogPurchaseGiftNotEnoughMoney
elif retcode == ToontownGlobals.P_TooFast:
return TTLocalizer.CatalogPurchaseGiftTooFast
else:
return TTLocalizer.CatalogPurchaseGiftGeneralError % {'friend': '%s',
'error': retcode}

View file

@ -814,6 +814,7 @@ class CatalogScreen(DirectFrame):
taskMgr.remove('clarabelleGreeting')
taskMgr.remove('clarabelleHelpText1')
taskMgr.remove('clarabelleAskAnythingElse')
taskMgr.remove('friendButtonsReady')
self.hide()
self.hangup.hide()
self.destroy()
@ -1026,15 +1027,18 @@ class CatalogScreen(DirectFrame):
self.friend = None
self.friendLabel['text'] = TTLocalizer.CatalogGiftUpdating
taskMgr.remove('friendButtonsReady')
self['phone'].requestGiftAvatar(self.friendAvId)
def setFriendReady(self, friend):
for friendButton in self.friends:
friendButton['state'] = DGG.NORMAL
self.friend = friend
self.friendLabel['text'] = TTLocalizer.CatalogGiftTo % self.friendName
taskMgr.doMethodLater(1.5, self.setFriendButtonsReady, 'friendButtonsReady')
self.update()
def setFriendButtonsReady(self, task=None):
for friendButton in self.friends:
friendButton['state'] = DGG.NORMAL
def __giftToggle(self):
messenger.send('wakeup')

View file

@ -248,7 +248,7 @@ class DistributedPhoneAI(DistributedFurnitureItemAI):
def requestGiftAvatarOperation(self, avId, doId, optional, callback):
if avId in self.fsms:
return
return ToontownGlobals.P_TooFast
loadOperation = LoadGiftAvatar(self, avId, doId, optional, callback)
loadOperation.start()

View file

@ -5513,6 +5513,7 @@ CatalogPurchaseGiftNotAGift = 'This item could not be sent to %s because it woul
CatalogPurchaseGiftWillNotFit = "This item could not be sent to %s because it doesn't fit them."
CatalogPurchaseGiftLimitReached = "This item could not be sent to %s because they already have it."
CatalogPurchaseGiftNotEnoughMoney = "This item could not be sent to %s because you can't afford it."
CatalogPurchaseGiftTooFast = "This item could not be sent to %s because you are sending gifts too fast."
CatalogAcceptGeneralError = 'The item could not be removed from your mailbox because of some internal game error: error code %s.'
CatalogAcceptRoomError = "You don't have any place to put this. You'll have to get rid of something."
CatalogAcceptLimitError = "You already have as many of these as you can handle. You'll have to get rid of something."

View file

@ -46,6 +46,7 @@ CatalogNumWeeksPerSeries = 13
CatalogNumWeeks = 78
PetFloorCollPriority = 5
PetPanelProximityPriority = 6
P_TooFast = -29
P_NoTrunk = -28
P_AlreadyOwnBiggerCloset = -27
P_ItemAlreadyRented = -26