More work

This commit is contained in:
John Cote 2015-06-24 14:09:51 -04:00
parent c568a632f1
commit fa24711bc8
4 changed files with 31 additions and 42 deletions

View file

@ -14,7 +14,7 @@ from toontown.toonbase import ToontownGlobals
from toontown.toon import Toon from toontown.toon import Toon
import FriendHandle import FriendHandle
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from toontown.nametag import NametagGlobals from otp.nametag import NametagGlobals
class FriendsListManager: class FriendsListManager:
notify = DirectNotifyGlobal.directNotify.newCategory('FriendsListManager') notify = DirectNotifyGlobal.directNotify.newCategory('FriendsListManager')
@ -47,7 +47,7 @@ class FriendsListManager:
self.accept('openFriendsList', self.__openFriendsList) self.accept('openFriendsList', self.__openFriendsList)
self.accept('clickedNametag', self.__handleClickedNametag) self.accept('clickedNametag', self.__handleClickedNametag)
base.localAvatar.setFriendsListButtonActive(1) base.localAvatar.setFriendsListButtonActive(1)
NametagGlobals.setWantActiveNametags(True) NametagGlobals.setMasterNametagsActive(1)
self.accept('gotoAvatar', self.__handleGotoAvatar) self.accept('gotoAvatar', self.__handleGotoAvatar)
self.accept('friendAvatar', self.__handleFriendAvatar) self.accept('friendAvatar', self.__handleFriendAvatar)
self.accept('avatarDetails', self.__handleAvatarDetails) self.accept('avatarDetails', self.__handleAvatarDetails)
@ -65,7 +65,7 @@ class FriendsListManager:
self.ignore('openFriendsList') self.ignore('openFriendsList')
self.ignore('clickedNametag') self.ignore('clickedNametag')
base.localAvatar.setFriendsListButtonActive(0) base.localAvatar.setFriendsListButtonActive(0)
NametagGlobals.setWantActiveNametags(False) NametagGlobals.setMasterNametagsActive(0)
if self.avatarPanel: if self.avatarPanel:
self.avatarPanel.cleanup() self.avatarPanel.cleanup()
self.avatarPanel = None self.avatarPanel = None

View file

