mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
DANIEL: Nametag color shit
This commit is contained in:
parent
702260b1b7
commit
3e97752dff
5 changed files with 21 additions and 24 deletions
|
@ -1024,7 +1024,7 @@ class CatalogScreen(DirectFrame):
|
||||||
|
|
||||||
def __makeFFlist(self):
|
def __makeFFlist(self):
|
||||||
for id, handle in base.cr.friendsMap.items():
|
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):
|
def __makeScrollList(self):
|
||||||
for ff in self.ffList:
|
for ff in self.ffList:
|
||||||
|
|
|
@ -651,25 +651,8 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
elif self.cache.contains(doId):
|
elif self.cache.contains(doId):
|
||||||
teleportNotify.debug('found friend %s in cache' % doId)
|
teleportNotify.debug('found friend %s in cache' % doId)
|
||||||
avatar = self.cache.dict[doId]
|
avatar = self.cache.dict[doId]
|
||||||
else:
|
self.notify.warning("Don't know who friend %s is." % doId)
|
||||||
self.notify.warning("Don't know who friend %s is." % doId)
|
return
|
||||||
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
|
|
||||||
|
|
||||||
def identifyAvatar(self, doId):
|
def identifyAvatar(self, doId):
|
||||||
if doId in self.doId2do:
|
if doId in self.doId2do:
|
||||||
|
|
|
@ -109,7 +109,7 @@ class ToonStatueSelectionGUI(DirectFrame):
|
||||||
handle = base.cr.identifyFriend(friendId)
|
handle = base.cr.identifyFriend(friendId)
|
||||||
if handle and not self.checkFamily(friendId):
|
if handle and not self.checkFamily(friendId):
|
||||||
if hasattr(handle, 'getName'):
|
if hasattr(handle, 'getName'):
|
||||||
newFF = (friendId, handle.getName(), NametagGlobals.getFriendColor(friendId))
|
newFF = (friendId, handle.getName(), NametagGlobals.getFriendColor(handle))
|
||||||
self.ffList.append(newFF)
|
self.ffList.append(newFF)
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Bad Handle for getName in makeFFlist')
|
self.notify.warning('Bad Handle for getName in makeFFlist')
|
||||||
|
|
|
@ -237,6 +237,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
|
||||||
|
|
||||||
def __updateScrollList(self):
|
def __updateScrollList(self):
|
||||||
petFriends = []
|
petFriends = []
|
||||||
|
admins = []
|
||||||
trueFriends = []
|
trueFriends = []
|
||||||
friends = []
|
friends = []
|
||||||
|
|
||||||
|
@ -246,7 +247,15 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
|
||||||
|
|
||||||
for friendId in base.localAvatar.friendsList:
|
for friendId in base.localAvatar.friendsList:
|
||||||
if self.panelType != FLPOnline or base.cr.isFriendOnline(friendId):
|
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)
|
trueFriends.insert(0, friendId)
|
||||||
else:
|
else:
|
||||||
friends.insert(0, friendId)
|
friends.insert(0, friendId)
|
||||||
|
@ -262,6 +271,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
|
||||||
friendButton.destroy()
|
friendButton.destroy()
|
||||||
del self.friends[friendId]
|
del self.friends[friendId]
|
||||||
|
|
||||||
|
self.createButtons(admins, NametagColors[CCAdmin][0][0])
|
||||||
self.createButtons(petFriends, NametagColors[CCNonPlayer][0][0])
|
self.createButtons(petFriends, NametagColors[CCNonPlayer][0][0])
|
||||||
self.createButtons(trueFriends, NametagColors[CCNormal][0][0])
|
self.createButtons(trueFriends, NametagColors[CCNormal][0][0])
|
||||||
self.createButtons(friends, NametagColors[CCSpeedChat][0][0])
|
self.createButtons(friends, NametagColors[CCSpeedChat][0][0])
|
||||||
|
|
|
@ -134,8 +134,12 @@ def getModelWidthHeight(model):
|
||||||
height = maxPoint.getZ() - minPoint.getZ()
|
height = maxPoint.getZ() - minPoint.getZ()
|
||||||
return (width, height)
|
return (width, height)
|
||||||
|
|
||||||
def getFriendColor(id):
|
def getFriendColor(handle):
|
||||||
return CCNormal if settings['trueFriends'] and base.localAvatar.isTrueFriends(id) else CCNormal
|
if handle.isAdmin():
|
||||||
|
return CCAdmin
|
||||||
|
elif settings['trueFriends'] and base.localAvatar.isTrueFriends(handle.doId):
|
||||||
|
return CCNormal
|
||||||
|
return CCSpeedChat
|
||||||
|
|
||||||
# Foreground, background:
|
# Foreground, background:
|
||||||
NametagColors = {
|
NametagColors = {
|
||||||
|
|
Loading…
Reference in a new issue