More work

This commit is contained in:
John Cote 2015-06-25 14:51:27 -04:00
parent ac15b0e4b5
commit e8a57d7251
4 changed files with 28 additions and 35 deletions

View file

@ -6,7 +6,8 @@ import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import types
notify = DirectNotifyGlobal.directNotify.newCategory('MovieToonVictory')
from toontown.nametag import NametagGlobals
from otp.nametag.NametagConstants import *
from otp.nametag import NametagGlobals
def __findToonReward(rewards, toon):
for r in rewards:
@ -76,7 +77,7 @@ def doToonVictory(localToonActive, toons, rewardToonIds, rewardDicts, deathList,
track = Sequence()
if localToonActive == 1:
track.append(Func(rpanel.show))
track.append(Func(NametagGlobals.setForceOnscreenChat, True))
track.append(Func(NametagGlobals.setOnscreenChatForced, 1))
camTrack = Sequence()
endTrack = Sequence()
danceSound = globalBattleSoundCache.getSound('ENC_Win.ogg')
@ -121,7 +122,7 @@ def doToonVictory(localToonActive, toons, rewardToonIds, rewardDicts, deathList,
track.append(Func(skipper.destroy))
if localToonActive == 1:
track.append(Func(rpanel.hide))
track.append(Func(NametagGlobals.setForceOnscreenChat, False))
track.append(Func(NametagGlobals.setOnscreenChatForced, 0))
track.append(endTrack)
trackdur = track.getDuration()
soundTrack = SoundInterval(danceSound, duration=trackdur, loop=1)

View file

@ -13,8 +13,8 @@ from toontown.hood import ZoneUtil
from toontown.suit import Suit
from toontown.toonbase.ToonBaseGlobal import *
from toontown.toontowngui import TTDialog
from toontown.nametag.NametagGroup import NametagGroup
from toontown.nametag.Nametag import Nametag
from otp.nametag.NametagGroup import NametagGroup
from otp.nametag.Nametag import Nametag
class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
@ -105,25 +105,23 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
return
if self.nametag == None:
self.nametag = NametagGroup()
self.nametag.setNametag3d(None)
self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
if TTLocalizer.BuildingNametagShadow:
self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
self.nametag.hideChat()
self.nametag.hideThought()
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCToonBuilding]
self.nametag.setNametagColor(nametagColor)
self.nametag.setActive(False)
self.nametag.setContents(Nametag.CName)
self.nametag.setColorCode(NametagGroup.CCToonBuilding)
self.nametag.setActive(0)
self.nametag.setAvatar(self.getDoorNodePath())
name = self.cr.playGame.dnaStore.getTitleFromBlockNumber(self.block)
self.nametag.setText(name)
self.nametag.setObjectCode(self.block)
name = self.cr.playGame.dnaData.getBlock(self.block).title
self.nametag.setName(name)
self.nametag.manage(base.marginManager)
self.nametag.updateAll()
def clearNametag(self):
if self.nametag is not None:
self.nametag.unmanage(base.marginManager)
self.nametag.setAvatar(NodePath())
self.nametag.destroy()
self.nametag = None
def getTriggerName(self):

View file

@ -9,9 +9,9 @@ import DistributedElevator
from ElevatorConstants import *
from ElevatorUtils import *
from toontown.hood import ZoneUtil
from toontown.nametag import NametagGlobals
from toontown.nametag.Nametag import Nametag
from toontown.nametag.NametagGroup import NametagGroup
from otp.nametag.NametagGroup import NametagGroup
from otp.nametag.Nametag import Nametag
from otp.nametag.NametagConstants import *
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
@ -41,20 +41,17 @@ class DistributedElevatorExt(DistributedElevator.DistributedElevator):
self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
if TTLocalizer.BuildingNametagShadow:
self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
self.nametag.hideChat()
self.nametag.hideThought()
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCSuitBuilding]
self.nametag.setNametagColor(nametagColor)
self.nametag.setActive(False)
self.nametag.setContents(Nametag.CName)
self.nametag.setColorCode(NametagGroup.CCSuitBuilding)
self.nametag.setActive(0)
self.nametag.setAvatar(self.getElevatorModel())
name = self.cr.playGame.dnaStore.getTitleFromBlockNumber(self.bldg.block)
if not name:
name = TTLocalizer.CogsInc
else:
name += TTLocalizer.CogsIncExt
self.nametag.setText(name)
self.nametag.setName(name)
self.nametag.manage(base.marginManager)
self.nametag.updateAll()
def clearNametag(self):
if self.nametag != None:

