More nametag shit

This commit is contained in:
John Cote 2015-06-24 15:08:15 -04:00
parent 4f155b24c3
commit dab0ac32d5
11 changed files with 42 additions and 46 deletions

View file

@ -7,10 +7,10 @@ from BattleBase import *
import DistributedBattleBase import DistributedBattleBase
import SuitBattleGlobals import SuitBattleGlobals
from otp.avatar import Emote from otp.avatar import Emote
from toontown.chat.ChatGlobals import *
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.nametag import NametagGlobals
from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownBattleGlobals
from otp.nametag.NametagConstants import *
from otp.nametag import NametagGlobals
class DistributedBattle(DistributedBattleBase.DistributedBattleBase): class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
@ -119,7 +119,7 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
soundTrack = Wait(delay + faceoffTime) soundTrack = Wait(delay + faceoffTime)
mtrack = Parallel(suitTrack, toonTrack, soundTrack) mtrack = Parallel(suitTrack, toonTrack, soundTrack)
if self.hasLocalToon(): if self.hasLocalToon():
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
mtrack = Parallel(mtrack, camTrack) mtrack = Parallel(mtrack, camTrack)
done = Func(callback) done = Func(callback)
track = Sequence(mtrack, done, name=name) track = Sequence(mtrack, done, name=name)
@ -157,7 +157,7 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
self.delayDeleteMembers() self.delayDeleteMembers()
Emote.globalEmote.disableAll(base.localAvatar, 'dbattle, enterReward') Emote.globalEmote.disableAll(base.localAvatar, 'dbattle, enterReward')
if self.hasLocalToon(): if self.hasLocalToon():
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
if self.localToonActive() == 0: if self.localToonActive() == 0:
self.removeInactiveLocalToon(base.localAvatar) self.removeInactiveLocalToon(base.localAvatar)
for toon in self.toons: for toon in self.toons:
@ -188,7 +188,7 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
self.ignore('resumeAfterReward') self.ignore('resumeAfterReward')
self.movie.resetReward(finish=1) self.movie.resetReward(finish=1)
self._removeMembersKeep() self._removeMembersKeep()
NametagGlobals.setWant2dNametags(True) NametagGlobals.setMasterArrowsOn(1)
Emote.globalEmote.releaseAll(base.localAvatar, 'dbattle, exitReward') Emote.globalEmote.releaseAll(base.localAvatar, 'dbattle, exitReward')
def enterResume(self, ts = 0): def enterResume(self, ts = 0):

View file

@ -20,7 +20,8 @@ from toontown.hood import ZoneUtil
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.toon import TTEmote from toontown.toon import TTEmote
from otp.avatar import Emote from otp.avatar import Emote
from toontown.nametag import NametagGlobals from otp.nametag.NametagConstants import *
from otp.nametag import NametagGlobals
class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase): class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
@ -1039,7 +1040,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
self.notify.debug('enterLocalToonWaitForInput()') self.notify.debug('enterLocalToonWaitForInput()')
camera.setPosHpr(self.camPos, self.camHpr) camera.setPosHpr(self.camPos, self.camHpr)
base.camLens.setMinFov(self.camMenuFov/(4./3.)) base.camLens.setMinFov(self.camMenuFov/(4./3.))
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
self.townBattle.setState('Attack') self.townBattle.setState('Attack')
self.accept(self.localToonBattleEvent, self.__handleLocalToonBattleEvent) self.accept(self.localToonBattleEvent, self.__handleLocalToonBattleEvent)
@ -1205,8 +1206,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
self.notify.debug('enterPlayMovie()') self.notify.debug('enterPlayMovie()')
self.delayDeleteMembers() self.delayDeleteMembers()
if self.hasLocalToon(): if self.hasLocalToon():
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
pass
if ToontownBattleGlobals.SkipMovie: if ToontownBattleGlobals.SkipMovie:
self.movie.play(ts, self.__handleMovieDone) self.movie.play(ts, self.__handleMovieDone)
self.movie.finish() self.movie.finish()

View file

