From 2c451321b2357056bd53996df065b3c949328a51 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 18 Jul 2015 15:25:47 +0300 Subject: [PATCH] nametags: Removed a few unused nametags, added boardinggroup and battlesos color, fixed toon statue selection GUI, doodles now have green nametags. --- otp/avatar/Avatar.py | 2 +- otp/nametag/NametagConstants.py | 76 +++++++++-------------- otp/nametag/NametagGroup.py | 2 - toontown/estate/ToonStatueSelectionGUI.py | 11 +--- toontown/pets/Pet.py | 2 +- 5 files changed, 36 insertions(+), 57 deletions(-) diff --git a/otp/avatar/Avatar.py b/otp/avatar/Avatar.py index 900b9ce0..8190ad90 100755 --- a/otp/avatar/Avatar.py +++ b/otp/avatar/Avatar.py @@ -102,7 +102,7 @@ class Avatar(Actor, ShadowCaster): if self.isUnderstandable(): self.nametag.setColorCode(self.playerType) else: - self.nametag.setColorCode(NametagGroup.CCNoChat) + self.nametag.setColorCode(NametagGroup.CCNonPlayer) self.setNametagName() def considerUnderstandable(self): diff --git a/otp/nametag/NametagConstants.py b/otp/nametag/NametagConstants.py index 7accb974..b702f90b 100644 --- a/otp/nametag/NametagConstants.py +++ b/otp/nametag/NametagConstants.py @@ -9,15 +9,13 @@ CFThought=2 CFTimeout=8 CCNormal = 0 -CCNoChat = 1 -CCNonPlayer = 2 -CCSuit = 3 -CCToonBuilding = 4 -CCSuitBuilding = 5 -CCHouseBuilding = 6 -CCSpeedChat = 7 -CCFreeChat = 8 -CCAdmin = 9 +CCNonPlayer = 1 +CCSuit = 2 +CCToonBuilding = 3 +CCSuitBuilding = 4 +CCHouseBuilding = 5 +CCSpeedChat = 6 +CCAdmin = 7 NAMETAG_COLORS = { CCNormal: ( @@ -34,20 +32,6 @@ NAMETAG_COLORS = { ((0.3, 0.3, 0.7, 1.0), (0.8, 0.8, 0.8, 0.5), # Name (0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat ), - CCNoChat: ( - # Normal FG BG - ((0.8, 0.4, 0.0, 1.0), (0.8, 0.8, 0.8, 0.5), # Name - (0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - # Click FG BG - ((1.0, 0.5, 0.5, 1.0), (0.2, 0.2, 0.2, 0.6), # Name - (1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - # Hover FG BG - ((1.0, 0.5, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0), # Name - (0.0, 0.6, 0.6, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - # Disable FG BG - ((0.8, 0.4, 0.0, 1.0), (0.8, 0.8, 0.8, 0.5), # Name - (0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - ), CCNonPlayer: ( # Normal FG BG ((0.8, 0.4, 0.0, 1.0), (0.8, 0.8, 0.8, 0.5), # Name @@ -132,20 +116,6 @@ NAMETAG_COLORS = { ((0.0, 0.6, 0.2, 1.0), (0.8, 0.8, 0.8, 0.5), # Name (0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat ), - CCFreeChat: ( - # Normal FG BG - ((0.3, 0.3, 0.7, 1.0), (0.8, 0.8, 0.8, 0.5), # Name - (0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - # Click FG BG - ((0.2, 0.2, 0.5, 1.0), (0.2, 0.2, 0.2, 0.6), # Name - (1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - # Hover FG BG - ((0.5, 0.5, 1.0, 1.0), (1.0, 1.0, 1.0, 1.0), # Name - (0.0, 0.6, 0.6, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - # Disable FG BG - ((0.3, 0.3, 0.7, 1.0), (0.8, 0.8, 0.8, 0.5), # Name - (0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)), # Chat - ), CCAdmin: ( # Normal FG BG ((1.0, 0.35, 0.25, 1.0), (0.8, 0.8, 0.8, 0.5), # Name @@ -168,14 +138,12 @@ ARROW_COLORS = { DEFAULT_WORDWRAPS = { CCNormal: 7.5, - CCNoChat: 7.5, CCNonPlayer: 7.5, CCSuit: 7.5, CCToonBuilding: 8.5, CCSuitBuilding: 8.5, CCHouseBuilding: 10.0, CCSpeedChat: 7.5, - CCFreeChat: 7.5, CCAdmin: 7.5 } @@ -195,7 +163,7 @@ WHISPER_COLORS = { # Hover FG BG ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)), # Disable FG BG - ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)), + ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)) ), WTQuickTalker: ( # Normal FG BG @@ -205,7 +173,7 @@ WHISPER_COLORS = { # Hover FG BG ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)), # Disable FG BG - ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)), + ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)) ), WTSystem: ( # Normal FG BG @@ -215,9 +183,18 @@ WHISPER_COLORS = { # Hover FG BG ((0.0, 0.0, 0.0, 1.0), (0.8, 0.4, 1.0, 0.6)), # Disable FG BG - ((0.0, 0.0, 0.0, 1.0), (0.8, 0.3, 0.6, 0.6)), + ((0.0, 0.0, 0.0, 1.0), (0.8, 0.3, 0.6, 0.6)) + ), + WTBattleSOS: ( + # Normal FG BG + ((0.0, 0.0, 0.0, 1.0), (0.8, 0.3, 0.6, 0.6)), + # Click FG BG + ((1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 0.8)), + # Hover FG BG + ((0.0, 0.0, 0.0, 1.0), (0.8, 0.4, 0.0, 0.8)), + # Disable FG BG + ((0.0, 0.0, 0.0, 1.0), (0.8, 0.3, 0.6, 0.6)) ), - # TODO: WTBattleSOS WTEmote: ( # Normal FG BG ((0.0, 0.0, 0.0, 1.0), (0.9, 0.5, 0.1, 0.6)), @@ -226,9 +203,18 @@ WHISPER_COLORS = { # Hover FG BG ((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.2, 0.6)), # Disable FG BG - ((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.1, 0.6)), + ((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.1, 0.6)) ), - # TODO: WTToontownBoardingGroup + WTToontownBoardingGroup: ( + # Normal FG BG + ((0.0, 0.0, 0.0, 1.0), (0.9, 0.5, 0.1, 0.6)), + # Click FG BG + ((1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 0.8)), + # Hover FG BG + ((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.2, 0.6)), + # Disable FG BG + ((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.1, 0.6)) + ) } def getFriendColor(handle): diff --git a/otp/nametag/NametagGroup.py b/otp/nametag/NametagGroup.py index 8f0a3e4f..357d459b 100644 --- a/otp/nametag/NametagGroup.py +++ b/otp/nametag/NametagGroup.py @@ -5,14 +5,12 @@ from Nametag2d import * class NametagGroup: CCNormal = CCNormal - CCNoChat = CCNoChat CCNonPlayer = CCNonPlayer CCSuit = CCSuit CCToonBuilding = CCToonBuilding CCSuitBuilding = CCSuitBuilding CCHouseBuilding = CCHouseBuilding CCSpeedChat = CCSpeedChat - CCFreeChat = CCFreeChat CCAdmin = CCAdmin CHAT_TIMEOUT_MAX = 12.0 diff --git a/toontown/estate/ToonStatueSelectionGUI.py b/toontown/estate/ToonStatueSelectionGUI.py index 7fd5dcc1..0bfe95cf 100755 --- a/toontown/estate/ToonStatueSelectionGUI.py +++ b/toontown/estate/ToonStatueSelectionGUI.py @@ -9,7 +9,7 @@ from panda3d.core import * from toontown.estate import DistributedToonStatuary from toontown.estate import GardenGlobals from toontown.estate import PlantingGUI -from otp.nametag import NametagGlobals +from otp.nametag import NametagGlobals, NametagConstants from otp.nametag.NametagGroup import * from toontown.toon import DistributedToon from toontown.toon import Toon @@ -110,11 +110,7 @@ class ToonStatueSelectionGUI(DirectFrame): handle = base.cr.identifyFriend(friendId) if handle and not self.checkFamily(friendId): if hasattr(handle, 'getName'): - colorCode = CCSpeedChat - if flags & ToontownGlobals.FriendChat: - colorCode = CCFreeChat - newFF = (friendId, handle.getName(), colorCode) - self.ffList.append(newFF) + self.ffList.append((friendId, handle.getName(), NametagConstants.getFriendColor(handle))) else: self.notify.warning('Bad Handle for getName in makeFFlist') @@ -128,8 +124,7 @@ class ToonStatueSelectionGUI(DirectFrame): self.scrollList.refresh() def makeFamilyButton(self, familyId, familyName, colorCode): - fg = NametagGlobals.getNameFg(colorCode, PGButton.SInactive) - return DirectButton(relief=None, text=familyName, text_scale=0.04, text_align=TextNode.ALeft, text_fg=fg, text1_bg=self.textDownColor, text2_bg=self.textRolloverColor, text3_fg=self.textDisabledColor, textMayChange=0, command=self.__chooseFriend, extraArgs=[familyId, familyName]) + return DirectButton(relief=None, text=familyName, text_scale=0.04, text_align=TextNode.ALeft, text_fg=NametagConstants.NAMETAG_COLORS[colorCode][0][0], text1_bg=self.textDownColor, text2_bg=self.textRolloverColor, text3_fg=self.textDisabledColor, textMayChange=0, command=self.__chooseFriend, extraArgs=[familyId, familyName]) def __chooseFriend(self, friendId, friendName): messenger.send('wakeup') diff --git a/toontown/pets/Pet.py b/toontown/pets/Pet.py index 62e5c869..6ccaf0d8 100755 --- a/toontown/pets/Pet.py +++ b/toontown/pets/Pet.py @@ -46,7 +46,7 @@ class Pet(Avatar.Avatar): Pet.SerialNum += 1 self.lockedDown = 0 self.setPickable(1) - self.setPlayerType(NametagGroup.CCNonPlayer) + self.setPlayerType(NametagGroup.CCSpeedChat) self.animFSM = ClassicFSM('petAnimFSM', [State('off', self.enterOff, self.exitOff), State('neutral', self.enterNeutral, self.exitNeutral), State('neutralHappy', self.enterNeutralHappy, self.exitNeutralHappy),