diff --git a/toontown/catalog/CatalogScreen.py b/toontown/catalog/CatalogScreen.py index 20f32919..3a712892 100755 --- a/toontown/catalog/CatalogScreen.py +++ b/toontown/catalog/CatalogScreen.py @@ -1024,7 +1024,7 @@ class CatalogScreen(DirectFrame): def __makeFFlist(self): for id, handle in base.cr.friendsMap.items(): - self.ffList.append((id, handle.getName(), NametagGlobals.getFriendColor(id))) + self.ffList.append((id, handle.getName(), NametagGlobals.getFriendColor(handle))) def __makeScrollList(self): for ff in self.ffList: diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index 90e2279c..4007b2c9 100755 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -651,25 +651,8 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): elif self.cache.contains(doId): teleportNotify.debug('found friend %s in cache' % doId) avatar = self.cache.dict[doId] - else: - self.notify.warning("Don't know who friend %s is." % doId) - return - if not ((isinstance(avatar, DistributedToon.DistributedToon) and avatar.__class__ is DistributedToon.DistributedToon) or isinstance(avatar, DistributedPet.DistributedPet)): - self.notify.warning('friendsNotify%s: invalid friend object %s' % (choice(source, '(%s)' % source, ''), doId)) - return - if base.wantPets: - if avatar.isPet(): - if avatar.bFake: - handle = PetHandle.PetHandle(avatar) - else: - handle = avatar - else: - handle = FriendHandle.FriendHandle(doId, avatar.getName(), avatar.style, avatar.adminAccess, avatar.getPetId()) - else: - handle = FriendHandle.FriendHandle(doId, avatar.getName(), avatar.style, avatar.adminAccess, '') - teleportNotify.debug('adding %s to friendsMap' % doId) - self.friendsMap[doId] = handle - return handle + self.notify.warning("Don't know who friend %s is." % doId) + return def identifyAvatar(self, doId): if doId in self.doId2do: diff --git a/toontown/estate/ToonStatueSelectionGUI.py b/toontown/estate/ToonStatueSelectionGUI.py index 5006a5fe..44022c56 100755 --- a/toontown/estate/ToonStatueSelectionGUI.py +++ b/toontown/estate/ToonStatueSelectionGUI.py @@ -109,7 +109,7 @@ class ToonStatueSelectionGUI(DirectFrame): handle = base.cr.identifyFriend(friendId) if handle and not self.checkFamily(friendId): if hasattr(handle, 'getName'): - newFF = (friendId, handle.getName(), NametagGlobals.getFriendColor(friendId)) + newFF = (friendId, handle.getName(), NametagGlobals.getFriendColor(handle)) self.ffList.append(newFF) else: self.notify.warning('Bad Handle for getName in makeFFlist') diff --git a/toontown/friends/FriendsListPanel.py b/toontown/friends/FriendsListPanel.py index 22ed8b41..f8679ad7 100755 --- a/toontown/friends/FriendsListPanel.py +++ b/toontown/friends/FriendsListPanel.py @@ -237,6 +237,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData): def __updateScrollList(self): petFriends = [] + admins = [] trueFriends = [] friends = [] @@ -246,7 +247,15 @@ class FriendsListPanel(DirectFrame, StateData.StateData): for friendId in base.localAvatar.friendsList: if self.panelType != FLPOnline or base.cr.isFriendOnline(friendId): - if base.localAvatar.isTrueFriends(friendId): + handle = base.cr.identifyFriend(friendId) + + if not handle: + base.cr.fillUpFriendsMap() + return + + if handle.isAdmin(): + admins.insert(0, friendId) + elif base.localAvatar.isTrueFriends(friendId): trueFriends.insert(0, friendId) else: friends.insert(0, friendId) @@ -262,6 +271,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData): friendButton.destroy() del self.friends[friendId] + self.createButtons(admins, NametagColors[CCAdmin][0][0]) self.createButtons(petFriends, NametagColors[CCNonPlayer][0][0]) self.createButtons(trueFriends, NametagColors[CCNormal][0][0]) self.createButtons(friends, NametagColors[CCSpeedChat][0][0]) diff --git a/toontown/nametag/NametagGlobals.py b/toontown/nametag/NametagGlobals.py index 07769eee..dad510ad 100755 --- a/toontown/nametag/NametagGlobals.py +++ b/toontown/nametag/NametagGlobals.py @@ -134,8 +134,12 @@ def getModelWidthHeight(model): height = maxPoint.getZ() - minPoint.getZ() return (width, height) -def getFriendColor(id): - return CCNormal if settings['trueFriends'] and base.localAvatar.isTrueFriends(id) else CCNormal +def getFriendColor(handle): + if handle.isAdmin(): + return CCAdmin + elif settings['trueFriends'] and base.localAvatar.isTrueFriends(handle.doId): + return CCNormal + return CCSpeedChat # Foreground, background: NametagColors = {