From b38f8472a5775b4080a9a1a3f2e9e84b8e866575 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 3 Jul 2015 17:46:21 +0300 Subject: [PATCH] Fixed a bunch of issues at once --- otp/avatar/Avatar.py | 45 +++++++++++---------------------- otp/nametag/Nametag.py | 9 ++++--- otp/nametag/NametagConstants.py | 3 ++- otp/nametag/NametagGroup.py | 1 + toontown/suit/SuitGlobals.py | 5 ++-- 5 files changed, 25 insertions(+), 38 deletions(-) diff --git a/otp/avatar/Avatar.py b/otp/avatar/Avatar.py index 97ced08e..fdae7e63 100755 --- a/otp/avatar/Avatar.py +++ b/otp/avatar/Avatar.py @@ -130,44 +130,29 @@ class Avatar(Actor, ShadowCaster): self.setNametagName() def considerUnderstandable(self): - speed = 0 - if self.playerType in (NametagGroup.CCNormal, NametagGroup.CCFreeChat, NametagGroup.CCSpeedChat): + if self.playerType in (NametagGroup.CCNormal, NametagGroup.CCSpeedChat): self.setPlayerType(NametagGroup.CCSpeedChat) - speed = 1 - if hasattr(base, 'localAvatar') and self == base.localAvatar: + if hasattr(base, 'localAvatar') and (self == base.localAvatar): self.understandable = 1 - self.setPlayerType(NametagGroup.CCFreeChat) + self.setPlayerType(NametagGroup.CCNormal) + elif hasattr(self, 'adminAccess') and self.isAdmin(): + self.understandable = 2 + self.setPlayerType(NametagGroup.CCAdmin) elif self.playerType == NametagGroup.CCSuit: self.understandable = 1 self.setPlayerType(NametagGroup.CCSuit) - elif self.playerType not in (NametagGroup.CCNormal, NametagGroup.CCFreeChat, NametagGroup.CCSpeedChat): + elif self.playerType not in (NametagGroup.CCNormal, NametagGroup.CCSpeedChat): self.understandable = 1 - self.setPlayerType(NametagGroup.CCNoChat) - elif hasattr(base, 'localAvatar') and self.commonChatFlags & base.localAvatar.commonChatFlags & OTPGlobals.CommonChat: - self.understandable = 1 - self.setPlayerType(NametagGroup.CCFreeChat) - elif self.commonChatFlags & OTPGlobals.SuperChat: - self.understandable = 1 - self.setPlayerType(NametagGroup.CCFreeChat) - elif hasattr(base, 'localAvatar') and base.localAvatar.commonChatFlags & OTPGlobals.SuperChat: - self.understandable = 1 - self.setPlayerType(NametagGroup.CCFreeChat) - elif base.cr.getFriendFlags(self.doId) & OTPGlobals.FriendChat: - self.understandable = 1 - self.setPlayerType(NametagGroup.CCFreeChat) - elif base.cr.playerFriendsManager.findPlayerIdFromAvId(self.doId) is not None: - playerInfo = base.cr.playerFriendsManager.findPlayerInfoFromAvId(self.doId) - if playerInfo.openChatFriendshipYesNo: - self.understandable = 1 - self.nametag.setColorCode(NametagGroup.CCFreeChat) - elif playerInfo.isUnderstandable(): - self.understandable = 1 - else: - self.understandable = 0 - elif hasattr(base, 'localAvatar') and self.whitelistChatFlags & base.localAvatar.whitelistChatFlags: + self.setPlayerType(NametagGroup.CCNonPlayer) + elif settings['trueFriends'] and base.localAvatar.isTrueFriends(self.doId): + self.understandable = 2 + self.setPlayerType(NametagGroup.CCNormal) + elif settings['speedchatPlus']: self.understandable = 1 + self.setPlayerType(NametagGroup.CCSpeedChat) else: self.understandable = 0 + self.setPlayerType(NametagGroup.CCSpeedChat) if not hasattr(self, 'nametag'): self.notify.warning('no nametag attributed, but would have been used') else: @@ -248,7 +233,7 @@ class Avatar(Actor, ShadowCaster): if access in OTPLocalizer.AccessToString: name += '\n\x01shadow\x01%s\x02' % OTPLocalizer.AccessToString[access] - self.nametag.setDisplayName(name) + self.nametag.setName(name) def getFont(self): return self.__font diff --git a/otp/nametag/Nametag.py b/otp/nametag/Nametag.py index 740a5513..079a5dc4 100644 --- a/otp/nametag/Nametag.py +++ b/otp/nametag/Nametag.py @@ -109,10 +109,11 @@ class Nametag(ClickablePopup): self.DEFAULT_CHAT_WORDWRAP, button=self.getButton(), reversed=reversed) - balloon.setScale(0) balloon.reparentTo(self.innerNP) - scaleLerp = Sequence(Wait(0.10), LerpScaleInterval(balloon, 0.2, VBase3(1, 1, 1), VBase3(0, 0, 0), blendType='easeInOut')) - scaleLerp.start() + if self.IS_3D: + balloon.setScale(0) + scaleLerp = Sequence(Wait(0.10), LerpScaleInterval(balloon, 0.2, VBase3(1, 1, 1), VBase3(0, 0, 0), blendType='easeInOut')) + scaleLerp.start() self.frame = frame def showThought(self): @@ -157,4 +158,4 @@ class Nametag(ClickablePopup): self.frame = (t.node().getLeft()-self.NAME_PADDING/2.0, t.node().getRight()+self.NAME_PADDING/2.0, t.node().getBottom()-self.NAME_PADDING/2.0, - t.node().getTop()+self.NAME_PADDING/2.0) + t.node().getTop()+self.NAME_PADDING/2.0) \ No newline at end of file diff --git a/otp/nametag/NametagConstants.py b/otp/nametag/NametagConstants.py index b4c668f0..d0de16f3 100644 --- a/otp/nametag/NametagConstants.py +++ b/otp/nametag/NametagConstants.py @@ -175,7 +175,8 @@ DEFAULT_WORDWRAPS = { CCSuitBuilding: 8.5, CCHouseBuilding: 10.0, CCSpeedChat: 7.5, - CCFreeChat: 7.5 + CCFreeChat: 7.5, + CCAdmin: 7.5 } WTNormal = 0 diff --git a/otp/nametag/NametagGroup.py b/otp/nametag/NametagGroup.py index ea7af978..8f0a3e4f 100644 --- a/otp/nametag/NametagGroup.py +++ b/otp/nametag/NametagGroup.py @@ -13,6 +13,7 @@ class NametagGroup: CCHouseBuilding = CCHouseBuilding CCSpeedChat = CCSpeedChat CCFreeChat = CCFreeChat + CCAdmin = CCAdmin CHAT_TIMEOUT_MAX = 12.0 CHAT_TIMEOUT_MIN = 4.0 diff --git a/toontown/suit/SuitGlobals.py b/toontown/suit/SuitGlobals.py index 5c2d0c6c..0ca0258f 100755 --- a/toontown/suit/SuitGlobals.py +++ b/toontown/suit/SuitGlobals.py @@ -7,7 +7,6 @@ HAND_COLOR_INDEX = 1 # The hand color HEADS_INDEX = 2 # A list of heads HEAD_TEXTURE_INDEX = 3 # The texture to use for the head HEIGHT_INDEX = 4 # The height of the cog -NAMETAG_WRAP_INDEX = 5 # The nametag wrap for the cog aSize = 6.06 # Size of body type 'a' bSize = 5.29 # Size of body type 'b' @@ -23,7 +22,7 @@ suitProperties = {'f': (4.0 / cSize, SuitDNA.corpPolyColor, ['flunky', 'glasses' 'ds': (4.5 / bSize, SuitDNA.corpPolyColor, ['beancounter'], '', 6.08), 'hh': (6.5 / aSize, SuitDNA.corpPolyColor, ['headhunter'], '', 7.45), 'cr': (6.75 / cSize, VBase4(0.85, 0.55, 0.55, 1.0), ['flunky'], 'corporate-raider.jpg', 8.23), - 'tbc': (7.0 / aSize, VBase4(0.75, 0.95, 0.75, 1.0), ['bigcheese'], '', 9.34, 7), + 'tbc': (7.0 / aSize, VBase4(0.75, 0.95, 0.75, 1.0), ['bigcheese'], '', 9.34), # Lawbots 'bf': (4.0 / cSize, SuitDNA.legalPolyColor, ['tightwad'], 'bottom-feeder.jpg', 4.81), 'b': (4.375 / bSize, VBase4(0.95, 0.95, 1.0, 1.0), ['movershaker'], 'blood-sucker.jpg', 6.17), @@ -47,7 +46,7 @@ suitProperties = {'f': (4.0 / cSize, SuitDNA.corpPolyColor, ['flunky', 'glasses' 'tm': (3.75 / bSize, SuitDNA.salesPolyColor, ['telemarketer'], '', 5.24), 'nd': (4.35 / aSize, SuitDNA.salesPolyColor, ['numbercruncher'], 'name-dropper.jpg', 5.98), 'gh': (4.75 / cSize, SuitDNA.salesPolyColor, ['gladhander'], '', 6.4), - 'ms': (4.75 / bSize, SuitDNA.salesPolyColor, ['movershaker'], '', 6.7, 7), + 'ms': (4.75 / bSize, SuitDNA.salesPolyColor, ['movershaker'], '', 6.7), 'tf': (5.25 / aSize, SuitDNA.salesPolyColor, ['twoface'], '', 6.95), 'm': (5.75 / aSize, SuitDNA.salesPolyColor, ['twoface'], 'mingler.jpg', 7.61), 'mh': (7.0 / aSize, SuitDNA.salesPolyColor, ['yesman'], '', 8.95),