Some final nametag shit

This commit is contained in:
John Cote 2015-06-26 03:09:27 -04:00
parent 9b52f82419
commit 48539188de
54 changed files with 130 additions and 117 deletions

View file

@ -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()

View file

@ -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 = {

View file

@ -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)

View file

@ -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)

View file

@ -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))

View file

@ -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))

View file

@ -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))

View file

@ -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)

View file

@ -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:

View file

@ -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):

View file

@ -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):

View file

@ -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

View file

@ -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 *

View file

@ -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):

View file

@ -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

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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')

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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())

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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')

View file

@ -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())

View file

@ -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')

View file

@ -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

View file

@ -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)

View file

@ -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])

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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):

View file

@ -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()

View file

@ -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):

View file

@ -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

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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()

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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):

View file

@ -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