Exemplo n.º 1
0
 def __setBattleResults(self):
     self.__isResultsSet = self.__isResultsSet or True
     g_appLoader.attachCursor(APP_NAME_SPACE.SF_LOBBY, _CTRL_FLAG.GUI_ENABLED)
     g_bootcampEvents.onResultScreenFinished += self.onResultScreenFinished
     resultType, resultReason, resultTypeStr, resultReasonStr, reusableInfo = g_bootcamp.getBattleResults()
     if not reusableInfo is not None:
         raise AssertionError
         bgImagePath = self.__getBackgroundImagePath(resultType, g_bootcamp.getLessonNum() - 1)
         self.as_resultTypeHandlerS(resultTypeStr, bgImagePath)
         if resultType == BATTLE_RESULT.VICTORY:
             battleResultsExtra = deepcopy(g_bootcamp.getBattleResultsExtra(g_bootcamp.getLessonNum() - 1))
         else:
             battleResultsExtra = {'medals': [],
              'stats': [],
              'unlocks': []}
         battleResultsStats = self.battleResults.getResultsVO(self.__arenaUniqueID)
         showPremium = g_bootcamp.getLessonNum() == g_bootcamp.getContextIntParameter('lastLessonNum') and self.bootcampController.needAwarding()
         battleResultsExtra['showRewards'] = resultType == BATTLE_RESULT.VICTORY and g_bootcamp.getLessonNum() != 1
         if showPremium:
             self.__addPremiumData(battleResultsExtra['medals'])
         battleResultsExtra['stats'] = self.getBattleStatsData(battleResultsStats)
         self.as_setBootcampDataS(battleResultsExtra)
         self.as_setDataS(self.battleResults.getResultsVO(self.__arenaUniqueID))
         self.__hasBonusInMedals = bool(battleResultsExtra.get('unlocks', None))
         xp = reusableInfo.personal.getBaseXPRecords().getRecord('xp')
         credits = reusableInfo.personal.getBaseCreditsRecords().getRecord('credits')
         self.__hasBonusInStats = xp > 0 or credits > 0
     return
 def __setBattleResults(self):
     if not self.__isResultsSet:
         self.__isResultsSet = True
         g_appLoader.attachCursor(app_settings.APP_NAME_SPACE.SF_LOBBY, _CTRL_FLAG.GUI_ENABLED)
         g_bootcampEvents.onResultScreenFinished += self.onResultScreenFinished
         vo = self.battleResults.getResultsVO(self.__arenaUniqueID)
         self.as_setDataS(vo)
         self.__hasBonusInMedals = vo['hasUnlocks']
         self.__hasBonusInStats = vo['xp']['value'] > 0 or vo['credits']['value'] > 0
Exemplo n.º 3
0
 def detachCursor(self, isDetached, enableAiming):
     if not self.__isStarted:
         return
     self.__detachCount += -1 if isDetached else 1
     if not self.__detachCount <= 0:
         raise AssertionError
         if self.__detachCount == -1 and isDetached:
             self.__targeting.enable(False)
             g_appLoader.attachCursor(settings.APP_NAME_SPACE.SF_BATTLE)
             enableAiming and self.setAimingMode(False, AIMING_MODE.USER_DISABLED)
     elif not self.__detachCount:
         self.__targeting.enable(True)
         g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE)
Exemplo n.º 4
0
 def setForcedGuiControlMode(self, flags):
     result = False
     detached = flags & GUI_CTRL_MODE_FLAG.CURSOR_ATTACHED > 0
     if detached ^ self.__isDetached:
         self.__isDetached = detached
         self.__targeting.detach(self.__isDetached)
         if detached:
             g_appLoader.attachCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags)
             result = True
             if flags & GUI_CTRL_MODE_FLAG.AIMING_ENABLED > 0:
                 self.setAimingMode(False, AIMING_MODE.USER_DISABLED)
         else:
             g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE)
             result = True
         self.__curCtrl.setForcedGuiControlMode(detached)
     elif detached:
         g_appLoader.syncCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags)
     return result
