Beispiel #1
0
 def _doActivate(self):
     from bootcamp.Bootcamp import g_bootcamp
     from gui.battle_results.context import RequestResultsContext
     from bootcamp.BattleResultTransition import BattleResultTransition
     from gui.shared.personality import ServicesLocator
     sessionProvider = dependency.instance(IBattleSessionProvider)
     battleResultProvider = dependency.instance(IBattleResultsService)
     battleCtx = sessionProvider.getCtx()
     g_bootcamp.showActionWaitWindow()
     yield ServicesLocator.itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
     g_bootcamp.hideActionWaitWindow()
     resultType, _, _, _, _ = g_bootcamp.getBattleResults()
     if resultType == BOOTCAMP_BATTLE_RESULT_MESSAGE.FAILURE:
         BootcampTransition.stop()
         g_bootcampEvents.onResultScreenFinished(0)
         return
     else:
         if battleCtx.lastArenaUniqueID:
             if g_bootcamp.transitionFlash is not None:
                 g_bootcamp.transitionFlash.close()
             g_bootcamp.transitionFlash = BattleResultTransition()
             g_bootcamp.transitionFlash.active(True)
             yield battleResultProvider.requestResults(
                 RequestResultsContext(battleCtx.lastArenaUniqueID))
             battleCtx.lastArenaUniqueID = None
         return
Beispiel #2
0
 def onBecomeNonPlayer(self):
     super(PlayerBootcampAccount, self).onBecomeNonPlayer()
     g_bootcampEvents.onBootcampBecomeNonPlayer()
     g_bootcamp.hideActionWaitWindow()
     if g_bootcamp is not None:
         g_bootcamp.setAccount(None)
     return
 def showGUI(self, bootcampCtxStr):
     LOG_DEBUG_DEV_BOOTCAMP('showGUI called')
     g_bootcamp.hideActionWaitWindow()
     bootcampCtx = cPickle.loads(bootcampCtxStr)
     self.databaseID = bootcampCtx['databaseID']
     currentLesson = bootcampCtx['lessonNum']
     isBattleLesson = bootcampCtx['isBattleLesson']
     g_bootcamp.setAccount(self)
     g_bootcamp.setContext(bootcampCtx)
     events.isPlayerEntityChanging = False
     firstRun = currentLesson == 0 and not g_bootcamp.isRunning()
     events.onBootcampShowGUI(firstRun)
     if g_bootcamp.isRunning():
         g_bootcamp.onBattleLessonFinished(currentLesson, bootcampCtx['lessonResults'])
     elif not g_bootcamp.isManualStart():
         g_bootcamp.start(currentLesson, isBattleLesson)
Beispiel #4
0
 def showGUI(self, ctx):
     LOG_DEBUG_DEV_BOOTCAMP('showGUI called')
     g_bootcamp.hideActionWaitWindow()
     ctx = cPickle.loads(ctx)
     guiCtx = ctx['gui']
     self.lobbyContext.onAccountShowGUI(guiCtx)
     self._initTimeCorrection(guiCtx)
     bootcampCtx = ctx['bootcamp']
     self.databaseID = bootcampCtx['databaseID']
     currentLesson = bootcampCtx['lessonNum']
     isBattleLesson = bootcampCtx['isBattleLesson']
     g_bootcamp.setAccount(self)
     g_bootcamp.setContext(bootcampCtx)
     events.isPlayerEntityChanging = False
     if g_bootcamp.isRunning():
         g_bootcamp.onBattleLessonFinished(currentLesson, bootcampCtx['lessonResults'])
     elif not g_bootcamp.isManualStart():
         g_bootcamp.start(currentLesson, isBattleLesson)
Beispiel #5
0
 def hideActionWaitWindow(self):
     g_bootcamp.hideActionWaitWindow()