@ -10,9 +10,8 @@ import DistributedBattleBase
import MovieUtil import MovieUtil
import SuitBattleGlobals import SuitBattleGlobals
from otp.avatar import Emote from otp.avatar import Emote
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.nametag import NametagGlobals from otp.nametag import NametagGlobals
from toontown.nametag.NametagGlobals import *
from toontown.suit import Suit from toontown.suit import Suit
from toontown.suit import SuitDNA from toontown.suit import SuitDNA
from toontown.toon import TTEmote from toontown.toon import TTEmote
@ -189,15 +188,14 @@ class DistributedBattleBldg(DistributedBattleBase.DistributedBattleBase):
self.notify.debug('exitReward()') self.notify.debug('exitReward()')
self.clearInterval(self.uniqueName('floorReward')) self.clearInterval(self.uniqueName('floorReward'))
self._removeMembersKeep() self._removeMembersKeep()
NametagGlobals.setWant2dNametags(True) NametagGlobals.setMasterArrowsOn(1)
for toon in self.toons: for toon in self.toons:
toon.startSmooth() toon.startSmooth()
def enterBuildingReward(self, ts): def enterBuildingReward(self, ts):
self.delayDeleteMembers() self.delayDeleteMembers()
if self.hasLocalToon(): if self.hasLocalToon():
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
pass
self.movie.playReward(ts, self.uniqueName('building-reward'), self.__handleBuildingRewardDone, noSkip=True) self.movie.playReward(ts, self.uniqueName('building-reward'), self.__handleBuildingRewardDone, noSkip=True)
def __handleBuildingRewardDone(self): def __handleBuildingRewardDone(self):
@ -209,7 +207,7 @@ class DistributedBattleBldg(DistributedBattleBase.DistributedBattleBase):
def exitBuildingReward(self): def exitBuildingReward(self):
self.movie.resetReward(finish=1) self.movie.resetReward(finish=1)
self._removeMembersKeep() self._removeMembersKeep()
NametagGlobals.setWant2dNametags(True) NametagGlobals.setMasterArrowsOn(1)
def enterResume(self, ts=0): def enterResume(self, ts=0):
if self.hasLocalToon(): if self.hasLocalToon():

View file

@ -10,7 +10,8 @@ import DistributedBattleBase
import MovieUtil import MovieUtil
import SuitBattleGlobals import SuitBattleGlobals
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.nametag import NametagGlobals from otp.nametag.NametagConstants import *
from otp.nametag import NametagGlobals
from toontown.suit import Suit from toontown.suit import Suit
from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownBattleGlobals
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
@ -157,7 +158,7 @@ class DistributedBattleFinal(DistributedBattleBase.DistributedBattleBase):
self.notify.debug('exitReward()') self.notify.debug('exitReward()')
self.clearInterval(self.uniqueName('floorReward'), finish=1) self.clearInterval(self.uniqueName('floorReward'), finish=1)
self._removeMembersKeep() self._removeMembersKeep()
NametagGlobals.setWant2dNametags(True) NametagGlobals.setMasterArrowsOn(1)
for toon in self.toons: for toon in self.toons:
toon.startSmooth() toon.startSmooth()

View file

@ -24,7 +24,6 @@ import MovieUtil
import PlayByPlayText import PlayByPlayText
import RewardPanel import RewardPanel
from SuitBattleGlobals import * from SuitBattleGlobals import *
from toontown.chat.ChatGlobals import *
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.toon import NPCToons from toontown.toon import NPCToons
from toontown.toon import Toon from toontown.toon import Toon
@ -32,7 +31,8 @@ from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toonbase.ToontownBattleGlobals import * from toontown.toonbase.ToontownBattleGlobals import *
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
from toontown.nametag import NametagGlobals from otp.nametag.NametagConstants import *
from otp.nametag.NametagGroup import *
camPos = Point3(14, 0, 10) camPos = Point3(14, 0, 10)
@ -342,7 +342,7 @@ class Movie(DirectObject.DirectObject):
self.tutorialTom.setDNA(dna) self.tutorialTom.setDNA(dna)
self.tutorialTom.setName(TTLocalizer.NPCToonNames[20000]) self.tutorialTom.setName(TTLocalizer.NPCToonNames[20000])
self.tutorialTom.setPickable(0) self.tutorialTom.setPickable(0)
self.tutorialTom.setPlayerType(NametagGlobals.CCNonPlayer) self.tutorialTom.setPlayerType(NametagGroup.CCNonPlayer)
self.tutorialTom.uniqueName = uniqueName self.tutorialTom.uniqueName = uniqueName
self.musicVolume = 0.9 self.musicVolume = 0.9
music = base.cr.playGame.place.loader.battleMusic music = base.cr.playGame.place.loader.battleMusic

View file

@ -7,8 +7,8 @@ from BattleProps import *
from BattleSounds import * from BattleSounds import *
import MovieCamera import MovieCamera
import MovieUtil import MovieUtil
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.nametag.NametagGlobals import * from otp.nametag import NametagGlobals
from toontown.toon import NPCToons from toontown.toon import NPCToons
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownBattleGlobals

View file

@ -3,8 +3,8 @@ from direct.interval.IntervalGlobal import *
from panda3d.core import * from panda3d.core import *
import MovieCamera import MovieCamera
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.nametag.NametagGlobals import * from otp.nametag import NametagGlobals
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer

View file

@ -10,9 +10,8 @@ from BattleSounds import *
import MovieCamera import MovieCamera
import MovieUtil import MovieUtil
from SuitBattleGlobals import * from SuitBattleGlobals import *
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.nametag import NametagGlobals from otp.nametag import NametagGlobals
from toontown.nametag.NametagGlobals import *
from toontown.suit.SuitDNA import * from toontown.suit.SuitDNA import *
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals

View file

@ -9,7 +9,8 @@ import DistributedToonInterior
from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs
from toontown.hood import Place from toontown.hood import Place
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
from toontown.nametag import NametagGlobals from otp.nametag.NametagConstants import *
from otp.nametag import NametagGlobals
from toontown.toon import HealthForceAcknowledge from toontown.toon import HealthForceAcknowledge
from toontown.toon import NPCForceAcknowledge from toontown.toon import NPCForceAcknowledge
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
@ -92,7 +93,7 @@ class ToonInterior(Place.Place):
volume = requestStatus.get('musicVolume', 0.7) volume = requestStatus.get('musicVolume', 0.7)
base.playMusic(self.loader.activityMusic, looping=1, volume=volume) base.playMusic(self.loader.activityMusic, looping=1, volume=volume)
self._telemLimiter = TLGatherAllAvs('ToonInterior', RotationLimitToH) self._telemLimiter = TLGatherAllAvs('ToonInterior', RotationLimitToH)
NametagGlobals.setWant2dNametags(True) NametagGlobals.setMasterArrowsOn(1)
self.fsm.request(requestStatus['how'], [requestStatus]) self.fsm.request(requestStatus['how'], [requestStatus])
def exit(self): def exit(self):
@ -100,7 +101,7 @@ class ToonInterior(Place.Place):
messenger.send('exitToonInterior') messenger.send('exitToonInterior')
self._telemLimiter.destroy() self._telemLimiter.destroy()
del self._telemLimiter del self._telemLimiter
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
self.loader.activityMusic.stop() self.loader.activityMusic.stop()
def setState(self, state): def setState(self, state):

View file

