nametags: Removed a few unused nametags, added boardinggroup and battlesos color, fixed toon statue selection GUI, doodles now have green nametags.

This commit is contained in:
John 2015-07-18 15:25:47 +03:00
parent 071d59f4d0
commit 2c451321b2
5 changed files with 36 additions and 57 deletions

View file

@ -102,7 +102,7 @@ class Avatar(Actor, ShadowCaster):
if self.isUnderstandable(): if self.isUnderstandable():
self.nametag.setColorCode(self.playerType) self.nametag.setColorCode(self.playerType)
else: else:
self.nametag.setColorCode(NametagGroup.CCNoChat) self.nametag.setColorCode(NametagGroup.CCNonPlayer)
self.setNametagName() self.setNametagName()
def considerUnderstandable(self): def considerUnderstandable(self):

View file

@ -9,15 +9,13 @@ CFThought=2
CFTimeout=8 CFTimeout=8
CCNormal = 0 CCNormal = 0
CCNoChat = 1 CCNonPlayer = 1
CCNonPlayer = 2 CCSuit = 2
CCSuit = 3 CCToonBuilding = 3
CCToonBuilding = 4 CCSuitBuilding = 4
CCSuitBuilding = 5 CCHouseBuilding = 5
CCHouseBuilding = 6 CCSpeedChat = 6
CCSpeedChat = 7 CCAdmin = 7
CCFreeChat = 8
CCAdmin = 9
NAMETAG_COLORS = { NAMETAG_COLORS = {
CCNormal: ( 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.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 (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: ( CCNonPlayer: (
# Normal FG BG # Normal FG BG
((0.8, 0.4, 0.0, 1.0), (0.8, 0.8, 0.8, 0.5), # Name ((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.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 (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: ( CCAdmin: (
# Normal FG BG # Normal FG BG
((1.0, 0.35, 0.25, 1.0), (0.8, 0.8, 0.8, 0.5), # Name ((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 = { DEFAULT_WORDWRAPS = {
CCNormal: 7.5, CCNormal: 7.5,
CCNoChat: 7.5,
CCNonPlayer: 7.5, CCNonPlayer: 7.5,
CCSuit: 7.5, CCSuit: 7.5,
CCToonBuilding: 8.5, CCToonBuilding: 8.5,
CCSuitBuilding: 8.5, CCSuitBuilding: 8.5,
CCHouseBuilding: 10.0, CCHouseBuilding: 10.0,
CCSpeedChat: 7.5, CCSpeedChat: 7.5,
CCFreeChat: 7.5,
CCAdmin: 7.5 CCAdmin: 7.5
} }
@ -195,7 +163,7 @@ WHISPER_COLORS = {
# Hover FG BG # Hover FG BG
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)), ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)),
# Disable FG BG # 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: ( WTQuickTalker: (
# Normal FG BG # Normal FG BG
@ -205,7 +173,7 @@ WHISPER_COLORS = {
# Hover FG BG # Hover FG BG
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)), ((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)),
# Disable FG BG # 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: ( WTSystem: (
# Normal FG BG # Normal FG BG
@ -215,9 +183,18 @@ WHISPER_COLORS = {
# Hover FG BG # Hover FG BG
((0.0, 0.0, 0.0, 1.0), (0.8, 0.4, 1.0, 0.6)), ((0.0, 0.0, 0.0, 1.0), (0.8, 0.4, 1.0, 0.6)),
# Disable FG BG # 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: ( WTEmote: (
# Normal FG BG # Normal FG BG
((0.0, 0.0, 0.0, 1.0), (0.9, 0.5, 0.1, 0.6)), ((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 # Hover FG BG
((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.2, 0.6)), ((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.2, 0.6)),
# Disable FG BG # 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): def getFriendColor(handle):

View file

@ -5,14 +5,12 @@ from Nametag2d import *
class NametagGroup: class NametagGroup:
CCNormal = CCNormal CCNormal = CCNormal
CCNoChat = CCNoChat
CCNonPlayer = CCNonPlayer CCNonPlayer = CCNonPlayer
CCSuit = CCSuit CCSuit = CCSuit
CCToonBuilding = CCToonBuilding CCToonBuilding = CCToonBuilding
CCSuitBuilding = CCSuitBuilding CCSuitBuilding = CCSuitBuilding
CCHouseBuilding = CCHouseBuilding CCHouseBuilding = CCHouseBuilding
CCSpeedChat = CCSpeedChat CCSpeedChat = CCSpeedChat
CCFreeChat = CCFreeChat
CCAdmin = CCAdmin CCAdmin = CCAdmin
CHAT_TIMEOUT_MAX = 12.0 CHAT_TIMEOUT_MAX = 12.0

View file

@ -9,7 +9,7 @@ from panda3d.core import *
from toontown.estate import DistributedToonStatuary from toontown.estate import DistributedToonStatuary
from toontown.estate import GardenGlobals from toontown.estate import GardenGlobals
from toontown.estate import PlantingGUI from toontown.estate import PlantingGUI
from otp.nametag import NametagGlobals from otp.nametag import NametagGlobals, NametagConstants
from otp.nametag.NametagGroup import * from otp.nametag.NametagGroup import *
from toontown.toon import DistributedToon from toontown.toon import DistributedToon
from toontown.toon import Toon from toontown.toon import Toon
@ -110,11 +110,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'):
colorCode = CCSpeedChat self.ffList.append((friendId, handle.getName(), NametagConstants.getFriendColor(handle)))
if flags & ToontownGlobals.FriendChat:
colorCode = CCFreeChat
newFF = (friendId, handle.getName(), colorCode)
self.ffList.append(newFF)
else: else:
self.notify.warning('Bad Handle for getName in makeFFlist') self.notify.warning('Bad Handle for getName in makeFFlist')
@ -128,8 +124,7 @@ class ToonStatueSelectionGUI(DirectFrame):
self.scrollList.refresh() self.scrollList.refresh()
def makeFamilyButton(self, familyId, familyName, colorCode): 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=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])
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])
def __chooseFriend(self, friendId, friendName): def __chooseFriend(self, friendId, friendName):
messenger.send('wakeup') messenger.send('wakeup')

View file

@ -46,7 +46,7 @@ class Pet(Avatar.Avatar):
Pet.SerialNum += 1 Pet.SerialNum += 1
self.lockedDown = 0 self.lockedDown = 0
self.setPickable(1) self.setPickable(1)
self.setPlayerType(NametagGroup.CCNonPlayer) self.setPlayerType(NametagGroup.CCSpeedChat)
self.animFSM = ClassicFSM('petAnimFSM', [State('off', self.enterOff, self.exitOff), self.animFSM = ClassicFSM('petAnimFSM', [State('off', self.enterOff, self.exitOff),
State('neutral', self.enterNeutral, self.exitNeutral), State('neutral', self.enterNeutral, self.exitNeutral),
State('neutralHappy', self.enterNeutralHappy, self.exitNeutralHappy), State('neutralHappy', self.enterNeutralHappy, self.exitNeutralHappy),