diff --git a/otp/avatar/DistributedPlayer.py b/otp/avatar/DistributedPlayer.py index 1fe2e8c7..e18cc55d 100755 --- a/otp/avatar/DistributedPlayer.py +++ b/otp/avatar/DistributedPlayer.py @@ -11,8 +11,8 @@ from otp.chat import ChatGarbler, TalkAssistant from otp.distributed.TelemetryLimited import TelemetryLimited from otp.otpbase import OTPGlobals, OTPLocalizer from otp.speedchat import SCDecoders -from toontown.chat.ChatGlobals import * -from toontown.chat.WhisperPopup import WhisperPopup +from otp.nametag.NametagConstants import * +from otp.margins.WhisperPopup import WhisperPopup class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBase, TelemetryLimited): chatGarbler = ChatGarbler.ChatGarbler({'default': OTPLocalizer.ChatGarblerDefault}) @@ -114,7 +114,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa if self is localAvatar: return True - def setSystemMessage(self, aboutId, chatString, whisperType = WTSystem): + def setSystemMessage(self, aboutId, chatString, whisperType = WhisperPopup.WTSystem): self.displayWhisper(aboutId, chatString, whisperType) def displayWhisper(self, fromId, chatString, whisperType): @@ -130,7 +130,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa return chatString = SCDecoders.decodeSCStaticTextMsg(msgIndex) if chatString: - self.displayWhisper(fromId, chatString, WTNormal) + self.displayWhisper(fromId, chatString, WhisperPopup.WTNormal) return def whisperSCCustomTo(self, msgIndex, sendToId): @@ -151,7 +151,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa return chatString = SCDecoders.decodeSCCustomMsg(msgIndex) if chatString: - self.displayWhisper(fromId, chatString, WTNormal) + self.displayWhisper(fromId, chatString, WhisperPopup.WTNormal) def whisperSCEmoteTo(self, emoteId, sendToId): messenger.send('wakeup') @@ -163,7 +163,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa return chatString = SCDecoders.decodeSCEmoteWhisperMsg(emoteId, handle.getName()) if chatString: - self.displayWhisper(fromId, chatString, WTEmote) + self.displayWhisper(fromId, chatString, WhisperPopup.WTEmote) return def setChatAbsolute(self, chatString, chatFlags, dialogue = None, interrupt = 1, quiet = 0): diff --git a/otp/chat/TalkAssistant.py b/otp/chat/TalkAssistant.py index 74ffa8e1..f7f413bf 100755 --- a/otp/chat/TalkAssistant.py +++ b/otp/chat/TalkAssistant.py @@ -1,7 +1,7 @@ from direct.directnotify import DirectNotifyGlobal from direct.showbase import DirectObject from otp.chat.ChatGlobals import * -from toontown.chat.ChatGlobals import * +from otp.nametag.NametagConstants import * import ChatUtil class TalkAssistant(DirectObject.DirectObject): diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index 906398c2..ad320735 100755 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -16,7 +16,7 @@ from otp.distributed.OtpDoGlobals import * from otp.distributed.TelemetryLimiter import TelemetryLimiter from otp.otpbase import OTPGlobals, OTPLocalizer from otp.otpgui import OTPDialog -from toontown.chat.ChatGlobals import * +from otp.nametag.NametagConstants import * import sys, time, types, random class OTPClientRepository(ClientRepositoryBase): diff --git a/toontown/shtiker/ShtikerBook.py b/toontown/shtiker/ShtikerBook.py index 6b6b8142..bdd38eb2 100755 --- a/toontown/shtiker/ShtikerBook.py +++ b/toontown/shtiker/ShtikerBook.py @@ -5,7 +5,7 @@ from direct.showbase import DirectObject from panda3d.core import * from toontown.effects import DistributedFireworkShow -from toontown.nametag import NametagGlobals +from otp.nametag import NametagGlobals from toontown.parties import DistributedPartyFireworksActivity from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownGlobals @@ -63,9 +63,11 @@ class ShtikerBook(DirectFrame, StateData.StateData): base.disableMouse() base.render.hide() base.setBackgroundColor(0.05, 0.15, 0.4) - base.setCellsActive([base.rightCells[0]], 0) - NametagGlobals.setForce2dNametags(True) - NametagGlobals.setForceOnscreenChat(True) + base.setCellsAvailable([base.rightCells[0]], 0) + self.oldMin2dAlpha = NametagGlobals.getMin2dAlpha() + self.oldMax2dAlpha = NametagGlobals.getMax2dAlpha() + NametagGlobals.setMin2dAlpha(0.8) + NametagGlobals.setMax2dAlpha(1.0) self.__isOpen = 1 self.__setButtonVisibility() self.show() @@ -97,9 +99,9 @@ class ShtikerBook(DirectFrame, StateData.StateData): gsg = base.win.getGsg() if gsg: base.render.prepareScene(gsg) - base.setCellsActive([base.rightCells[0]], 1) - NametagGlobals.setForce2dNametags(False) - NametagGlobals.setForceOnscreenChat(False) + NametagGlobals.setMin2dAlpha(self.oldMin2dAlpha) + NametagGlobals.setMax2dAlpha(self.oldMax2dAlpha) + base.setCellsAvailable([base.rightCells[0]], 1) self.__isOpen = 0 self.hide() self.hideButton() diff --git a/toontown/suit/Suit.py b/toontown/suit/Suit.py index cf31aa55..8e62e256 100755 --- a/toontown/suit/Suit.py +++ b/toontown/suit/Suit.py @@ -3,7 +3,7 @@ from direct.actor import Actor from direct.task.Task import Task from otp.avatar import Avatar from toontown.battle import BattleProps, SuitBattleGlobals -from toontown.nametag import NametagGlobals +from otp.nametag.NametagGroup import NametagGroup from toontown.toonbase import TTLocalizer, ToontownGlobals from toontown.suit import SuitGlobals import SuitDNA, string @@ -333,7 +333,8 @@ class Suit(Avatar.Avatar): Avatar.Avatar.__init__(self) self.setFont(ToontownGlobals.getSuitFont()) - self.setPlayerType(NametagGlobals.CCSuit) + self.setSpeechFont(ToontownGlobals.getSuitFont()) + self.setPlayerType(NametagGroup.CCSuit) self.setPickable(1) self.leftHand = None self.rightHand = None @@ -416,8 +417,6 @@ class Suit(Avatar.Avatar): self.generateHead(head) self.setHeight(properties[SuitGlobals.HEIGHT_INDEX]) - if len(properties) > SuitGlobals.NAMETAG_WRAP_INDEX: - self.nametag.setWordWrap(properties[SuitGlobals.NAMETAG_WRAP_INDEX]) self.setName(SuitBattleGlobals.SuitAttributes[dna.name]['name']) self.getGeomNode().setScale(self.scale) diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 11c4d8f5..948616ad 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -29,8 +29,8 @@ from toontown.catalog import CatalogItem from toontown.catalog import CatalogItemList from toontown.chat import ResistanceChat from toontown.chat import ToonChatGarbler -from toontown.chat.ChatGlobals import * -from toontown.chat.WhisperPopup import * +from otp.nametag.NametagConstants import * +from otp.margins.WhisperPopup import * from toontown.coghq import CogDisguiseGlobals from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete @@ -46,8 +46,8 @@ from toontown.fishing import FishTank from toontown.friends import FriendHandle from toontown.golf import GolfGlobals from toontown.hood import ZoneUtil -from toontown.nametag import NametagGlobals -from toontown.nametag.NametagGlobals import * +from otp.nametag import NametagGroup +from otp.nametag.NametagGroup import * from toontown.parties import PartyGlobals from toontown.parties.InviteInfo import InviteInfo from toontown.parties.PartyGlobals import InviteStatus, PartyStatus @@ -2064,36 +2064,15 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute DistributedAvatar.DistributedAvatar.setChatAbsolute(self, chatString, chatFlags, dialogue, interrupt) def setChatMuted(self, chatString, chatFlags, dialogue=None, interrupt=1, quiet=0): - if chatFlags & CFQuicktalker: - self.nametag.setChatType(NametagGlobals.SPEEDCHAT) - elif chatFlags & CFSpeech: - self.nametag.setChatType(NametagGlobals.CHAT) - - if chatFlags & CFThought: - self.nametag.setChatBalloonType(NametagGlobals.THOUGHT_BALLOON) - else: - self.nametag.setChatBalloonType(NametagGlobals.CHAT_BALLOON) - - if chatFlags & CFPageButton: - self.nametag.setChatButton(NametagGlobals.pageButton) - elif chatFlags & CFQuitButton: - self.nametag.setChatButton(NametagGlobals.quitButton) - else: - self.nametag.setChatButton(NametagGlobals.noButton) - - self.nametag.setChatText(chatString, timeout=bool(chatFlags & CFTimeout)) + self.nametag.setChat(chatString, chatFlags) self.playCurrentDialogue(dialogue, chatFlags - CFSpeech, interrupt) def displayTalk(self, chatString): flags = CFSpeech | CFTimeout - self.nametag.setChatType(NametagGlobals.CHAT) if ChatUtil.isThought(chatString): flags = CFThought - self.nametag.setChatBalloonType(NametagGlobals.THOUGHT_BALLOON) chatString = ChatUtil.removeThoughtPrefix(chatString) - else: - self.nametag.setChatBalloonType(NametagGlobals.CHAT_BALLOON) - self.nametag.setChatText(chatString, timeout=(flags & CFTimeout)) + self.nametag.setChat(chatString, flags) if base.toonChatSounds: self.playCurrentDialogue(None, flags, interrupt=1) diff --git a/toontown/toon/TTEmote.py b/toontown/toon/TTEmote.py index 3cdf7fc9..d89a6c33 100755 --- a/toontown/toon/TTEmote.py +++ b/toontown/toon/TTEmote.py @@ -8,8 +8,8 @@ import types import Toon, ToonDNA from otp.avatar import Emote from otp.otpbase import OTPLocalizer -from toontown.chat.ChatGlobals import * -from toontown.nametag.NametagGlobals import * +from otp.nametag.NametagConstants import * +from otp.nametag.NametagGroup import * from toontown.toonbase import TTLocalizer diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index bf16e86c..ea2f5063 100755 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -20,12 +20,12 @@ from otp.avatar.Avatar import teleportNotify from otp.otpbase import OTPGlobals from otp.otpbase import OTPLocalizer from toontown.battle import SuitBattleGlobals -from toontown.chat.ChatGlobals import * +from otp.nametag.NametagConstants import * from toontown.distributed import DelayDelete from toontown.effects import DustCloud from toontown.effects import Wake from toontown.hood import ZoneUtil -from toontown.nametag.NametagGlobals import * +from otp.nametag.NametagGroup import * from toontown.suit import SuitDNA from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownGlobals @@ -454,6 +454,7 @@ class Toon(Avatar.Avatar, ToonHead): self.partyHat = None self.setTag('pieCode', str(ToontownGlobals.PieCodeToon)) self.setFont(ToontownGlobals.getToonFont()) + self.setSpeechFont(ToontownGlobals.getToonFont()) self.soundChatBubble = base.loadSfx('phase_3/audio/sfx/GUI_balloon_popup.ogg') self.animFSM = ClassicFSM('Toon', [State('off', self.enterOff, self.exitOff), State('neutral', self.enterNeutral, self.exitNeutral), @@ -2732,6 +2733,7 @@ class Toon(Avatar.Avatar, ToonHead): self.suit.loop('neutral') self.isDisguised = 1 self.setFont(ToontownGlobals.getSuitFont()) + self.setSpeechFont(ToontownGlobals.getSuitFont()) if setDisplayName: if hasattr(base, 'idTags') and base.idTags: name = self.getAvIdName() @@ -2765,7 +2767,8 @@ class Toon(Avatar.Avatar, ToonHead): Emote.globalEmote.releaseAll(self) self.isDisguised = 0 self.setFont(ToontownGlobals.getToonFont()) - self.nametag.setWordWrap(None) + self.setSpeechFont(ToontownGlobals.getToonFont()) + self.nametag.setWordwrap(None) if hasattr(base, 'idTags') and base.idTags: name = self.getAvIdName() else: