From fa24711bc88b6c7e0cb788ea50c51ee17a23fb1a Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 24 Jun 2015 14:09:51 -0400 Subject: [PATCH] More work --- toontown/friends/FriendsListManager.py | 6 ++-- toontown/parties/PartyPlanner.py | 44 ++++++++++---------------- toontown/toon/ToonHeadFrame.py | 17 +++++----- toontown/town/Street.py | 6 ++-- 4 files changed, 31 insertions(+), 42 deletions(-) diff --git a/toontown/friends/FriendsListManager.py b/toontown/friends/FriendsListManager.py index a822c4ed..5d7e2a1b 100755 --- a/toontown/friends/FriendsListManager.py +++ b/toontown/friends/FriendsListManager.py @@ -14,7 +14,7 @@ from toontown.toonbase import ToontownGlobals from toontown.toon import Toon import FriendHandle from otp.otpbase import OTPGlobals -from toontown.nametag import NametagGlobals +from otp.nametag import NametagGlobals class FriendsListManager: notify = DirectNotifyGlobal.directNotify.newCategory('FriendsListManager') @@ -47,7 +47,7 @@ class FriendsListManager: self.accept('openFriendsList', self.__openFriendsList) self.accept('clickedNametag', self.__handleClickedNametag) base.localAvatar.setFriendsListButtonActive(1) - NametagGlobals.setWantActiveNametags(True) + NametagGlobals.setMasterNametagsActive(1) self.accept('gotoAvatar', self.__handleGotoAvatar) self.accept('friendAvatar', self.__handleFriendAvatar) self.accept('avatarDetails', self.__handleAvatarDetails) @@ -65,7 +65,7 @@ class FriendsListManager: self.ignore('openFriendsList') self.ignore('clickedNametag') base.localAvatar.setFriendsListButtonActive(0) - NametagGlobals.setWantActiveNametags(False) + NametagGlobals.setMasterNametagsActive(0) if self.avatarPanel: self.avatarPanel.cleanup() self.avatarPanel = None diff --git a/toontown/parties/PartyPlanner.py b/toontown/parties/PartyPlanner.py index 658f27d0..90dae354 100755 --- a/toontown/parties/PartyPlanner.py +++ b/toontown/parties/PartyPlanner.py @@ -8,14 +8,12 @@ from direct.gui.DirectGui import DirectFrame, DirectButton, DirectLabel, DirectS from direct.showbase import DirectObject from direct.showbase import PythonUtil from panda3d.core import * -from pandac.PandaModules import Vec3, Vec4, Point3, TextNode, VBase4 from otp.otpbase import OTPGlobals from otp.otpbase import OTPLocalizer -from toontown.nametag.Nametag import Nametag -from toontown.nametag.NametagFloat2d import * -from toontown.nametag import NametagGlobals -from toontown.nametag.NametagGroup import NametagGroup +from otp.nametag.NametagGroup import NametagGroup +from otp.nametag.Nametag import Nametag +from otp.nametag.NametagFloat2d import * from toontown.parties import PartyGlobals from toontown.parties import PartyUtils from toontown.parties.CalendarGuiMonth import CalendarGuiMonth @@ -278,41 +276,33 @@ class PartyPlanner(DirectFrame, FSM): def __createNametag(self, parent): if self.nametagGroup == None: self.nametagGroup = NametagGroup() - interfaceFont = OTPGlobals.getInterfaceFont() - self.nametagGroup.setFont(interfaceFont) - self.nametagGroup.setChatFont(interfaceFont) - self.nametagGroup.setActive(False) + self.nametagGroup.setFont(ToontownGlobals.getToonFont()) + self.nametagGroup.setSpeechFont(ToontownGlobals.getToonFont()) + self.nametagGroup.setActive(0) self.nametagGroup.setAvatar(self.partyPlannerHead) self.nametagGroup.manage(base.marginManager) - nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCNonPlayer] - self.nametagGroup.setNametagColor(nametagColor) - chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNonPlayer] - self.nametagGroup.setChatColor(chatColor) - nametag2d = self.nametagGroup.getNametag2d() - nametag2d.hideNametag() - nametag2d.hideChat() + self.nametagGroup.setColorCode(self.nametagGroup.CCNonPlayer) + self.nametagGroup.getNametag2d().setContents(0) self.nametagNode = NametagFloat2d() - self.nametagNode.hideChat() - self.nametagGroup.add(self.nametagNode) - self.nametagGroup.setText(base.cr.partyManager.getPartyPlannerName()) + self.nametagNode.setContents(Nametag.CName) + self.nametagGroup.addNametag(self.nametagNode) + self.nametagGroup.setName(base.cr.partyManager.getPartyPlannerName()) self.nametagNP = parent.attachNewNode(self.nametagNode) nametagPos = self.gui.find('**/step_01_partymanPeteNametag_locator').getPos() self.nametagNP.setPosHprScale(nametagPos[0], 0, nametagPos[2], 0, 0, 0, 0.1, 1, 0.1) self.chatNode = NametagFloat2d() - self.chatNode.hideNametag() - self.chatNode.showThought() - self.nametagGroup.add(self.chatNode) - self.nametagGroup.setChatText(TTLocalizer.PartyPlannerInstructions) + self.chatNode.setContents(Nametag.CSpeech | Nametag.CThought) + self.nametagGroup.addNametag(self.chatNode) + self.nametagGroup.setChat(TTLocalizer.PartyPlannerInstructions, CFSpeech) self.chatNP = parent.attachNewNode(self.chatNode) chatPos = self.gui.find('**/step_01_partymanPeteText_locator').getPos() self.chatNP.setPosHprScale(chatPos[0], 0, chatPos[2], 0, 0, 0, 0.08, 1, 0.08) - self.nametagGroup.updateAll() def clearNametag(self): if self.nametagGroup != None: self.nametagGroup.unmanage(base.marginManager) - self.nametagGroup.remove(self.nametagNode) - self.nametagGroup.remove(self.chatNode) + self.nametagGroup.removeNametag(self.nametagNode) + self.nametagGroup.removeNametag(self.chatNode) self.nametagNP.removeNode() self.chatNP.removeNode() del self.nametagNP @@ -690,7 +680,7 @@ class PartyPlanner(DirectFrame, FSM): goingBackAllowed = False self.confirmTitleLabel['text'] = TTLocalizer.PartyPlannerConfirmationErrorTitle confirmRecapText = TTLocalizer.PartyPlannerConfirmationTooManyText - self.nametagGroup.setChatText(confirmRecapText) + self.nametagGroup.setChat(confirmRecapText, CFSpeech) self.request('Farewell', goingBackAllowed) def __acceptExit(self): diff --git a/toontown/toon/ToonHeadFrame.py b/toontown/toon/ToonHeadFrame.py index 902a8597..e384e97e 100755 --- a/toontown/toon/ToonHeadFrame.py +++ b/toontown/toon/ToonHeadFrame.py @@ -3,8 +3,8 @@ from panda3d.core import * import ToonHead from toontown.distributed import DelayDelete -from toontown.nametag.Nametag import Nametag -from toontown.nametag.NametagFloat2d import NametagFloat2d +from otp.nametag.Nametag import Nametag +from otp.nametag.NametagFloat2d import NametagFloat2d from toontown.toonbase import ToontownGlobals @@ -22,14 +22,13 @@ class ToonHeadFrame(DirectFrame): self.headModel.setupHead(self.av.style, forGui=1) self.headModel.reparentTo(self.head) self.tag1Node = NametagFloat2d() - self.tag1Node.hideNametag() - self.tag1Node.showThought() - self.av.nametag.add(self.tag1Node) + self.tag1Node.setContents(Nametag.CSpeech | Nametag.CThought) + self.av.nametag.addNametag(self.tag1Node) self.tag1 = self.attachNewNode(self.tag1Node) self.tag1.setPosHprScale(-0.16, 0, -0.09, 0, 0, 0, 0.055, 0.055, 0.055) self.tag2Node = NametagFloat2d() - self.tag2Node.hideChat() - self.av.nametag.add(self.tag2Node) + self.tag2Node.setContents(Nametag.CName) + self.av.nametag.addNametag(self.tag2Node) self.tag2 = self.attachNewNode(self.tag2Node) self.tag2.setPosHprScale(-0.27, 10.0, 0.16, 0, 0, 0, 0.05, 0.05, 0.05) self.extraData = DirectLabel(parent=self, relief=None, pos=(0.0, 0.0, 0.06), scale=1.0, text='', text0_fg=(0.3, 0.2, 1, 1), text_scale=(0.14, 0.06), text_pos=(0, -0.01)) @@ -42,8 +41,8 @@ class ToonHeadFrame(DirectFrame): self.head.removeNode() del self.head if not self.av.isEmpty(): - self.av.nametag.remove(self.tag1Node) - self.av.nametag.remove(self.tag2Node) + self.av.nametag.removeNametag(self.tag1Node) + self.av.nametag.removeNametag(self.tag2Node) self.tag1.removeNode() self.tag2.removeNode() del self.tag1 diff --git a/toontown/town/Street.py b/toontown/town/Street.py index 24ef2d41..9eab5e5b 100755 --- a/toontown/town/Street.py +++ b/toontown/town/Street.py @@ -19,7 +19,7 @@ from toontown.toon.Toon import teleportDebug from toontown.estate import HouseGlobals from toontown.toonbase import TTLocalizer from direct.interval.IntervalGlobal import * -from toontown.nametag import NametagGlobals +from otp.nametag import NametagGlobals visualizeZones = base.config.GetBool('visualize-zones', 0) @@ -104,7 +104,7 @@ class Street(BattlePlace.BattlePlace): base.localAvatar.setGeom(self.loader.geom) base.localAvatar.setOnLevelGround(1) self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH) - NametagGlobals.setWant2dNametags(arrowsOn) + NametagGlobals.setMasterArrowsOn(arrowsOn) self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId']) def __lightDecorationOn__(): @@ -147,7 +147,7 @@ class Street(BattlePlace.BattlePlace): light.reparentTo(hidden) newsManager = base.cr.newsManager - NametagGlobals.setWant2dNametags(False) + NametagGlobals.setMasterArrowsOn(0) self.loader.hood.stopSky() self.loader.music.stop() base.localAvatar.setGeom(render)