minigame: actually fix toon escape (lol)

This commit is contained in:
John Cote 2019-12-31 14:00:16 -05:00
parent b4dc578291
commit 0daf3c59ee
2 changed files with 7 additions and 8 deletions

View file

@ -24,7 +24,7 @@ from . import TravelGameGlobals
ALLOW_TEMP_MINIGAMES = simbase.config.GetBool('allow-temp-minigames', False)
if ALLOW_TEMP_MINIGAMES:
from toontown.minigame.TempMinigameAI import *
simbase.forcedMinigameId = simbase.config.GetInt('minigame-id', ToontownGlobals.TwoDGameId)
simbase.forcedMinigameId = simbase.config.GetInt('minigame-id', 0)
RequestMinigame = {}
MinigameZoneRefs = {}

View file

@ -57,6 +57,7 @@ class TwoDGameToonSD(StateData.StateData):
self.load()
self.progressLineLength = self.game.assetMgr.faceEndPos[0] - self.game.assetMgr.faceStartPos[0]
self.conversionRatio = self.progressLineLength / self.game.gameLength
self.scoreTextSeq = None
return
def load(self):
@ -281,16 +282,14 @@ class TwoDGameToonSD(StateData.StateData):
self.scoreText.setColor(r, g, b, a)
self.scoreText.setDepthTest(0)
self.scoreText.setDepthWrite(0)
seq = Task.sequence(self.scoreText.lerpPos(Point3(0, 0, self.toon.height + 2), 0.5, blendType='easeOut'), self.scoreText.lerpColor(Vec4(r, g, b, a), Vec4(r, g, b, 0), 0.25), Task(self.hideScoreTextTask))
taskMgr.add(seq, self.game.uniqueName('scoreText'))
self.scoreTextSeq = Sequence(self.scoreText.posInterval(0.5, Point3(0, 0, self.toon.height + 2), blendType='easeOut'), self.scoreText.colorInterval(0.25, Vec4(r, g, b, 0)), Func(self.hideScoreText))
self.scoreTextSeq.start()
def hideScoreText(self):
if self.scoreTextSeq:
self.scoreTextSeq.finish()
self.scoreTextSeq = None
if self.scoreText:
taskMgr.remove(self.game.uniqueName('scoreText'))
self.scoreText.removeNode()
self.scoreText = None
return
def hideScoreTextTask(self, task):
self.hideScoreText()
return Task.done