mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
spawn title text on camera entering zone, not toon
This commit is contained in:
parent
5b7bf31d59
commit
34c98d8910
@ -31,6 +31,7 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||||||
DistributedObject.DistributedObject.__init__(self, cr)
|
DistributedObject.DistributedObject.__init__(self, cr)
|
||||||
Level.Level.__init__(self)
|
Level.Level.__init__(self)
|
||||||
self.lastToonZone = 0
|
self.lastToonZone = 0
|
||||||
|
self.lastCamZone = 0
|
||||||
self.titleColor = (1,1,1,1)
|
self.titleColor = (1,1,1,1)
|
||||||
self.titleText = OnscreenText.OnscreenText(
|
self.titleText = OnscreenText.OnscreenText(
|
||||||
"",
|
"",
|
||||||
@ -423,13 +424,16 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||||||
self.lastToonZone = zoneNum
|
self.lastToonZone = zoneNum
|
||||||
print "toon is standing in zone %s" % zoneNum
|
print "toon is standing in zone %s" % zoneNum
|
||||||
messenger.send("factoryZoneChanged", [zoneNum])
|
messenger.send("factoryZoneChanged", [zoneNum])
|
||||||
self.smallTitleText.hide()
|
|
||||||
self.spawnTitleText()
|
|
||||||
|
|
||||||
def camEnterZone(self, zoneNum):
|
def camEnterZone(self, zoneNum):
|
||||||
DistributedLevel.notify.debug('camEnterZone%s' % zoneNum)
|
DistributedLevel.notify.debug('camEnterZone%s' % zoneNum)
|
||||||
self.enterZone(zoneNum)
|
self.enterZone(zoneNum)
|
||||||
|
|
||||||
|
if zoneNum != self.lastCamZone:
|
||||||
|
self.lastCamZone = zoneNum
|
||||||
|
self.smallTitleText.hide()
|
||||||
|
self.spawnTitleText()
|
||||||
|
|
||||||
def enterZone(self, zoneNum):
|
def enterZone(self, zoneNum):
|
||||||
DistributedLevel.notify.debug("entering zone %s" % zoneNum)
|
DistributedLevel.notify.debug("entering zone %s" % zoneNum)
|
||||||
|
|
||||||
@ -541,7 +545,7 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||||||
return ent.description
|
return ent.description
|
||||||
return None
|
return None
|
||||||
|
|
||||||
description = getDescription(self.lastToonZone)
|
description = getDescription(self.lastCamZone)
|
||||||
if description and description != '':
|
if description and description != '':
|
||||||
taskMgr.remove("titleText")
|
taskMgr.remove("titleText")
|
||||||
self.smallTitleText.setText(description)
|
self.smallTitleText.setText(description)
|
||||||
@ -553,8 +557,8 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||||||
# If we've already seen it, just show the small title
|
# If we've already seen it, just show the small title
|
||||||
|
|
||||||
titleSeq = None
|
titleSeq = None
|
||||||
if not self.lastToonZone in self.zonesEnteredList:
|
if not self.lastCamZone in self.zonesEnteredList:
|
||||||
self.zonesEnteredList.append(self.lastToonZone)
|
self.zonesEnteredList.append(self.lastCamZone)
|
||||||
titleSeq = Task.sequence(
|
titleSeq = Task.sequence(
|
||||||
Task.Task(self.hideSmallTitleTextTask),
|
Task.Task(self.hideSmallTitleTextTask),
|
||||||
Task.Task(self.showTitleTextTask),
|
Task.Task(self.showTitleTextTask),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user