From 48539188de8d488bafa6ca936363e3ea733f1335 Mon Sep 17 00:00:00 2001 From: John Cote Date: Fri, 26 Jun 2015 03:09:27 -0400 Subject: [PATCH] Some final nametag shit --- otp/avatar/DistributedAvatar.py | 8 ++++---- otp/nametag/NametagConstants.py | 15 +++++++++++++++ toontown/building/DistributedDoor.py | 2 +- toontown/building/DistributedTutorialInterior.py | 4 ++-- toontown/cogdominium/CogdoBarrelRoomMovies.py | 4 ++-- toontown/cogdominium/CogdoElevatorMovie.py | 4 ++-- toontown/cogdominium/CogdoExecutiveSuiteMovies.py | 4 ++-- toontown/cogdominium/CogdoMazeGameMovies.py | 4 ++-- toontown/coghq/DistributedBanquetTable.py | 4 ++-- toontown/coghq/DistributedCountryClubRoom.py | 1 + toontown/coghq/DistributedFactory.py | 1 + toontown/coghq/DistributedGolfGreenGame.py | 4 ++-- toontown/coghq/DistributedMintRoom.py | 1 + toontown/coghq/DistributedStageRoom.py | 1 + toontown/distributed/ToontownClientRepository.py | 6 +++--- toontown/estate/DistributedTarget.py | 4 ++-- toontown/estate/houseDesign.py | 4 ++-- toontown/friends/FriendsListPanel.py | 8 ++++---- toontown/golf/DistributedGolfCourse.py | 4 ++-- toontown/hood/Place.py | 8 ++++---- toontown/minigame/DistributedCatchGame.py | 4 ++-- toontown/minigame/DistributedCogThiefGame.py | 4 ++-- toontown/minigame/DistributedMazeGame.py | 4 ++-- toontown/minigame/DistributedTagGame.py | 4 ++-- toontown/minigame/MazeSuit.py | 4 ++-- toontown/minigame/TwoDEnemy.py | 4 ++-- toontown/parties/CannonGui.py | 8 ++++---- toontown/parties/DistributedPartyActivity.py | 4 ++-- .../parties/DistributedPartyTrampolineActivity.py | 8 ++++---- toontown/parties/PartyCatchActivityToonSD.py | 4 ++-- toontown/parties/PartyCogActivityGui.py | 4 ++-- toontown/parties/PublicPartyGui.py | 4 ++-- toontown/quest/QuestChoiceGui.py | 8 ++++---- toontown/safezone/DistributedFishingSpot.py | 8 ++++---- toontown/safezone/DistributedPicnicTable.py | 4 ++-- toontown/safezone/Playground.py | 4 ++-- toontown/suit/DistributedGoon.py | 4 ++-- toontown/toon/DistributedNPCFisherman.py | 3 +-- toontown/toon/DistributedNPCGlove.py | 6 +++--- toontown/toon/DistributedNPCKartClerk.py | 3 +-- toontown/toon/DistributedNPCLaffRestock.py | 2 +- toontown/toon/DistributedNPCPartyPerson.py | 2 +- toontown/toon/DistributedNPCPetclerk.py | 3 +-- toontown/toon/DistributedNPCSpecialQuestGiver.py | 3 +-- .../toon/DistributedNPCSpecialQuestGiverAI.py | 1 - toontown/toon/DistributedNPCTailor.py | 2 +- toontown/toon/DistributedSmartNPC.py | 3 +-- toontown/toon/DistributedToon.py | 11 ++++++----- toontown/toon/GroupPanel.py | 7 +++---- toontown/toon/TTEmote.py | 2 +- toontown/toon/Toon.py | 14 +++++++------- toontown/toon/ToonAvatarPanel.py | 4 ++-- toontown/uberdog/ClientServicesManager.py | 4 ++-- toontown/uberdog/DistributedPartyManager.py | 2 +- 54 files changed, 130 insertions(+), 117 deletions(-) diff --git a/otp/avatar/DistributedAvatar.py b/otp/avatar/DistributedAvatar.py index f2a11835..76081ab7 100755 --- a/otp/avatar/DistributedAvatar.py +++ b/otp/avatar/DistributedAvatar.py @@ -9,6 +9,7 @@ from Avatar import Avatar from otp.ai.MagicWordGlobal import * from otp.otpbase import OTPGlobals from toontown.battle.BattleProps import globalPropPool +from otp.nametag.Nametag import Nametag class DistributedAvatar(DistributedActor, Avatar): @@ -84,12 +85,11 @@ class DistributedAvatar(DistributedActor, Avatar): def do_setParent(self, parentToken): if not self.isDisabled(): - nametag2d = self.nametag.getNametag2d() if parentToken == OTPGlobals.SPHidden: - nametag2d.hideNametag() + self.nametag2dDist &= ~Nametag.CName else: - nametag2d.showNametag() - nametag2d.update() + self.nametag2dDist |= Nametag.CName + self.nametag.getNametag2d().setContents(self.nametag2dContents & self.nametag2dDist) DistributedActor.do_setParent(self, parentToken) self.__setTags() diff --git a/otp/nametag/NametagConstants.py b/otp/nametag/NametagConstants.py index 39cd3067..b4c668f0 100644 --- a/otp/nametag/NametagConstants.py +++ b/otp/nametag/NametagConstants.py @@ -17,6 +17,7 @@ CCSuitBuilding = 5 CCHouseBuilding = 6 CCSpeedChat = 7 CCFreeChat = 8 +CCAdmin = 9 NAMETAG_COLORS = { CCNormal: ( @@ -145,6 +146,20 @@ 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 ), + CCAdmin: ( + # Normal FG BG + ((1.0, 0.35, 0.25, 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.35, 0.25, 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.56, 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 + ((1.0, 0.35, 0.25, 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 + ), } ARROW_COLORS = { diff --git a/toontown/building/DistributedDoor.py b/toontown/building/DistributedDoor.py index 8153ffa8..059295bd 100755 --- a/toontown/building/DistributedDoor.py +++ b/toontown/building/DistributedDoor.py @@ -113,7 +113,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable): self.nametag.setActive(0) self.nametag.setAvatar(self.getDoorNodePath()) self.nametag.setObjectCode(self.block) - name = self.cr.playGame.dnaData.getBlock(self.block).title + name = self.cr.playGame.dnaStore.getTitleFromBlockNumber(self.block) self.nametag.setName(name) self.nametag.manage(base.marginManager) diff --git a/toontown/building/DistributedTutorialInterior.py b/toontown/building/DistributedTutorialInterior.py index 98b68603..3889e464 100755 --- a/toontown/building/DistributedTutorialInterior.py +++ b/toontown/building/DistributedTutorialInterior.py @@ -145,8 +145,8 @@ class DistributedTutorialInterior(DistributedObject.DistributedObject): suitDNA = SuitDNA.SuitDNA() suitDNA.newSuit('f') self.suit.setDNA(suitDNA) - self.suit.nametag.setNametag2d(None) - self.suit.nametag.setNametag3d(None) + self.suit.nametag3d.stash() + self.suit.nametag.destroy() self.suit.loop('neutral') self.suit.setPosHpr(-20, 8, 0, 0, 0, 0) self.suit.reparentTo(self.interior) diff --git a/toontown/cogdominium/CogdoBarrelRoomMovies.py b/toontown/cogdominium/CogdoBarrelRoomMovies.py index 8506176f..affdff5e 100755 --- a/toontown/cogdominium/CogdoBarrelRoomMovies.py +++ b/toontown/cogdominium/CogdoBarrelRoomMovies.py @@ -87,13 +87,13 @@ class CogdoBarrelRoomIntro(CogdoGameMovie): def start(): self.frame.show() - base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 0) + base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 0) def end(): self._dialogueLabel.reparentTo(hidden) self.toonHead.reparentTo(hidden) self.frame.hide() - base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 1) + base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 1) self._stopUpdateTask() self._ival = Sequence(Func(start), Func(self.displayLine, dialogue), Wait(CogdoBarrelRoomConsts.BarrelRoomIntroTimeout), Func(end)) diff --git a/toontown/cogdominium/CogdoElevatorMovie.py b/toontown/cogdominium/CogdoElevatorMovie.py index c78ae53b..293e6688 100755 --- a/toontown/cogdominium/CogdoElevatorMovie.py +++ b/toontown/cogdominium/CogdoElevatorMovie.py @@ -87,13 +87,13 @@ class CogdoElevatorMovie(CogdoGameMovie): def start(): self.frame.show() - base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 0) + base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 0) def end(): self._dialogueLabel.reparentTo(hidden) self.toonHead.reparentTo(hidden) self.frame.hide() - base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 1) + base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 1) self._stopUpdateTask() self._ival = Sequence(Func(start), Func(self.displayLine, dialogue), Wait(self.elevatorDuration), Func(end)) diff --git a/toontown/cogdominium/CogdoExecutiveSuiteMovies.py b/toontown/cogdominium/CogdoExecutiveSuiteMovies.py index 4eb230ec..fb3e6ccf 100755 --- a/toontown/cogdominium/CogdoExecutiveSuiteMovies.py +++ b/toontown/cogdominium/CogdoExecutiveSuiteMovies.py @@ -91,7 +91,7 @@ class CogdoExecutiveSuiteIntro(CogdoGameMovie): def start(): self.frame.show() - base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 0) + base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 0) def showShopOwner(): self._setCamTarget(self._shopOwner, -10, offset=Point3(0, 0, 5)) @@ -100,7 +100,7 @@ class CogdoExecutiveSuiteIntro(CogdoGameMovie): self._dialogueLabel.reparentTo(hidden) self.toonHead.reparentTo(hidden) self.frame.hide() - base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 1) + base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 1) self._stopUpdateTask() self._ival = Sequence(Func(start), Func(self.displayLine, dialogue), Func(showShopOwner), ParallelEndTogether(camera.posInterval(self.cameraMoveDuration, Point3(8, 0, 13), blendType='easeInOut'), camera.hprInterval(0.5, self._camHelperNode.getHpr(), blendType='easeInOut')), Wait(self.introDuration), Func(end)) diff --git a/toontown/cogdominium/CogdoMazeGameMovies.py b/toontown/cogdominium/CogdoMazeGameMovies.py index 61fb7d8b..498db394 100755 --- a/toontown/cogdominium/CogdoMazeGameMovies.py +++ b/toontown/cogdominium/CogdoMazeGameMovies.py @@ -87,8 +87,8 @@ class CogdoMazeGameIntro(CogdoGameMovie): d = SuitDNA.SuitDNA() d.newSuit(suitData['dnaName']) bossSuit.setDNA(d) - bossSuit.nametag.setNametag2d(None) - bossSuit.nametag.setNametag3d(None) + bossSuit.nametag3d.stash() + bossSuit.nametag.destroy() bossSuit.setScale(suitData['scale']) bossSuit.loop('neutral') bossSuit.reparentTo(render) diff --git a/toontown/coghq/DistributedBanquetTable.py b/toontown/coghq/DistributedBanquetTable.py index b6086d85..5bf867d6 100755 --- a/toontown/coghq/DistributedBanquetTable.py +++ b/toontown/coghq/DistributedBanquetTable.py @@ -192,8 +192,8 @@ class DistributedBanquetTable(DistributedObject.DistributedObject, FSM.FSM, Banq level -= 4 diner.dna.newSuitRandom(level=level, dept='c') diner.setDNA(diner.dna) - diner.nametag.setNametag2d(None) - diner.nametag.setNametag3d(None) + diner.nametag3d.stash() + diner.nametag.destroy() if self.useNewAnimations: diner.loop('sit', fromFrame=i) else: diff --git a/toontown/coghq/DistributedCountryClubRoom.py b/toontown/coghq/DistributedCountryClubRoom.py index 91bdd4d5..9ed19ba5 100755 --- a/toontown/coghq/DistributedCountryClubRoom.py +++ b/toontown/coghq/DistributedCountryClubRoom.py @@ -9,6 +9,7 @@ import CountryClubRoomBase, CountryClubRoom import FactoryEntityCreator import CountryClubRoomSpecs from otp.level import LevelSpec, LevelConstants +from otp.nametag.NametagConstants import * from toontown.toonbase import TTLocalizer def getCountryClubRoomReadyPostName(doId): diff --git a/toontown/coghq/DistributedFactory.py b/toontown/coghq/DistributedFactory.py index d8dfd3d3..5aa044b4 100755 --- a/toontown/coghq/DistributedFactory.py +++ b/toontown/coghq/DistributedFactory.py @@ -13,6 +13,7 @@ from otp.level import LevelConstants from toontown.toonbase import TTLocalizer from toontown.coghq import FactoryCameraViews from direct.controls.ControlManager import CollisionHandlerRayStart +from otp.nametag.NametagConstants import * from otp.ai.MagicWordGlobal import * class DistributedFactory(DistributedLevel.DistributedLevel, FactoryBase.FactoryBase): diff --git a/toontown/coghq/DistributedGolfGreenGame.py b/toontown/coghq/DistributedGolfGreenGame.py index fbd2a457..25d4c63f 100755 --- a/toontown/coghq/DistributedGolfGreenGame.py +++ b/toontown/coghq/DistributedGolfGreenGame.py @@ -419,7 +419,7 @@ class DistributedGolfGreenGame(BattleBlocker.BattleBlocker): self.isActive = 1 self.__setCamera() self.spriteNode.show() - base.setCellsActive([base.bottomCells[1], base.bottomCells[2], base.bottomCells[3]], 0) + base.setCellsAvailable([base.bottomCells[1], base.bottomCells[2], base.bottomCells[3]], 0) self.setupFlag = 1 def startBoard(self, board, attackPattern): @@ -557,7 +557,7 @@ class DistributedGolfGreenGame(BattleBlocker.BattleBlocker): self.isActive = 0 if self.standbySprite: self.standbySprite.nodeObj.hide() - base.setCellsActive([base.bottomCells[1], base.bottomCells[2], base.bottomCells[3]], 1) + base.setCellsAvailable([base.bottomCells[1], base.bottomCells[2], base.bottomCells[3]], 1) self.sendUpdate('leaveGame', []) return diff --git a/toontown/coghq/DistributedMintRoom.py b/toontown/coghq/DistributedMintRoom.py index d0ed277d..f720f90e 100755 --- a/toontown/coghq/DistributedMintRoom.py +++ b/toontown/coghq/DistributedMintRoom.py @@ -9,6 +9,7 @@ import MintRoomBase, MintRoom import MintRoomSpecs from otp.level import DistributedLevel from otp.level import LevelSpec, LevelConstants +from otp.nametag.NametagConstants import * from toontown.toonbase import TTLocalizer from toontown.toonbase.ToontownGlobals import * diff --git a/toontown/coghq/DistributedStageRoom.py b/toontown/coghq/DistributedStageRoom.py index 6077525a..6cd61902 100755 --- a/toontown/coghq/DistributedStageRoom.py +++ b/toontown/coghq/DistributedStageRoom.py @@ -9,6 +9,7 @@ import StageRoomBase, StageRoom import FactoryEntityCreator import StageRoomSpecs from otp.level import LevelSpec, LevelConstants +from otp.nametag.NametagConstants import * from toontown.toonbase import TTLocalizer def getStageRoomReadyPostName(doId): diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index 37f97d6c..ff7dd89f 100755 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -293,13 +293,13 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): def handleAvatarResponseMsg(self, avatarId, di): self.cleanupWaitingForDatabase() dclass = self.dclassesByName['DistributedToon'] - NametagGlobals.setWant2dNametags(False) + NametagGlobals.setMasterArrowsOn(0) loader.beginBulkLoad('localAvatarPlayGame', OTPLocalizer.CREnteringToontown, 400, 1, TTLocalizer.TIP_GENERAL, 0) localAvatar = LocalToon.LocalToon(self) localAvatar.dclass = dclass base.localAvatar = localAvatar __builtins__['localAvatar'] = base.localAvatar - NametagGlobals.setMe(base.localAvatar) + NametagGlobals.setToon(base.localAvatar) localAvatar.doId = avatarId self.localAvatarDoId = avatarId parentId = None @@ -423,7 +423,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self.notify.error('could not delete localAvatar, delayDeletes=%s' % (base.localAvatar.getDelayDeleteNames(),)) base.localAvatar.deleteOrDelay() base.localAvatar.detectLeaks() - NametagGlobals.setMe(base.cam) + NametagGlobals.setToon(base.cam) del base.localAvatar del __builtins__['localAvatar'] base.localAvatarStyle = None diff --git a/toontown/estate/DistributedTarget.py b/toontown/estate/DistributedTarget.py index 0d622543..d6b36573 100755 --- a/toontown/estate/DistributedTarget.py +++ b/toontown/estate/DistributedTarget.py @@ -155,12 +155,12 @@ class DistributedTarget(DistributedObject.DistributedObject): def showTimer(self): if base.localAvatar.animFSM.getCurrentState().getName() != 'ReadBook': - base.setCellsActive([base.rightCells[0]], 0) + base.setCellsAvailable([base.rightCells[0]], 0) self.timer.show() def hideTimer(self): self.timer.hide() - base.setCellsActive([base.rightCells[0]], 1) + base.setCellsAvailable([base.rightCells[0]], 1) def setPosition(self, x, y, z): self.geom.setPos(x, y, z) diff --git a/toontown/estate/houseDesign.py b/toontown/estate/houseDesign.py index 84713cc5..ac271eef 100755 --- a/toontown/estate/houseDesign.py +++ b/toontown/estate/houseDesign.py @@ -383,7 +383,7 @@ class ObjectManager(NodePath, DirectObject): self.__updateDeleteButtons() self.showAtticPicker() base.localAvatar.laffMeter.stop() - base.setCellsActive(base.leftCells + [base.bottomCells[0]], 0) + base.setCellsAvailable(base.leftCells + [base.bottomCells[0]], 0) if self.guiInterval: self.guiInterval.finish() self.guiInterval = self.furnitureGui.posHprScaleInterval(1.0, Point3(0.155, -0.6, -1.045), Vec3(0), Vec3(0.06), startPos=Point3(0.115, 0.0, -0.66), startHpr=Vec3(0), startScale=Vec3(0.04), blendType='easeInOut', name='lerpFurnitureButton') @@ -419,7 +419,7 @@ class ObjectManager(NodePath, DirectObject): self.inTrashPicker = None self.__cleanupVerifyDelete() self.furnitureGui.hide() - base.setCellsActive(base.leftCells + [base.bottomCells[0]], 1) + base.setCellsAvailable(base.leftCells + [base.bottomCells[0]], 1) base.localAvatar.laffMeter.start() taskMgr.remove('recenterButtonFrameTask') self.cleanupDialog() diff --git a/toontown/friends/FriendsListPanel.py b/toontown/friends/FriendsListPanel.py index 7964e5de..f5ddc171 100755 --- a/toontown/friends/FriendsListPanel.py +++ b/toontown/friends/FriendsListPanel.py @@ -270,10 +270,10 @@ class FriendsListPanel(DirectFrame, StateData.StateData): friendButton.destroy() del self.friends[friendId] - self.createButtons(petFriends, NametagColors[CCNonPlayer][0][0]) - self.createButtons(admins, NametagColors[CCAdmin][0][0]) - self.createButtons(trueFriends, NametagColors[CCNormal][0][0]) - self.createButtons(friends, NametagColors[CCSpeedChat][0][0]) + self.createButtons(petFriends, NAMETAG_COLORS[CCNonPlayer][0][0]) + self.createButtons(admins, NAMETAG_COLORS[CCAdmin][0][0]) + self.createButtons(trueFriends, NAMETAG_COLORS[CCNormal][0][0]) + self.createButtons(friends, NAMETAG_COLORS[CCSpeedChat][0][0]) self.scrollList.index = self.listScrollIndex[self.panelType] self.scrollList.refresh() diff --git a/toontown/golf/DistributedGolfCourse.py b/toontown/golf/DistributedGolfCourse.py index a6516011..b4ae6386 100755 --- a/toontown/golf/DistributedGolfCourse.py +++ b/toontown/golf/DistributedGolfCourse.py @@ -157,7 +157,7 @@ class DistributedGolfCourse(DistributedObject.DistributedObject, FSM, DelayDelet else: color += 1 - base.setCellsActive(base.leftCells, 0) + base.setCellsAvailable(base.leftCells, 0) else: self.toonPanels = None @@ -201,7 +201,7 @@ class DistributedGolfCourse(DistributedObject.DistributedObject, FSM, DelayDelet else: self.notify.warning('GOLF COURSE: Attempting to clean up twice') - base.setCellsActive(base.leftCells, 1) + base.setCellsAvailable(base.leftCells, 1) def onstage(self): self.notify.debug('GOLF COURSE: onstage') diff --git a/toontown/hood/Place.py b/toontown/hood/Place.py index 064c52f1..e152ecde 100755 --- a/toontown/hood/Place.py +++ b/toontown/hood/Place.py @@ -436,7 +436,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): self.fsm.request(out[requestStatus['how']], [requestStatus]) def enterDoorIn(self, requestStatus): - NametagGlobals.setWant2dNametags(False) + NametagGlobals.setMasterArrowsOn(0) door = base.cr.doId2do.get(requestStatus['doorDoId']) if not door is None: door.readyToExit() @@ -444,7 +444,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.startQuestMap() def exitDoorIn(self): - NametagGlobals.setWant2dNametags(True) + NametagGlobals.setMasterArrowsOn(1) base.localAvatar.obscureMoveFurnitureButton(-1) def enterDoorOut(self): @@ -600,7 +600,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): def _placeTeleportInPostZoneComplete(self, requestStatus): teleportDebug(requestStatus, '_placeTeleportInPostZoneComplete(%s)' % (requestStatus,)) - NametagGlobals.setWant2dNametags(False) + NametagGlobals.setMasterArrowsOn(0) base.localAvatar.laffMeter.start() base.localAvatar.startQuestMap() base.localAvatar.reconsiderCheesyEffect() @@ -645,7 +645,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): def exitTeleportIn(self): self.removeSetZoneCompleteCallback(self._tiToken) self._tiToken = None - NametagGlobals.setWant2dNametags(True) + NametagGlobals.setMasterArrowsOn(1) base.localAvatar.laffMeter.stop() base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.stopUpdateSmartCamera() diff --git a/toontown/minigame/DistributedCatchGame.py b/toontown/minigame/DistributedCatchGame.py index 538488a3..f9147367 100755 --- a/toontown/minigame/DistributedCatchGame.py +++ b/toontown/minigame/DistributedCatchGame.py @@ -116,8 +116,8 @@ class DistributedCatchGame(DistributedMinigame): d = SuitDNA.SuitDNA() d.newSuit(type) suit.setDNA(d) - suit.nametag.setNametag2d(None) - suit.nametag.setNametag3d(None) + suit.nametag3d.stash() + suit.nametag.destroy() suit.pose('walk', 0) self.suits.append(suit) diff --git a/toontown/minigame/DistributedCogThiefGame.py b/toontown/minigame/DistributedCogThiefGame.py index 9c438929..1de4f300 100755 --- a/toontown/minigame/DistributedCogThiefGame.py +++ b/toontown/minigame/DistributedCogThiefGame.py @@ -176,8 +176,8 @@ class DistributedCogThiefGame(DistributedMinigame): pos = self.cogInfo[cogIndex]['pos'] suit.reparentTo(self.gameBoard) suit.setPos(pos) - suit.nametag.setNametag2d(None) - suit.nametag.setNametag3d(None) + suit.nametag3d.stash() + suit.nametag.destroy() for avId in self.avIdList: self.toonHitTracks[avId] = Wait(0.1) diff --git a/toontown/minigame/DistributedMazeGame.py b/toontown/minigame/DistributedMazeGame.py index 4d4e15c4..e4178cde 100755 --- a/toontown/minigame/DistributedMazeGame.py +++ b/toontown/minigame/DistributedMazeGame.py @@ -621,7 +621,7 @@ class DistributedMazeGame(DistributedMinigame): self.scorePanels = [] self.goalBar.destroy() del self.goalBar - base.setCellsActive(base.rightCells, 1) + base.setCellsAvailable(base.rightCells, 1) for suit in self.suits: suit.offstage() @@ -700,7 +700,7 @@ class DistributedMazeGame(DistributedMinigame): self.goalBar.show() self.goalBar['value'] = 0.0 - base.setCellsActive(base.rightCells, 0) + base.setCellsAvailable(base.rightCells, 0) self.__spawnUpdateSuitsTask() orthoDrive = OrthoDrive(self.TOON_SPEED, maxFrameMove=self.MAX_FRAME_MOVE, customCollisionCallback=self.__doMazeCollisions, priority=1) self.orthoWalk = OrthoWalk(orthoDrive, broadcast=not self.isSinglePlayer()) diff --git a/toontown/minigame/DistributedTagGame.py b/toontown/minigame/DistributedTagGame.py index 66a9e5bf..696beef7 100755 --- a/toontown/minigame/DistributedTagGame.py +++ b/toontown/minigame/DistributedTagGame.py @@ -162,7 +162,7 @@ class DistributedTagGame(DistributedMinigame): scorePanel.reparentTo(base.a2dBottomRight) self.scorePanels.append(scorePanel) - base.setCellsActive(base.rightCells, 0) + base.setCellsAvailable(base.rightCells, 0) self.walkStateData.enter() self.walkStateData.fsm.request('walking') if base.localAvatar.isIt: @@ -195,7 +195,7 @@ class DistributedTagGame(DistributedMinigame): panel.cleanup() self.scorePanels = [] - base.setCellsActive(base.rightCells, 1) + base.setCellsAvailable(base.rightCells, 1) base.mouseInterfaceNode.setForwardSpeed(ToontownGlobals.ToonForwardSpeed) base.mouseInterfaceNode.setRotateSpeed(ToontownGlobals.ToonRotateSpeed) self.itPointer.reparentTo(hidden) diff --git a/toontown/minigame/MazeSuit.py b/toontown/minigame/MazeSuit.py index e211197a..0e00e712 100755 --- a/toontown/minigame/MazeSuit.py +++ b/toontown/minigame/MazeSuit.py @@ -43,8 +43,8 @@ class MazeSuit(DirectObject): d = SuitDNA.SuitDNA() d.newSuit(suitDnaName) self.suit.setDNA(d) - self.suit.nametag.setNametag2d(None) - self.suit.nametag.setNametag3d(None) + self.suit.nametag3d.stash() + self.suit.nametag.destroy() if startTile is None: defaultStartPos = MazeGameGlobals.SUIT_START_POSITIONS[self.serialNum] self.startTile = (defaultStartPos[0] * self.maze.width, defaultStartPos[1] * self.maze.height) diff --git a/toontown/minigame/TwoDEnemy.py b/toontown/minigame/TwoDEnemy.py index d5af57d9..ad62545f 100755 --- a/toontown/minigame/TwoDEnemy.py +++ b/toontown/minigame/TwoDEnemy.py @@ -84,8 +84,8 @@ class TwoDEnemy(DirectObject): self.suit.pose('walk', 0) self.suitName = 'Enemy-%s' % self.index self.suit.setName(self.suitName) - self.suit.nametag.setNametag2d(None) - self.suit.nametag.setNametag3d(None) + self.suit.nametag3d.stash() + self.suit.nametag.destroy() suitPosAttribs = suitAttribs[1] initX, initY, initZ = suitPosAttribs[0] initPos = Point3(initX, initY, initZ) diff --git a/toontown/parties/CannonGui.py b/toontown/parties/CannonGui.py index 95ec0518..0cb9e4fc 100755 --- a/toontown/parties/CannonGui.py +++ b/toontown/parties/CannonGui.py @@ -75,8 +75,8 @@ class CannonGui(DirectObject): def enable(self, timer = 0): self.__aimPad.show() - base.setCellsActive([base.bottomCells[2], base.bottomCells[3]], 0) - base.setCellsActive([base.rightCells[1]], 0) + base.setCellsAvailable([base.bottomCells[2], base.bottomCells[3]], 0) + base.setCellsAvailable([base.rightCells[1]], 0) if timer > 0: self.__timerPad.setTime(timer) self.__timerPad.countdown(timer) @@ -85,8 +85,8 @@ class CannonGui(DirectObject): def disable(self): self.__aimPad.hide() - base.setCellsActive([base.bottomCells[2], base.bottomCells[3]], 1) - base.setCellsActive([base.rightCells[1]], 1) + base.setCellsAvailable([base.bottomCells[2], base.bottomCells[3]], 1) + base.setCellsAvailable([base.rightCells[1]], 1) self.__timerPad.hide() self.disableKeys() diff --git a/toontown/parties/DistributedPartyActivity.py b/toontown/parties/DistributedPartyActivity.py index 025039a5..d2795f68 100755 --- a/toontown/parties/DistributedPartyActivity.py +++ b/toontown/parties/DistributedPartyActivity.py @@ -496,7 +496,7 @@ class DistributedPartyActivity(DistributedObject.DistributedObject): self.notify.debug('BASE: startRules') self.accept(self.rulesDoneEvent, self.handleRulesDone) self.rulesPanel = MinigameRulesPanel('PartyRulesPanel', self.getTitle(), self.getInstructions(), self.rulesDoneEvent, timeout) - base.setCellsActive(base.bottomCells + [base.leftCells[0], base.rightCells[1]], False) + base.setCellsAvailable(base.bottomCells + [base.leftCells[0], base.rightCells[1]], False) self.rulesPanel.load() self.rulesPanel.enter() @@ -507,7 +507,7 @@ class DistributedPartyActivity(DistributedObject.DistributedObject): self.rulesPanel.exit() self.rulesPanel.unload() del self.rulesPanel - base.setCellsActive(base.bottomCells + [base.leftCells[0], base.rightCells[1]], True) + base.setCellsAvailable(base.bottomCells + [base.leftCells[0], base.rightCells[1]], True) def handleRulesDone(self): self.notify.error('BASE: handleRulesDone should be overridden') diff --git a/toontown/parties/DistributedPartyTrampolineActivity.py b/toontown/parties/DistributedPartyTrampolineActivity.py index 262b2f6d..c4d9cc7b 100755 --- a/toontown/parties/DistributedPartyTrampolineActivity.py +++ b/toontown/parties/DistributedPartyTrampolineActivity.py @@ -299,7 +299,7 @@ class DistributedPartyTrampolineActivity(DistributedPartyActivity): def startActive(self): DistributedPartyTrampolineActivity.notify.debug('startActive') if self.toon != None and self.toon.doId == base.localAvatar.doId: - base.setCellsActive(base.bottomCells, True) + base.setCellsAvailable(base.bottomCells, True) self.accept('arrow_left', self.onLeft) self.accept('arrow_left-up', self.onLeftUp) self.accept('arrow_right', self.onRight) @@ -390,8 +390,8 @@ class DistributedPartyTrampolineActivity(DistributedPartyActivity): self.timeLeftToSimulate = 0.0 self.doSimulateStep = False taskMgr.add(self.updateTask, self.uniqueName('TrampolineActivity.updateTask')) - base.setCellsActive(base.leftCells, False) - base.setCellsActive(base.bottomCells, False) + base.setCellsAvailable(base.leftCells, False) + base.setCellsAvailable(base.bottomCells, False) DistributedPartyActivity.startRules(self) def releaseToon(self): @@ -405,7 +405,7 @@ class DistributedPartyTrampolineActivity(DistributedPartyActivity): self.hopOffAnim.start() def postHopOff(self): - base.setCellsActive(base.leftCells, True) + base.setCellsAvailable(base.leftCells, True) self.timer.stop() self.timer.hide() self.toon.dropShadow.reparentTo(self.toon.getShadowJoint()) diff --git a/toontown/parties/PartyCatchActivityToonSD.py b/toontown/parties/PartyCatchActivityToonSD.py index 895e1dcf..16bd2de5 100755 --- a/toontown/parties/PartyCatchActivityToonSD.py +++ b/toontown/parties/PartyCatchActivityToonSD.py @@ -109,7 +109,7 @@ class PartyCatchActivityToonSD(StateData.StateData): self.activity.orthoWalk.stop() self.accept(self.activity.rulesDoneEvent, self.handleRulesDone) self.rulesPanel = MinigameRulesPanel('PartyRulesPanel', self.activity.getTitle(), self.activity.getInstructions(), self.activity.rulesDoneEvent, PartyGlobals.DefaultRulesTimeout) - base.setCellsActive(base.bottomCells + [base.leftCells[0], base.rightCells[1]], False) + base.setCellsAvailable(base.bottomCells + [base.leftCells[0], base.rightCells[1]], False) self.rulesPanel.load() self.rulesPanel.enter() else: @@ -125,7 +125,7 @@ class PartyCatchActivityToonSD(StateData.StateData): self.rulesPanel.exit() self.rulesPanel.unload() del self.rulesPanel - base.setCellsActive(base.bottomCells + [base.leftCells[0], base.rightCells[1]], True) + base.setCellsAvailable(base.bottomCells + [base.leftCells[0], base.rightCells[1]], True) def enterNormal(self): self.notify.debug('enterNormal') diff --git a/toontown/parties/PartyCogActivityGui.py b/toontown/parties/PartyCogActivityGui.py index 99d03618..4b62767d 100755 --- a/toontown/parties/PartyCogActivityGui.py +++ b/toontown/parties/PartyCogActivityGui.py @@ -254,12 +254,12 @@ class PartyCogActivityGui(DirectObject): def disableToontownHUD(self): base.localAvatar.hideName() base.localAvatar.laffMeter.hide() - base.setCellsActive(base.bottomCells + [base.rightCells[1]], False) + base.setCellsAvailable(base.bottomCells + [base.rightCells[1]], False) def enableToontownHUD(self): base.localAvatar.showName() base.localAvatar.laffMeter.show() - base.setCellsActive(base.bottomCells + [base.rightCells[1]], True) + base.setCellsAvailable(base.bottomCells + [base.rightCells[1]], True) def setTeam(self, team): self.team = team diff --git a/toontown/parties/PublicPartyGui.py b/toontown/parties/PublicPartyGui.py index a0025bdb..f5ba382f 100755 --- a/toontown/parties/PublicPartyGui.py +++ b/toontown/parties/PublicPartyGui.py @@ -243,9 +243,9 @@ class PublicPartyGui(DirectFrame): return (list, label) def stash(self): - base.setCellsActive(base.bottomCells, 1) + base.setCellsAvailable(base.bottomCells, 1) DirectFrame.stash(self) def unstash(self): - base.setCellsActive(base.bottomCells, 0) + base.setCellsAvailable(base.bottomCells, 0) DirectFrame.unstash(self) diff --git a/toontown/quest/QuestChoiceGui.py b/toontown/quest/QuestChoiceGui.py index c3f1f640..ba9a6a9a 100755 --- a/toontown/quest/QuestChoiceGui.py +++ b/toontown/quest/QuestChoiceGui.py @@ -19,8 +19,8 @@ class QuestChoiceGui(DirectFrame): self.timer = ToontownTimer.ToontownTimer() self.timer.reparentTo(self) self.timer.setScale(0.3) - base.setCellsActive(base.leftCells, 0) - base.setCellsActive([base.bottomCells[0], base.bottomCells[1]], 0) + base.setCellsAvailable(base.leftCells, 0) + base.setCellsAvailable([base.bottomCells[0], base.bottomCells[1]], 0) def setQuests(self, quests, fromNpcId, timeout): for i in xrange(0, len(quests), 3): @@ -56,8 +56,8 @@ class QuestChoiceGui(DirectFrame): if questId != 0: if base.config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: CREATEATASK: Create A Task.') - base.setCellsActive(base.leftCells, 1) - base.setCellsActive([base.bottomCells[0], base.bottomCells[1]], 1) + base.setCellsAvailable(base.leftCells, 1) + base.setCellsAvailable([base.bottomCells[0], base.bottomCells[1]], 1) self.timer.stop() messenger.send('chooseQuest', [questId]) diff --git a/toontown/safezone/DistributedFishingSpot.py b/toontown/safezone/DistributedFishingSpot.py index 028ed44f..9eca5fe7 100755 --- a/toontown/safezone/DistributedFishingSpot.py +++ b/toontown/safezone/DistributedFishingSpot.py @@ -223,7 +223,7 @@ class DistributedFishingSpot(DistributedObject.DistributedObject): else: self.collSphere.setTangible(1) if self.avId == base.localAvatar.doId: - base.setCellsActive(base.bottomCells, 0) + base.setCellsAvailable(base.bottomCells, 0) self.localToonFishing = 1 if base.wantBingo: self.pond.setLocalToonSpot(self) @@ -240,8 +240,8 @@ class DistributedFishingSpot(DistributedObject.DistributedObject): self.__hideCastGui() if base.wantBingo: self.pond.setLocalToonSpot() - base.setCellsActive([base.bottomCells[1], base.bottomCells[2]], 1) - base.setCellsActive(base.rightCells, 1) + base.setCellsAvailable([base.bottomCells[1], base.bottomCells[2]], 1) + base.setCellsAvailable(base.rightCells, 1) place = base.cr.playGame.getPlace() if place: place.setState('walk') @@ -643,7 +643,7 @@ class DistributedFishingSpot(DistributedObject.DistributedObject): jar = self.castGui.find('**/jar') self.castGui.find('**/display_jar').reparentTo(jar) self.jar.reparentTo(jar) - base.setCellsActive(base.rightCells, 0) + base.setCellsAvailable(base.rightCells, 0) bucket.setScale(0.9) bucket.setX(-1.9) bucket.setZ(-.11) diff --git a/toontown/safezone/DistributedPicnicTable.py b/toontown/safezone/DistributedPicnicTable.py index de045bb7..cd01b482 100755 --- a/toontown/safezone/DistributedPicnicTable.py +++ b/toontown/safezone/DistributedPicnicTable.py @@ -500,10 +500,10 @@ class DistributedPicnicTable(DistributedNode.DistributedNode): self.tableclothSphereNode.setCollideMask(BitMask32(0)) def enterOff(self): - base.setCellsActive(base.leftCells + base.bottomCells, 0) + base.setCellsAvailable(base.leftCells + base.bottomCells, 0) def exitOff(self): - base.setCellsActive(base.bottomCells, 0) + base.setCellsAvailable(base.bottomCells, 0) def enterChooseMode(self): self.winTrack = Sequence(autoFinish=1) diff --git a/toontown/safezone/Playground.py b/toontown/safezone/Playground.py index d21788b9..ff918886 100755 --- a/toontown/safezone/Playground.py +++ b/toontown/safezone/Playground.py @@ -219,7 +219,7 @@ class Playground(Place.Place): self.loader.hood.startSky() lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() - NametagGlobals.setWant2dNametags(True) + NametagGlobals.setMasterArrowsOn(1) self.zoneId = requestStatus['zoneId'] self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList) how = requestStatus['how'] @@ -243,7 +243,7 @@ class Playground(Place.Place): light.reparentTo(hidden) newsManager = base.cr.newsManager - NametagGlobals.setWant2dNametags(False) + NametagGlobals.setMasterArrowsOn(0) for i in self.loader.nodeList: self.loader.exitAnimatedProps(i) diff --git a/toontown/suit/DistributedGoon.py b/toontown/suit/DistributedGoon.py index 48d676d6..f40b7bc4 100755 --- a/toontown/suit/DistributedGoon.py +++ b/toontown/suit/DistributedGoon.py @@ -183,8 +183,8 @@ class DistributedGoon(DistributedCrushableEntity.DistributedCrushableEntity, Goo Goon.Goon.delete(self) def enterOff(self, *args): - self.nametag.setNametag2d(None) - self.nametag.setNametag3d(None) + self.nametag3d.stash() + self.nametag.destroy() self.hide() self.isStunned = 0 self.isDead = 0 diff --git a/toontown/toon/DistributedNPCFisherman.py b/toontown/toon/DistributedNPCFisherman.py index 86c76998..150726fc 100755 --- a/toontown/toon/DistributedNPCFisherman.py +++ b/toontown/toon/DistributedNPCFisherman.py @@ -6,10 +6,9 @@ import time from DistributedNPCToonBase import * import NPCToons -from toontown.chat.ChatGlobals import * from toontown.fishing import FishSellGUI -from toontown.nametag.NametagGlobals import * from toontown.toonbase import TTLocalizer +from otp.nametag.NametagConstants import * class DistributedNPCFisherman(DistributedNPCToonBase): diff --git a/toontown/toon/DistributedNPCGlove.py b/toontown/toon/DistributedNPCGlove.py index e20f0fc4..3e9c5ba4 100755 --- a/toontown/toon/DistributedNPCGlove.py +++ b/toontown/toon/DistributedNPCGlove.py @@ -1,4 +1,4 @@ -from toontown.chat.ChatGlobals import CFSpeech, CFTimeout +from otp.nametag.NametagConstants import CFSpeech, CFTimeout from toontown.toonbase import TTLocalizer, ToontownGlobals from toontown.toon import NPCToons from DistributedNPCToonBase import DistributedNPCToonBase @@ -45,14 +45,14 @@ class DistributedNPCGlove(DistributedNPCToonBase): return base.cr.playGame.getPlace().fsm.request('stopped') - base.setCellsActive(base.bottomCells, 0) + base.setCellsAvailable(base.bottomCells, 0) self.setChatAbsolute(TTLocalizer.GlovePickColorMessage, CFSpeech|CFTimeout) self.acceptOnce('gloveShopDone', self.__gloveShopDone) self.gloveDialog = GloveShopGui.GloveShopGui() def freeAvatar(self): base.cr.playGame.getPlace().fsm.request('walk') - base.setCellsActive(base.bottomCells, 1) + base.setCellsAvailable(base.bottomCells, 1) def __gloveShopDone(self, state, glove): self.freeAvatar() diff --git a/toontown/toon/DistributedNPCKartClerk.py b/toontown/toon/DistributedNPCKartClerk.py index 6255979b..0e5f716c 100755 --- a/toontown/toon/DistributedNPCKartClerk.py +++ b/toontown/toon/DistributedNPCKartClerk.py @@ -4,11 +4,10 @@ from panda3d.core import * from DistributedNPCToonBase import * import NPCToons -from toontown.chat.ChatGlobals import * -from toontown.nametag.NametagGlobals import * from toontown.racing.KartShopGlobals import * from toontown.racing.KartShopGui import * from toontown.toonbase import TTLocalizer +from otp.nametag.NametagConstants import * class DistributedNPCKartClerk(DistributedNPCToonBase): diff --git a/toontown/toon/DistributedNPCLaffRestock.py b/toontown/toon/DistributedNPCLaffRestock.py index c8190294..56ca430b 100755 --- a/toontown/toon/DistributedNPCLaffRestock.py +++ b/toontown/toon/DistributedNPCLaffRestock.py @@ -1,6 +1,6 @@ from panda3d.core import * from direct.distributed import ClockDelta -from toontown.chat.ChatGlobals import CFSpeech, CFTimeout +from otp.nametag.NametagConstants import CFSpeech, CFTimeout from toontown.toonbase import TTLocalizer, ToontownGlobals from toontown.toontowngui import TTDialog from toontown.toon import NPCToons diff --git a/toontown/toon/DistributedNPCPartyPerson.py b/toontown/toon/DistributedNPCPartyPerson.py index 0bac45be..4acda0b5 100755 --- a/toontown/toon/DistributedNPCPartyPerson.py +++ b/toontown/toon/DistributedNPCPartyPerson.py @@ -5,7 +5,7 @@ from panda3d.core import * from DistributedNPCToonBase import DistributedNPCToonBase from otp.otpbase import OTPLocalizer -from toontown.chat.ChatGlobals import * +from otp.nametag.NametagConstants import * from toontown.parties import PartyGlobals from toontown.toon import NPCToons from toontown.toonbase import TTLocalizer diff --git a/toontown/toon/DistributedNPCPetclerk.py b/toontown/toon/DistributedNPCPetclerk.py index f9d6c046..0a426c28 100755 --- a/toontown/toon/DistributedNPCPetclerk.py +++ b/toontown/toon/DistributedNPCPetclerk.py @@ -4,11 +4,10 @@ from panda3d.core import * from DistributedNPCToonBase import * import NPCToons -from toontown.chat.ChatGlobals import * from toontown.hood import ZoneUtil -from toontown.nametag.NametagGlobals import * from toontown.pets import PetshopGUI from toontown.toonbase import TTLocalizer +from otp.nametag.NametagConstants import * class DistributedNPCPetclerk(DistributedNPCToonBase): diff --git a/toontown/toon/DistributedNPCSpecialQuestGiver.py b/toontown/toon/DistributedNPCSpecialQuestGiver.py index 7c365759..f266a3d4 100755 --- a/toontown/toon/DistributedNPCSpecialQuestGiver.py +++ b/toontown/toon/DistributedNPCSpecialQuestGiver.py @@ -2,13 +2,12 @@ from direct.interval.IntervalGlobal import * from panda3d.core import * from DistributedNPCToonBase import * -from toontown.chat.ChatGlobals import * from toontown.hood import ZoneUtil -from toontown.nametag.NametagGlobals import * from toontown.quest import QuestChoiceGui from toontown.quest import QuestParser from toontown.quest import TrackChoiceGui from toontown.toonbase import TTLocalizer +from otp.nametag.NametagConstants import * ChoiceTimeout = 20 diff --git a/toontown/toon/DistributedNPCSpecialQuestGiverAI.py b/toontown/toon/DistributedNPCSpecialQuestGiverAI.py index 3a12bfc5..78f9634f 100755 --- a/toontown/toon/DistributedNPCSpecialQuestGiverAI.py +++ b/toontown/toon/DistributedNPCSpecialQuestGiverAI.py @@ -3,7 +3,6 @@ from direct.task.Task import Task from panda3d.core import * from DistributedNPCToonBaseAI import * from toontown.quest import Quests -from toontown.nametag.NametagGlobals import * class DistributedNPCSpecialQuestGiverAI(DistributedNPCToonBaseAI): diff --git a/toontown/toon/DistributedNPCTailor.py b/toontown/toon/DistributedNPCTailor.py index 6b0c2318..ae701637 100755 --- a/toontown/toon/DistributedNPCTailor.py +++ b/toontown/toon/DistributedNPCTailor.py @@ -6,7 +6,7 @@ from DistributedNPCToonBase import * import NPCToons import TailorClothesGUI import ToonDNA -from toontown.chat.ChatGlobals import * +from otp.nametag.NametagConstants import * from toontown.estate import ClosetGlobals from toontown.toonbase import TTLocalizer diff --git a/toontown/toon/DistributedSmartNPC.py b/toontown/toon/DistributedSmartNPC.py index 5dcf8772..bc317894 100755 --- a/toontown/toon/DistributedSmartNPC.py +++ b/toontown/toon/DistributedSmartNPC.py @@ -1,9 +1,8 @@ from panda3d.core import * from DistributedNPCToonBase import * -from toontown.chat.ChatGlobals import * from toontown.hood import ZoneUtil -from toontown.nametag.NametagGlobals import * +from otp.nametag.NametagConstants import * from toontown.quest import QuestChoiceGui from toontown.quest import QuestParser from toontown.quest import TrackChoiceGui diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 948616ad..6fc1b770 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -1211,10 +1211,11 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute realIndexToUse = 0 if type(index) == type(0) and 0 <= index and index < len(speedChatStyles): realIndexToUse = index + else: + base.cr.centralLogger.writeClientEvent('Hacker victim setSpeedChatStyleIndex invalid attacking toon = %d' % self.doId) self.speedChatStyleIndex = realIndexToUse nameKey, arrowColor, rolloverColor, frameColor = speedChatStyles[realIndexToUse] - self.nametag.setSpeedChatColor(VBase4(frameColor[0], frameColor[1], frameColor[2], 1)) - self.nametag.updateAll() + self.nametag.setQtColor(VBase4(frameColor[0], frameColor[1], frameColor[2], 1)) if self.isLocal(): messenger.send('SpeedChatStyleChange', []) @@ -1990,11 +1991,11 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute base.playSfx(dialogue, node=self) elif chatFlags & CFSpeech != 0: if self.nametag.getNumChatPages() > 0: - self.playDialogueForString(self.nametag.getChatText()) + self.playDialogueForString(self.nametag.getChat()) if self.soundChatBubble != None: base.playSfx(self.soundChatBubble, node=self) - elif self.nametag.getStompChatText(): - self.playDialogueForString(self.nametag.getStompChatText(), self.nametag.CHAT_STOMP_DELAY) + elif self.nametag.getChatStomp(): + self.playDialogueForString(self.nametag.getStompText(), self.nametag.getStompDelay()) def playDialogueForString(self, chatString, delay = 0.0): if len(chatString) == 0: diff --git a/toontown/toon/GroupPanel.py b/toontown/toon/GroupPanel.py index e7d7fe8c..d8636f55 100755 --- a/toontown/toon/GroupPanel.py +++ b/toontown/toon/GroupPanel.py @@ -1,7 +1,6 @@ from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer -from toontown.nametag import NametagGlobals from direct.gui.DirectGui import * from panda3d.core import * from direct.showbase import DirectObject @@ -30,7 +29,7 @@ class GroupPanel(DirectObject.DirectObject): return def cleanup(self): - base.setCellsActive(base.leftCells, 1) + base.setCellsAvailable(base.leftCells, 1) self.quitButton.destroy() self.hideButton.destroy() self.showButton.destroy() @@ -103,9 +102,9 @@ class GroupPanel(DirectObject.DirectObject): self.__makeGoingToLabel() self.accept('updateGroupStatus', self.__checkGroupStatus) self.accept('ToonBattleIdUpdate', self.__possibleGroupUpdate) - base.setCellsActive([base.leftCells[1], base.leftCells[2]], 0) + base.setCellsAvailable([base.leftCells[1], base.leftCells[2]], 0) if self.boardingParty.isGroupLeader(localAvatar.doId): - base.setCellsActive([base.leftCells[0]], 0) + base.setCellsAvailable([base.leftCells[0]], 0) self.__addTestNames(self.boardingParty.maxSize) self.guiBg.removeNode() guiButtons.removeNode() diff --git a/toontown/toon/TTEmote.py b/toontown/toon/TTEmote.py index d89a6c33..666b7d40 100755 --- a/toontown/toon/TTEmote.py +++ b/toontown/toon/TTEmote.py @@ -77,7 +77,7 @@ def doSleep(toon, volume = 1): toon.openEyes() toon.startBlink() toon.setPlayRate(1, 'neutral') - if toon.nametag.getChatText() == TTLocalizer.ToonSleepString: + if toon.nametag.getChat() == TTLocalizer.ToonSleepString: toon.clearChat() toon.lerpLookAt(Point3(0, 1, 0), time=0.25) diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index ea2f5063..6e2f2ede 100755 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -2023,9 +2023,9 @@ class Toon(Avatar.Avatar, ToonHead): self.openEyes() self.startBlink() if config.GetBool('stuck-sleep-fix', 1): - doClear = SLEEP_STRING in (self.nametag.getChatText(), self.nametag.getStompChatText()) + doClear = SLEEP_STRING in (self.nametag.getChat(), self.nametag.getStompText()) else: - doClear = self.nametag.getChatText() == SLEEP_STRING + doClear = self.nametag.getChat() == SLEEP_STRING if doClear: self.clearChat() self.lerpLookAt(Point3(0, 1, 0), time=0.25) @@ -2741,10 +2741,10 @@ class Toon(Avatar.Avatar, ToonHead): name = self.getName() suitDept = SuitDNA.suitDepts.index(SuitDNA.getSuitDept(suitType)) suitName = SuitBattleGlobals.SuitAttributes[suitType]['name'] - self.nametag.setText(TTLocalizer.SuitBaseNameWithLevel % {'name': name, + self.nametag.setDisplayName(TTLocalizer.SuitBaseNameWithLevel % {'name': name, 'dept': suitName, 'level': self.cogLevels[suitDept] + 1}) - self.nametag.setWordWrap(9.0) + self.nametag.setWordwrap(9.0) def takeOffSuit(self): if not self.isDisguised: @@ -3027,7 +3027,7 @@ class Toon(Avatar.Avatar, ToonHead): if self.headMeter: return - nodePath = NodePath(self.nametag.getIcon()) + nodePath = NodePath(self.nametag.getNameIcon()) if nodePath.isEmpty(): return @@ -3055,7 +3055,7 @@ class Toon(Avatar.Avatar, ToonHead): icons = loader.loadModel('phase_3/models/props/gm_icons') self.gmIcon = icons.find('**/access_level_%s' % access) - np = NodePath(self.nametag.getIcon()) + np = NodePath(self.nametag.getNameIcon()) if np.isEmpty() or not self.gmIcon: return @@ -3081,7 +3081,7 @@ class Toon(Avatar.Avatar, ToonHead): if self.partyHat: return - nodePath = NodePath(self.nametag.getIcon()) + nodePath = NodePath(self.nametag.getNameIcon()) if nodePath.isEmpty(): return diff --git a/toontown/toon/ToonAvatarPanel.py b/toontown/toon/ToonAvatarPanel.py index fe80f5cd..13ddc0f2 100755 --- a/toontown/toon/ToonAvatarPanel.py +++ b/toontown/toon/ToonAvatarPanel.py @@ -326,7 +326,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): self.ignoreAll() if hasattr(self.avatar, 'bFake') and self.avatar.bFake: self.avatar.delete() - base.setCellsActive([base.rightCells[0]], 1) + base.setCellsAvailable([base.rightCells[0]], 1) AvatarPanelBase.AvatarPanelBase.cleanup(self) return @@ -479,7 +479,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): self.groupButton['image'] = self.inviteImageList self.groupButton['state'] = DGG.NORMAL if base.config.GetBool('want-boarding-groups', 1): - base.setCellsActive([base.rightCells[0]], 0) + base.setCellsAvailable([base.rightCells[0]], 0) self.groupFrame.show() return diff --git a/toontown/uberdog/ClientServicesManager.py b/toontown/uberdog/ClientServicesManager.py index f2f62a83..eaec83bc 100755 --- a/toontown/uberdog/ClientServicesManager.py +++ b/toontown/uberdog/ClientServicesManager.py @@ -5,8 +5,8 @@ from panda3d.core import * from otp.distributed.PotentialAvatar import PotentialAvatar from otp.otpbase import OTPGlobals -from toontown.chat.ChatGlobals import WTSystem -from toontown.chat.WhisperPopup import WhisperPopup +from otp.nametag.NametagConstants import WTSystem +from otp.margins.WhisperPopup import WhisperPopup class ClientServicesManager(DistributedObjectGlobal): diff --git a/toontown/uberdog/DistributedPartyManager.py b/toontown/uberdog/DistributedPartyManager.py index 8e732f15..82607988 100755 --- a/toontown/uberdog/DistributedPartyManager.py +++ b/toontown/uberdog/DistributedPartyManager.py @@ -1,7 +1,7 @@ from direct.distributed.DistributedObject import DistributedObject from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal -from toontown.chat.ChatGlobals import * +from otp.nametag.NametagConstants import * from toontown.parties import PartyGlobals from toontown.toon import ToonDNA from toontown.toonbase import TTLocalizer