@ -6,8 +6,8 @@ from direct.task.Task import Task
import MinigameGlobals import MinigameGlobals
from PurchaseBase import * from PurchaseBase import *
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.nametag import NametagGlobals from otp.nametag.NametagFloat2d import *
from toontown.nametag.NametagFloat2d import * from otp.nametag import NametagGlobals
from toontown.toon import ToonHead from toontown.toon import ToonHead
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownTimer from toontown.toonbase import ToontownTimer
@ -304,7 +304,7 @@ class Purchase(PurchaseBase):
floorNode = CollisionNode('collision_floor') floorNode = CollisionNode('collision_floor')
floorNode.addSolid(floor) floorNode.addSolid(floor)
self.collisionFloor = render.attachNewNode(floorNode) self.collisionFloor = render.attachNewNode(floorNode)
NametagGlobals.setForceOnscreenChat(True) NametagGlobals.setOnscreenChatForced(1)
for index in xrange(len(self.ids)): for index in xrange(len(self.ids)):
avId = self.ids[index] avId = self.ids[index]
if self.states[index] != PURCHASE_NO_CLIENT_STATE and self.states[index] != PURCHASE_DISCONNECTED_STATE and avId in base.cr.doId2do: if self.states[index] != PURCHASE_NO_CLIENT_STATE and self.states[index] != PURCHASE_DISCONNECTED_STATE and avId in base.cr.doId2do:
@ -511,7 +511,7 @@ class Purchase(PurchaseBase):
self.title.reparentTo(self.frame) self.title.reparentTo(self.frame)
self.rewardDoubledJellybeanLabel.hide() self.rewardDoubledJellybeanLabel.hide()
base.camLens.setMinFov(settings['fov']/(4./3.)) base.camLens.setMinFov(settings['fov']/(4./3.))
NametagGlobals.setForceOnscreenChat(False) NametagGlobals.setOnscreenChatForced(0)
def _handleClientCleanup(self): def _handleClientCleanup(self):
if hasattr(self, 'toonsKeep'): if hasattr(self, 'toonsKeep'):
@ -626,16 +626,13 @@ class PurchaseHeadFrame(DirectFrame):
self.headModel.setupHead(self.av.style, forGui=1) self.headModel.setupHead(self.av.style, forGui=1)
self.headModel.reparentTo(self.head) self.headModel.reparentTo(self.head)
self.tag2Node = NametagFloat2d() self.tag2Node = NametagFloat2d()
self.tag2Node.hideChat() self.tag2Node.setContents(Nametag.CName)
self.tag2Node.hideThought() self.av.nametag.addNametag(self.tag2Node)
self.tag2Node.update()
self.av.nametag.add(self.tag2Node)
self.tag2 = self.attachNewNode(self.tag2Node) self.tag2 = self.attachNewNode(self.tag2Node)
self.tag2.setPosHprScale(-0.22, 10.0, 0.12, 0, 0, 0, 0.046, 0.046, 0.046) self.tag2.setPosHprScale(-0.22, 10.0, 0.12, 0, 0, 0, 0.046, 0.046, 0.046)
self.tag1Node = NametagFloat2d() self.tag1Node = NametagFloat2d()
self.tag1Node.hideNametag() self.tag1Node.setContents(Nametag.CSpeech | Nametag.CThought)
self.tag1Node.update() self.av.nametag.addNametag(self.tag1Node)
self.av.nametag.add(self.tag1Node)
self.tag1 = self.attachNewNode(self.tag1Node) self.tag1 = self.attachNewNode(self.tag1Node)
self.tag1.setPosHprScale(-0.15, 0, -0.1, 0, 0, 0, 0.046, 0.046, 0.046) self.tag1.setPosHprScale(-0.15, 0, -0.1, 0, 0, 0, 0.046, 0.046, 0.046)
self.hide() self.hide()
@ -647,8 +644,8 @@ class PurchaseHeadFrame(DirectFrame):
del self.headModel del self.headModel
self.head.removeNode() self.head.removeNode()
del self.head del self.head
self.av.nametag.remove(self.tag1Node) self.av.nametag.removeNametag(self.tag1Node)
self.av.nametag.remove(self.tag2Node) self.av.nametag.removeNametag(self.tag2Node)
self.tag1.removeNode() self.tag1.removeNode()
self.tag2.removeNode() self.tag2.removeNode()
del self.tag1 del self.tag1

View file

@ -9,7 +9,7 @@ import random
import DistributedToon import DistributedToon
import NPCToons import NPCToons
from toontown.nametag import NametagGlobals from otp.nametag.NametagGroup import NametagGroup
from toontown.quest import QuestChoiceGui from toontown.quest import QuestChoiceGui
from toontown.quest import QuestParser from toontown.quest import QuestParser
from toontown.quest import Quests from toontown.quest import Quests
@ -26,7 +26,7 @@ class DistributedNPCToonBase(DistributedToon.DistributedToon):
DistributedToon.DistributedToon.__init__(self, cr) DistributedToon.DistributedToon.__init__(self, cr)
self.__initCollisions() self.__initCollisions()
self.setPickable(0) self.setPickable(0)
self.setPlayerType(NametagGlobals.CCNonPlayer) self.setPlayerType(NametagGroup.CCNonPlayer)
def disable(self): def disable(self):
self.ignore('enter' + self.cSphereNode.getName()) self.ignore('enter' + self.cSphereNode.getName())