mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 19:52:37 -06:00
Catalog gifting: Load friends
This commit is contained in:
parent
970c945fda
commit
5199150ed4
3 changed files with 5 additions and 55 deletions
|
@ -91,17 +91,12 @@ class CatalogScreen(DirectFrame):
|
||||||
taskMgr.doMethodLater(1.0, clarabelleGreeting, 'clarabelleGreeting')
|
taskMgr.doMethodLater(1.0, clarabelleGreeting, 'clarabelleGreeting')
|
||||||
taskMgr.doMethodLater(12.0, clarabelleHelpText1, 'clarabelleHelpText1')
|
taskMgr.doMethodLater(12.0, clarabelleHelpText1, 'clarabelleHelpText1')
|
||||||
if hasattr(self, 'giftToggle'):
|
if hasattr(self, 'giftToggle'):
|
||||||
self.giftToggle['state'] = DGG.DISABLED
|
self.giftToggle['state'] = DGG.NORMAL
|
||||||
self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleWait
|
self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOn
|
||||||
base.cr.deliveryManager.sendAck()
|
|
||||||
self.accept('DeliveryManagerAck', self.__handleUDack)
|
|
||||||
taskMgr.doMethodLater(10.0, self.__handleNoAck, 'ackTimeOut')
|
|
||||||
|
|
||||||
def hide(self):
|
def hide(self):
|
||||||
self.ignore('CatalogItemPurchaseRequest')
|
self.ignore('CatalogItemPurchaseRequest')
|
||||||
self.ignore('CatalogItemGiftPurchaseRequest')
|
self.ignore('CatalogItemGiftPurchaseRequest')
|
||||||
self.ignore('DeliveryManagerAck')
|
|
||||||
taskMgr.remove('ackTimeOut')
|
|
||||||
self.ignore(localAvatar.uniqueName('moneyChange'))
|
self.ignore(localAvatar.uniqueName('moneyChange'))
|
||||||
self.ignore(localAvatar.uniqueName('bankMoneyChange'))
|
self.ignore(localAvatar.uniqueName('bankMoneyChange'))
|
||||||
self.ignore(localAvatar.uniqueName('emblemsChange'))
|
self.ignore(localAvatar.uniqueName('emblemsChange'))
|
||||||
|
@ -1012,40 +1007,8 @@ class CatalogScreen(DirectFrame):
|
||||||
return test
|
return test
|
||||||
|
|
||||||
def __makeFFlist(self):
|
def __makeFFlist(self):
|
||||||
for familyMember in base.cr.avList:
|
for id, handle in base.cr.friendsMap.items():
|
||||||
if familyMember.id != base.localAvatar.doId:
|
self.ffList.append((id, handle.getName(), NametagGlobals.CCFreeChat))
|
||||||
newFF = (familyMember.id, familyMember.name, NametagGlobals.CCNonPlayer)
|
|
||||||
self.ffList.append(newFF)
|
|
||||||
|
|
||||||
for friendPair in base.localAvatar.friendsList:
|
|
||||||
friendId, flags = friendPair
|
|
||||||
handle = base.cr.identifyFriend(friendId)
|
|
||||||
if handle and not self.checkFamily(friendId):
|
|
||||||
if hasattr(handle, 'getName'):
|
|
||||||
colorCode = NametagGlobals.CCSpeedChat
|
|
||||||
if flags & ToontownGlobals.FriendChat:
|
|
||||||
colorCode = NametagGlobals.CCFreeChat
|
|
||||||
newFF = (friendPair[0], handle.getName(), colorCode)
|
|
||||||
self.ffList.append(newFF)
|
|
||||||
else:
|
|
||||||
self.notify.warning('Bad Handle for getName in makeFFlist')
|
|
||||||
|
|
||||||
hasManager = hasattr(base.cr, 'playerFriendsManager')
|
|
||||||
if hasManager:
|
|
||||||
for avatarId in base.cr.playerFriendsManager.getAllOnlinePlayerAvatars():
|
|
||||||
handle = base.cr.playerFriendsManager.getAvHandleFromId(avatarId)
|
|
||||||
playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(avatarId)
|
|
||||||
playerInfo = base.cr.playerFriendsManager.getFriendInfo(playerId)
|
|
||||||
freeChat = playerInfo.understandableYesNo
|
|
||||||
if handle and not self.checkFamily(avatarId):
|
|
||||||
if hasattr(handle, 'getName'):
|
|
||||||
colorCode = NametagGlobals.CCSpeedChat
|
|
||||||
if freeChat:
|
|
||||||
colorCode = NametagGlobals.CCFreeChat
|
|
||||||
newFF = (avatarId, handle.getName(), colorCode)
|
|
||||||
self.ffList.append(newFF)
|
|
||||||
else:
|
|
||||||
self.notify.warning('Bad Handle for getName in makeFFlist')
|
|
||||||
|
|
||||||
def __makeScrollList(self):
|
def __makeScrollList(self):
|
||||||
for ff in self.ffList:
|
for ff in self.ffList:
|
||||||
|
@ -1127,14 +1090,4 @@ class CatalogScreen(DirectFrame):
|
||||||
self.scrollList.hide()
|
self.scrollList.hide()
|
||||||
self.showEmblems()
|
self.showEmblems()
|
||||||
self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOff
|
self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOff
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def __handleUDack(self, caller = None):
|
|
||||||
taskMgr.remove('ackTimeOut')
|
|
||||||
if hasattr(self, 'giftToggle') and self.giftToggle:
|
|
||||||
self.giftToggle['state'] = DGG.NORMAL
|
|
||||||
self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOff
|
|
||||||
|
|
||||||
def __handleNoAck(self, caller = None):
|
|
||||||
if hasattr(self, 'giftToggle') and self.giftToggle:
|
|
||||||
self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleNoAck
|
|
|
@ -6800,8 +6800,6 @@ CatalogGiftFor = 'Buy Gift for:'
|
||||||
CatalogGiftTo = 'To: %s'
|
CatalogGiftTo = 'To: %s'
|
||||||
CatalogGiftToggleOn = 'Stop Gifting'
|
CatalogGiftToggleOn = 'Stop Gifting'
|
||||||
CatalogGiftToggleOff = 'Buy Gifts'
|
CatalogGiftToggleOff = 'Buy Gifts'
|
||||||
CatalogGiftToggleWait = 'Trying!...'
|
|
||||||
CatalogGiftToggleNoAck = 'Unavailable'
|
|
||||||
CatalogPurchaseItemAvailable = 'Congratulations on your new purchase! You can start using it right away.'
|
CatalogPurchaseItemAvailable = 'Congratulations on your new purchase! You can start using it right away.'
|
||||||
CatalogPurchaseGiftItemAvailable = 'Excellent! %s can start using your gift right away.'
|
CatalogPurchaseGiftItemAvailable = 'Excellent! %s can start using your gift right away.'
|
||||||
CatalogPurchaseItemOnOrder = 'Congratulations! Your purchase will be delivered to your mailbox soon.'
|
CatalogPurchaseItemOnOrder = 'Congratulations! Your purchase will be delivered to your mailbox soon.'
|
||||||
|
|
|
@ -215,7 +215,6 @@ class ToonBase(OTPBase.OTPBase):
|
||||||
self.slowQuietZone = self.config.GetBool('slow-quiet-zone', 0)
|
self.slowQuietZone = self.config.GetBool('slow-quiet-zone', 0)
|
||||||
self.slowQuietZoneDelay = self.config.GetFloat('slow-quiet-zone-delay', 5)
|
self.slowQuietZoneDelay = self.config.GetFloat('slow-quiet-zone-delay', 5)
|
||||||
self.killInterestResponse = self.config.GetBool('kill-interest-response', 0)
|
self.killInterestResponse = self.config.GetBool('kill-interest-response', 0)
|
||||||
self.forceSkipTutorial = self.config.GetBool('force-skip-tutorial', 0)
|
|
||||||
tpMgr = TextPropertiesManager.getGlobalPtr()
|
tpMgr = TextPropertiesManager.getGlobalPtr()
|
||||||
WLDisplay = TextProperties()
|
WLDisplay = TextProperties()
|
||||||
WLDisplay.setSlant(0.3)
|
WLDisplay.setSlant(0.3)
|
||||||
|
|
Loading…
Reference in a new issue