Poodletooth-iLand/toontown/battle/PlayByPlayText.py

32 lines
1.3 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from pandac.PandaModules import *
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-06-10 09:16:05 -05:00
return track