@ -8,14 +8,12 @@ from direct.gui.DirectGui import DirectFrame, DirectButton, DirectLabel, DirectS
from direct.showbase import DirectObject from direct.showbase import DirectObject
from direct.showbase import PythonUtil from direct.showbase import PythonUtil
from panda3d.core import * from panda3d.core import *
from pandac.PandaModules import Vec3, Vec4, Point3, TextNode, VBase4
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer from otp.otpbase import OTPLocalizer
from toontown.nametag.Nametag import Nametag from otp.nametag.NametagGroup import NametagGroup
from toontown.nametag.NametagFloat2d import * from otp.nametag.Nametag import Nametag
from toontown.nametag import NametagGlobals from otp.nametag.NametagFloat2d import *
from toontown.nametag.NametagGroup import NametagGroup
from toontown.parties import PartyGlobals from toontown.parties import PartyGlobals
from toontown.parties import PartyUtils from toontown.parties import PartyUtils
from toontown.parties.CalendarGuiMonth import CalendarGuiMonth from toontown.parties.CalendarGuiMonth import CalendarGuiMonth
@ -278,41 +276,33 @@ class PartyPlanner(DirectFrame, FSM):
def __createNametag(self, parent): def __createNametag(self, parent):
if self.nametagGroup == None: if self.nametagGroup == None:
self.nametagGroup = NametagGroup() self.nametagGroup = NametagGroup()
interfaceFont = OTPGlobals.getInterfaceFont() self.nametagGroup.setFont(ToontownGlobals.getToonFont())
self.nametagGroup.setFont(interfaceFont) self.nametagGroup.setSpeechFont(ToontownGlobals.getToonFont())
self.nametagGroup.setChatFont(interfaceFont) self.nametagGroup.setActive(0)
self.nametagGroup.setActive(False)
self.nametagGroup.setAvatar(self.partyPlannerHead) self.nametagGroup.setAvatar(self.partyPlannerHead)
self.nametagGroup.manage(base.marginManager) self.nametagGroup.manage(base.marginManager)
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCNonPlayer] self.nametagGroup.setColorCode(self.nametagGroup.CCNonPlayer)
self.nametagGroup.setNametagColor(nametagColor) self.nametagGroup.getNametag2d().setContents(0)
chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNonPlayer]
self.nametagGroup.setChatColor(chatColor)
nametag2d = self.nametagGroup.getNametag2d()
nametag2d.hideNametag()
nametag2d.hideChat()
self.nametagNode = NametagFloat2d() self.nametagNode = NametagFloat2d()
self.nametagNode.hideChat() self.nametagNode.setContents(Nametag.CName)
self.nametagGroup.add(self.nametagNode) self.nametagGroup.addNametag(self.nametagNode)
self.nametagGroup.setText(base.cr.partyManager.getPartyPlannerName()) self.nametagGroup.setName(base.cr.partyManager.getPartyPlannerName())
self.nametagNP = parent.attachNewNode(self.nametagNode) self.nametagNP = parent.attachNewNode(self.nametagNode)
nametagPos = self.gui.find('**/step_01_partymanPeteNametag_locator').getPos() nametagPos = self.gui.find('**/step_01_partymanPeteNametag_locator').getPos()
self.nametagNP.setPosHprScale(nametagPos[0], 0, nametagPos[2], 0, 0, 0, 0.1, 1, 0.1) self.nametagNP.setPosHprScale(nametagPos[0], 0, nametagPos[2], 0, 0, 0, 0.1, 1, 0.1)
self.chatNode = NametagFloat2d() self.chatNode = NametagFloat2d()
self.chatNode.hideNametag() self.chatNode.setContents(Nametag.CSpeech | Nametag.CThought)
self.chatNode.showThought() self.nametagGroup.addNametag(self.chatNode)
self.nametagGroup.add(self.chatNode) self.nametagGroup.setChat(TTLocalizer.PartyPlannerInstructions, CFSpeech)
self.nametagGroup.setChatText(TTLocalizer.PartyPlannerInstructions)
self.chatNP = parent.attachNewNode(self.chatNode) self.chatNP = parent.attachNewNode(self.chatNode)
chatPos = self.gui.find('**/step_01_partymanPeteText_locator').getPos() chatPos = self.gui.find('**/step_01_partymanPeteText_locator').getPos()
self.chatNP.setPosHprScale(chatPos[0], 0, chatPos[2], 0, 0, 0, 0.08, 1, 0.08) self.chatNP.setPosHprScale(chatPos[0], 0, chatPos[2], 0, 0, 0, 0.08, 1, 0.08)
self.nametagGroup.updateAll()
def clearNametag(self): def clearNametag(self):
if self.nametagGroup != None: if self.nametagGroup != None:
self.nametagGroup.unmanage(base.marginManager) self.nametagGroup.unmanage(base.marginManager)
self.nametagGroup.remove(self.nametagNode) self.nametagGroup.removeNametag(self.nametagNode)
self.nametagGroup.remove(self.chatNode) self.nametagGroup.removeNametag(self.chatNode)
self.nametagNP.removeNode() self.nametagNP.removeNode()
self.chatNP.removeNode() self.chatNP.removeNode()
del self.nametagNP del self.nametagNP
@ -690,7 +680,7 @@ class PartyPlanner(DirectFrame, FSM):
goingBackAllowed = False goingBackAllowed = False
self.confirmTitleLabel['text'] = TTLocalizer.PartyPlannerConfirmationErrorTitle self.confirmTitleLabel['text'] = TTLocalizer.PartyPlannerConfirmationErrorTitle
confirmRecapText = TTLocalizer.PartyPlannerConfirmationTooManyText confirmRecapText = TTLocalizer.PartyPlannerConfirmationTooManyText
self.nametagGroup.setChatText(confirmRecapText) self.nametagGroup.setChat(confirmRecapText, CFSpeech)
self.request('Farewell', goingBackAllowed) self.request('Farewell', goingBackAllowed)
def __acceptExit(self): def __acceptExit(self):

