2015-06-23 18:11:48 -05:00
|
|
|
from panda3d.core import *
|
2015-03-03 16:10:12 -06:00
|
|
|
from toontown.toonbase import TTLocalizer
|
|
|
|
from toontown.toonbase.ToontownBattleGlobals import *
|
|
|
|
from toontown.toonbase.ToontownGlobals import *
|
|
|
|
from SuitBattleGlobals import *
|
|
|
|
from direct.interval.IntervalGlobal import *
|
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
|
|
|
import string
|
|
|
|
from direct.gui import OnscreenText
|
|
|
|
import BattleBase
|
|
|
|
|
|
|
|
class PlayByPlayText(OnscreenText.OnscreenText):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory('PlayByPlayText')
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
OnscreenText.OnscreenText.__init__(self, mayChange=1, pos=(0.0, 0.75), scale=TTLocalizer.PBPTonscreenText, fg=(1, 0, 0, 1), font=getSignFont(), wordwrap=13)
|
|
|
|
|
|
|
|
def getShowInterval(self, text, duration):
|
|
|
|
return Sequence(Func(self.hide), Wait(duration * 0.3), Func(self.setText, text), Func(self.show), Wait(duration * 0.7), Func(self.hide))
|
|
|
|
|
|
|
|
def getToonsDiedInterval(self, textList, duration):
|
2015-06-10 09:45:44 -05:00
|
|
|
track = Sequence(Func(self.hide), Wait(duration * 0.1))
|
2015-03-03 16:10:12 -06:00
|
|
|
waitGap = 0.6 / len(textList) * duration
|
|
|
|
for text in textList:
|
|
|
|
newList = [Func(self.setText, text),
|
|
|
|
Func(self.show),
|
|
|
|
Wait(waitGap),
|
|
|
|
Func(self.hide)]
|
|
|
|
track += newList
|
|
|
|
|
|
|
|
track.append(Wait(duration * 0.1))
|
2015-07-05 18:59:25 -05:00
|
|
|
return track
|