Exemplo n.º 5
0
    def __onBCIntroVideoStop(self):
        from bootcamp.Bootcamp import g_bootcamp
        self._soundFilter.start()
        LOG_DEBUG_DEV_BOOTCAMP('__onBCIntroVideoStop called')
        self.__isIntroVideoFinished = True
        g_bootcamp.setIntroVideoPlayed()
        if self.isVideoPlayingLesson:
            BigWorld.delaySpaceLoad(False)
            BigWorld.finishDelayedLoading()
        for vehicle in self.__onEnterWorldVehicles:
            BigWorld.player().vehicle_onEnterWorld(vehicle)

        del self.__onEnterWorldVehicles[:]
        if self.__prereqs is not None:
            BigWorld.player().onEnterWorld(self.__prereqs)
            self.__prereqs = None
        g_appLoader.attachCursor(APP_NAME_SPACE.SF_BATTLE,
                                 _CTRL_FLAG.GUI_ENABLED)
        return
Exemplo n.º 6
0
    def __onBCIntroVideoStop(self):
        from bootcamp.Bootcamp import g_bootcamp
        self._soundFilter.start()
        LOG_DEBUG_DEV_BOOTCAMP('__onBCIntroVideoStop called')
        self.__isIntroVideoFinished = True
        g_bootcamp.setIntroVideoPlayed()
        if self.__lessonId == 0:
            BigWorld.delaySpaceLoad(False)
            BigWorld.finishDelayedLoading()
        if len(self.__onEnterWorldVehicles) > 0:
            for vehicle in self.__onEnterWorldVehicles:
                self.runVehicleOnEnterWorld(BigWorld.player(), vehicle)

            self.__onEnterWorldVehicles = []
        if self.__hookOnEnterWorld is not None and self.__hookOnEnterWorld.called:
            self.__hookOnEnterWorld.callOriginalInstance(BigWorld.player(), 0)
        g_appLoader.attachCursor(APP_NAME_SPACE.SF_BATTLE,
                                 _CTRL_FLAG.GUI_ENABLED)
        return
Exemplo n.º 7
0
 def setForcedGuiControlMode(self, flags):
     result = False
     if not self.__isStarted:
         return result
     detached = flags & GUI_CTRL_MODE_FLAG.CURSOR_ATTACHED > 0
     if detached ^ self.__isDetached:
         self.__isDetached = detached
         self.__targeting.detach(self.__isDetached)
         if detached:
             g_appLoader.attachCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags)
             result = True
             if flags & GUI_CTRL_MODE_FLAG.AIMING_ENABLED > 0:
                 self.setAimingMode(False, AIMING_MODE.USER_DISABLED)
         else:
             g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE)
             result = True
         self.__curCtrl.setForcedGuiControlMode(not detached)
     elif detached:
         g_appLoader.syncCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags)
     return result
Exemplo n.º 8
0
 def __disableVideoCamera(self):
     self.__videoCamera.disable()
     BigWorld.camera(self.hangarSpace.space.camera)
     g_appLoader.attachCursor(app_settings.APP_NAME_SPACE.SF_LOBBY, _CTRL_FLAG.GUI_ENABLED)
     BigWorld.player().objectsSelectionEnabled(True)
Exemplo n.º 9
0
 def _dispose(self):
     super(BCOutroVideoPage, self)._dispose()
     g_appLoader.attachCursor(APP_NAME_SPACE.SF_LOBBY,
                              _CTRL_FLAG.GUI_ENABLED)
Exemplo n.º 10
0
 def _dispose(self):
     super(BCOutroVideoPage, self)._dispose()
     from gui.app_loader import g_appLoader
     from gui.app_loader.settings import APP_NAME_SPACE
     from gui import GUI_CTRL_MODE_FLAG as _CTRL_FLAG
     g_appLoader.attachCursor(APP_NAME_SPACE.SF_LOBBY, _CTRL_FLAG.GUI_ENABLED)