View file

@ -3,8 +3,8 @@ from panda3d.core import *
import ToonHead import ToonHead
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.nametag.Nametag import Nametag from otp.nametag.Nametag import Nametag
from toontown.nametag.NametagFloat2d import NametagFloat2d from otp.nametag.NametagFloat2d import NametagFloat2d
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
@ -22,14 +22,13 @@ class ToonHeadFrame(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.tag1Node = NametagFloat2d() self.tag1Node = NametagFloat2d()
self.tag1Node.hideNametag() self.tag1Node.setContents(Nametag.CSpeech | Nametag.CThought)
self.tag1Node.showThought() 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.16, 0, -0.09, 0, 0, 0, 0.055, 0.055, 0.055) self.tag1.setPosHprScale(-0.16, 0, -0.09, 0, 0, 0, 0.055, 0.055, 0.055)
self.tag2Node = NametagFloat2d() self.tag2Node = NametagFloat2d()
self.tag2Node.hideChat() self.tag2Node.setContents(Nametag.CName)
self.av.nametag.add(self.tag2Node) self.av.nametag.addNametag(self.tag2Node)
self.tag2 = self.attachNewNode(self.tag2Node) self.tag2 = self.attachNewNode(self.tag2Node)
self.tag2.setPosHprScale(-0.27, 10.0, 0.16, 0, 0, 0, 0.05, 0.05, 0.05) self.tag2.setPosHprScale(-0.27, 10.0, 0.16, 0, 0, 0, 0.05, 0.05, 0.05)
self.extraData = DirectLabel(parent=self, relief=None, pos=(0.0, 0.0, 0.06), scale=1.0, text='', text0_fg=(0.3, 0.2, 1, 1), text_scale=(0.14, 0.06), text_pos=(0, -0.01)) self.extraData = DirectLabel(parent=self, relief=None, pos=(0.0, 0.0, 0.06), scale=1.0, text='', text0_fg=(0.3, 0.2, 1, 1), text_scale=(0.14, 0.06), text_pos=(0, -0.01))
@ -42,8 +41,8 @@ class ToonHeadFrame(DirectFrame):
self.head.removeNode() self.head.removeNode()
del self.head del self.head
if not self.av.isEmpty(): if not self.av.isEmpty():
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

@ -19,7 +19,7 @@ from toontown.toon.Toon import teleportDebug
from toontown.estate import HouseGlobals from toontown.estate import HouseGlobals
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from direct.interval.IntervalGlobal import * from direct.interval.IntervalGlobal import *
from toontown.nametag import NametagGlobals from otp.nametag import NametagGlobals
visualizeZones = base.config.GetBool('visualize-zones', 0) visualizeZones = base.config.GetBool('visualize-zones', 0)
@ -104,7 +104,7 @@ class Street(BattlePlace.BattlePlace):
base.localAvatar.setGeom(self.loader.geom) base.localAvatar.setGeom(self.loader.geom)
base.localAvatar.setOnLevelGround(1) base.localAvatar.setOnLevelGround(1)
self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH) self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH)
NametagGlobals.setWant2dNametags(arrowsOn) NametagGlobals.setMasterArrowsOn(arrowsOn)
self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId']) self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId'])
def __lightDecorationOn__(): def __lightDecorationOn__():
@ -147,7 +147,7 @@ class Street(BattlePlace.BattlePlace):
light.reparentTo(hidden) light.reparentTo(hidden)
newsManager = base.cr.newsManager newsManager = base.cr.newsManager
NametagGlobals.setWant2dNametags(False) NametagGlobals.setMasterArrowsOn(0)
self.loader.hood.stopSky() self.loader.hood.stopSky()
self.loader.music.stop() self.loader.music.stop()
base.localAvatar.setGeom(render) base.localAvatar.setGeom(render)