View file

@ -5,12 +5,11 @@ from panda3d.core import *
import DistributedAnimatedProp
from KnockKnockJokes import *
from toontown.chat.ChatGlobals import *
from toontown.distributed import DelayDelete
from toontown.nametag.NametagGlobals import *
from toontown.nametag.NametagGroup import NametagGroup
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from otp.nametag.NametagGroup import NametagGroup
from otp.nametag.NametagConstants import *
import random
class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp):
@ -76,21 +75,19 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp)
return
self.nametag = NametagGroup()
self.nametag.setAvatar(doorNP)
toonFont = ToontownGlobals.getToonFont()
self.nametag.setFont(toonFont)
self.nametag.setChatFont(toonFont)
self.nametag.setText(doorName)
self.nametag.setActive(False)
self.nametag.hideNametag()
self.nametag.setFont(ToontownGlobals.getToonFont())
self.nametag.setSpeechFont(ToontownGlobals.getToonFont())
self.nametag.setName(doorName)
self.nametag.setActive(0)
self.nametag.manage(base.marginManager)
self.nametag.getNametag3d().setBillboardOffset(6)
self.nametag.getNametag3d().setBillboardOffset(4)
nametagNode = self.nametag.getNametag3d()
self.nametagNP = render.attachNewNode(nametagNode)
self.nametagNP.setName('knockKnockDoor_nt_' + str(self.propId))
pos = doorNP.getBounds().getCenter()
self.nametagNP.setPos(pos + Vec3(0, 0, avatar.getHeight() + 2))
d = duration * 0.125
track = Sequence(Parallel(Sequence(Wait(d * 0.5), SoundInterval(self.knockSfx)), Func(self.nametag.setChatText, TTLocalizer.DoorKnockKnock), Wait(d)), Func(avatar.setChatAbsolute, TTLocalizer.DoorWhosThere, CFSpeech | CFTimeout, openEnded=0), Wait(d), Func(self.nametag.setChatText, joke[0]), Wait(d), Func(avatar.setChatAbsolute, joke[0] + TTLocalizer.DoorWhoAppendix, CFSpeech | CFTimeout, openEnded=0), Wait(d), Func(self.nametag.setChatText, joke[1]), Parallel(SoundInterval(self.rimshot, startTime=2.0), Wait(d * 4)), Func(self.cleanupTrack))
track = Sequence(Parallel(Sequence(Wait(d * 0.5), SoundInterval(self.knockSfx)), Func(self.nametag.setChat, TTLocalizer.DoorKnockKnock, CFSpeech), Wait(d)), Func(avatar.setChatAbsolute, TTLocalizer.DoorWhosThere, CFSpeech | CFTimeout, openEnded=0), Wait(d), Func(self.nametag.setChat, joke[0], CFSpeech), Wait(d), Func(avatar.setChatAbsolute, joke[0] + TTLocalizer.DoorWhoAppendix, CFSpeech | CFTimeout, openEnded=0), Wait(d), Func(self.nametag.setChat, joke[1], CFSpeech), Parallel(SoundInterval(self.rimshot, startTime=2.0), Wait(d * 4)), Func(self.cleanupTrack))
track.delayDelete = DelayDelete.DelayDelete(avatar, 'knockKnockTrack')
return track