coghq: you can now enter the factory
This commit is contained in:
parent
f73eb9eb84
commit
80bda9a9ec
2 changed files with 23 additions and 19 deletions
|
@ -32,6 +32,7 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
||||||
self.titleColor = (1, 1, 1, 1)
|
self.titleColor = (1, 1, 1, 1)
|
||||||
self.titleText = OnscreenText.OnscreenText('', fg=self.titleColor, shadow=(0, 0, 0, 1), font=ToontownGlobals.getSuitFont(), pos=(0, -0.5), scale=0.16, drawOrder=0, mayChange=1)
|
self.titleText = OnscreenText.OnscreenText('', fg=self.titleColor, shadow=(0, 0, 0, 1), font=ToontownGlobals.getSuitFont(), pos=(0, -0.5), scale=0.16, drawOrder=0, mayChange=1)
|
||||||
self.smallTitleText = OnscreenText.OnscreenText('', fg=self.titleColor, font=ToontownGlobals.getSuitFont(), pos=(0.65, 0.9), scale=0.08, drawOrder=0, mayChange=1, bg=(0.5, 0.5, 0.5, 0.5), align=TextNode.ARight)
|
self.smallTitleText = OnscreenText.OnscreenText('', fg=self.titleColor, font=ToontownGlobals.getSuitFont(), pos=(0.65, 0.9), scale=0.08, drawOrder=0, mayChange=1, bg=(0.5, 0.5, 0.5, 0.5), align=TextNode.ARight)
|
||||||
|
self.titleTextSeq = None
|
||||||
self.zonesEnteredList = []
|
self.zonesEnteredList = []
|
||||||
self.fColorZones = 0
|
self.fColorZones = 0
|
||||||
self.scenarioIndex = 0
|
self.scenarioIndex = 0
|
||||||
|
@ -221,7 +222,9 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
||||||
self.shutdownVisibility()
|
self.shutdownVisibility()
|
||||||
self.destroyLevel()
|
self.destroyLevel()
|
||||||
self.ignoreAll()
|
self.ignoreAll()
|
||||||
taskMgr.remove(self.uniqueName('titleText'))
|
if self.titleTextSeq:
|
||||||
|
self.titleTextSeq.finish()
|
||||||
|
self.titleTextSeq = None
|
||||||
if self.smallTitleText:
|
if self.smallTitleText:
|
||||||
self.smallTitleText.cleanup()
|
self.smallTitleText.cleanup()
|
||||||
self.smallTitleText = None
|
self.smallTitleText = None
|
||||||
|
@ -482,7 +485,9 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
||||||
|
|
||||||
description = getDescription(self.lastCamZone)
|
description = getDescription(self.lastCamZone)
|
||||||
if description and description != '':
|
if description and description != '':
|
||||||
taskMgr.remove(self.uniqueName('titleText'))
|
if self.titleTextSeq:
|
||||||
|
self.titleTextSeq.finish()
|
||||||
|
self.titleTextSeq = None
|
||||||
self.smallTitleText.setText(description)
|
self.smallTitleText.setText(description)
|
||||||
self.titleText.setText(description)
|
self.titleText.setText(description)
|
||||||
self.titleText.setColor(Vec4(*self.titleColor))
|
self.titleText.setColor(Vec4(*self.titleColor))
|
||||||
|
@ -490,49 +495,47 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
||||||
titleSeq = None
|
titleSeq = None
|
||||||
if self.lastCamZone not in self.zonesEnteredList:
|
if self.lastCamZone not in self.zonesEnteredList:
|
||||||
self.zonesEnteredList.append(self.lastCamZone)
|
self.zonesEnteredList.append(self.lastCamZone)
|
||||||
titleSeq = Task.sequence(Task.Task(self.hideSmallTitleTextTask), Task.Task(self.showTitleTextTask), Task.pause(0.1), Task.pause(6.0), self.titleText.lerpColor(Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], self.titleColor[3]), Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], 0.0), 0.5))
|
titleSeq = Sequence(Func(self.hideSmallTitleText), Func(self.showTitleText), Wait(0.1), Wait(6.0), self.titleText.colorInterval(0.5, Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], self.titleColor[3]), startColor=Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], 0.0)))
|
||||||
smallTitleSeq = Task.sequence(Task.Task(self.hideTitleTextTask), Task.Task(self.showSmallTitleTask))
|
smallTitleSeq = Sequence(Func(self.hideTitleText), Func(self.showSmallTitle))
|
||||||
if titleSeq:
|
if titleSeq:
|
||||||
seq = Task.sequence(titleSeq, smallTitleSeq)
|
self.titleTextSeq = Sequence(titleSeq, smallTitleSeq, name=self.uniqueName('titleText'))
|
||||||
else:
|
else:
|
||||||
seq = smallTitleSeq
|
self.titleTextSeq = Sequence(smallTitleSeq, name=self.uniqueName('titleText'))
|
||||||
taskMgr.add(seq, self.uniqueName('titleText'))
|
self.titleTextSeq.start()
|
||||||
return
|
return
|
||||||
|
|
||||||
def showInfoText(self, text = 'hello world'):
|
def showInfoText(self, text = 'hello world'):
|
||||||
description = text
|
description = text
|
||||||
if description and description != '':
|
if description and description != '':
|
||||||
taskMgr.remove(self.uniqueName('titleText'))
|
if self.titleTextSeq:
|
||||||
|
self.titleTextSeq.finish()
|
||||||
|
self.titleTextSeq = None
|
||||||
self.smallTitleText.setText(description)
|
self.smallTitleText.setText(description)
|
||||||
self.titleText.setText(description)
|
self.titleText.setText(description)
|
||||||
self.titleText.setColor(Vec4(*self.titleColor))
|
self.titleText.setColor(Vec4(*self.titleColor))
|
||||||
self.titleText.setFg(self.titleColor)
|
self.titleText.setFg(self.titleColor)
|
||||||
titleSeq = None
|
titleSeq = None
|
||||||
titleSeq = Task.sequence(Task.Task(self.hideSmallTitleTextTask), Task.Task(self.showTitleTextTask), Task.pause(0.1), Task.pause(3.0), self.titleText.lerpColor(Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], self.titleColor[3]), Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], 0.0), 0.5))
|
titleSeq = Sequence(Func(self.hideSmallTitleText), Func(self.showTitleText), Wait(0.1), Wait(3.0), self.titleText.colorInterval(0.5, Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], self.titleColor[3]), startColor=Vec4(self.titleColor[0], self.titleColor[1], self.titleColor[2], 0.0)))
|
||||||
if titleSeq:
|
if titleSeq:
|
||||||
seq = Task.sequence(titleSeq)
|
self.titleTextSeq = Sequence(titleSeq, name=self.uniqueName('titleText'))
|
||||||
taskMgr.add(seq, self.uniqueName('titleText'))
|
self.titleTextSeq.start()
|
||||||
return
|
return
|
||||||
|
|
||||||
def showTitleTextTask(self, task):
|
def showTitleText(self):
|
||||||
self.titleText.show()
|
self.titleText.show()
|
||||||
return Task.done
|
|
||||||
|
|
||||||
def hideTitleTextTask(self, task):
|
def hideTitleText(self):
|
||||||
if self.titleText:
|
if self.titleText:
|
||||||
self.titleText.hide()
|
self.titleText.hide()
|
||||||
return Task.done
|
|
||||||
|
|
||||||
def showSmallTitleTask(self, task):
|
def showSmallTitle(self):
|
||||||
if self.titleText:
|
if self.titleText:
|
||||||
self.titleText.hide()
|
self.titleText.hide()
|
||||||
self.smallTitleText.show()
|
self.smallTitleText.show()
|
||||||
return Task.done
|
|
||||||
|
|
||||||
def hideSmallTitleTextTask(self, task):
|
def hideSmallTitleText(self):
|
||||||
if self.smallTitleText:
|
if self.smallTitleText:
|
||||||
self.smallTitleText.hide()
|
self.smallTitleText.hide()
|
||||||
return Task.done
|
|
||||||
|
|
||||||
def startOuch(self, ouchLevel, period = 2):
|
def startOuch(self, ouchLevel, period = 2):
|
||||||
self.notify.debug('startOuch %s' % ouchLevel)
|
self.notify.debug('startOuch %s' % ouchLevel)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from toontown.battle.BattleBase import *
|
from toontown.battle.BattleBase import *
|
||||||
from toontown.battle import DistributedBattle
|
from toontown.battle import DistributedBattle
|
||||||
|
|
Loading…
Reference in a new issue