def showWaitToStartCountdown(self, duration, waitToStartTimestamp, almostDoneCallback=None): self._countdownAlmostDoneCallback = almostDoneCallback currentTime = globalClock.getRealTime() waitTimeElapsed = currentTime - waitToStartTimestamp # if still time left to display countdown if (duration - waitTimeElapsed) > 1.0: countdownTask = Task(self._updateCountdownTask) countdownTask.duration = duration - waitTimeElapsed self.countdownText.setText(str(int(countdownTask.duration))) self.countdownText.show() taskMgr.remove(TeamActivityGui.COUNTDOWN_TASK_NAME) taskMgr.add(countdownTask, TeamActivityGui.COUNTDOWN_TASK_NAME) else: # don't bother showing timer at all assert (self.activity.notify.debug( "GUI: Server entered WaitToStart %.1f seconds ago. No point in displaying on screen countdown." % waitTimeElapsed))
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration countdownTask.maxCount = RaceGlobals.RaceCountdown taskMgr.remove(self.uniqueName('countdownTimerTask')) return taskMgr.add(countdownTask, self.uniqueName('countdownTimerTask'))
def startCountdown(self): if not self.timerTask and self.startingBlocks: self.makeClockGui() duration = KartGlobals.COUNTDOWN_TIME - globalClockDelta.localElapsedTime(self.getTimestamp()) countdownTask = Task(self.updateTimerTask) countdownTask.duration = duration self.timerTask = taskMgr.add(countdownTask, self.uniqueName('racePadTimerTask'))
def startCountdown(self): if not self.timerTask and self.startingBlocks: self.makeClockGui() duration = KartGlobals.COUNTDOWN_TIME - globalClockDelta.localElapsedTime(self.getTimestamp()) countdownTask = Task(self.updateTimerTask) countdownTask.duration = duration self.timerTask = taskMgr.add(countdownTask, self.uniqueName('racePadTimerTask'))
def showWaitToStartCountdown(self, duration, waitToStartTimestamp, almostDoneCallback = None): self._countdownAlmostDoneCallback = almostDoneCallback currentTime = globalClock.getRealTime() waitTimeElapsed = currentTime - waitToStartTimestamp if duration - waitTimeElapsed > 1.0: countdownTask = Task(self._updateCountdownTask) countdownTask.duration = duration - waitTimeElapsed self.countdownText.setText(str(int(countdownTask.duration))) self.countdownText.show() taskMgr.remove(TeamActivityGui.COUNTDOWN_TASK_NAME) taskMgr.add(countdownTask, TeamActivityGui.COUNTDOWN_TASK_NAME)
def showWaitToStartCountdown(self, duration, waitToStartTimestamp, almostDoneCallback = None): self._countdownAlmostDoneCallback = almostDoneCallback currentTime = globalClock.getRealTime() waitTimeElapsed = currentTime - waitToStartTimestamp if duration - waitTimeElapsed > 1.0: countdownTask = Task(self._updateCountdownTask) countdownTask.duration = duration - waitTimeElapsed self.countdownText.setText(str(int(countdownTask.duration))) self.countdownText.show() taskMgr.remove(TeamActivityGui.COUNTDOWN_TASK_NAME) taskMgr.add(countdownTask, TeamActivityGui.COUNTDOWN_TASK_NAME)
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration taskMgr.remove(self.uniqueName('golfKartTimerTask')) return taskMgr.add(countdownTask, self.uniqueName('golfKartTimerTask'))
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration taskMgr.remove('trolleyTimerTask') return taskMgr.add(countdownTask, 'trolleyTimerTask')
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration taskMgr.remove(self.uniqueName('elevatorTimerTask')) return taskMgr.add(countdownTask, self.uniqueName('elevatorTimerTask'))
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration taskMgr.remove('trolleyTimerTask') return taskMgr.add(countdownTask, 'trolleyTimerTask')
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration taskMgr.remove(self.uniqueName("golfKartTimerTask")) return taskMgr.add(countdownTask, self.uniqueName("golfKartTimerTask"))
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration countdownTask.maxCount = RaceGlobals.RaceCountdown taskMgr.remove(self.uniqueName('countdownTimerTask')) return taskMgr.add(countdownTask, self.uniqueName('countdownTimerTask'))
def countdown(self, duration): countdownTask = Task(self.timerTask) countdownTask.duration = duration taskMgr.remove(self.uniqueName("elevatorTimerTask")) return taskMgr.add(countdownTask, self.uniqueName("elevatorTimerTask"))