Ejemplo n.º 1
0
 def start(self):
     if self.__started:
         return
     else:
         self.__started = True
         self.__bootcampGarageActions = BootcampGarageActions()
         self.isLessonSuspended = False
         self.__showActionsHistory = []
         from Bootcamp import g_bootcamp
         lesson = self.__bootcampGarageActions.getLessonById(
             self.__lessonId)
         self.__bootcampGarageActions.actionStart = lesson[
             LESSON_PARAM.ACTION_START]
         self.__bootcampGarageActions.actionFinish = lesson[
             LESSON_PARAM.ACTION_FINISH]
         lastLesson = g_bootcamp.getContextIntParameter('lastLessonNum')
         if self.__lessonId == lastLesson:
             self.__prevHint = None
             self.__nextHint = None
             self.__hardcodeHint = None
         if self.__checkpoint != '':
             self.enableCheckpointGUI()
             currentAction = self.runCheckpoint()
         else:
             currentAction = self.__bootcampGarageActions.actionStart
             startCallback = self.getCallbackByName(currentAction)
             startCallback()
         if self.__lessonId != lastLesson:
             self.setAllViewActions(currentAction)
         if currentAction != self.__bootcampGarageActions.actionFinish:
             g_bootcampEvents.onBattleNotReady()
         return
Ejemplo n.º 2
0
    def runViewAlias(self, viewAlias):
        from Bootcamp import g_bootcamp
        lastLesson = g_bootcamp.getContextIntParameter('lastLessonNum')
        if not self.isLessonSuspended and self.__lessonId != lastLesson:
            viewActions = self.__bootcampGarageActions.getViewActions(
                viewAlias)
            for action in viewActions:
                name = action[ACTION_PARAM.NAME]
                condition = action['show_condition']['condition']
                nationData = self.getNationData()
                if getActionType(name) == ACTION_TYPE.SHOW_MESSAGE:
                    if name in self.__showActionsHistory:
                        continue
                if condition.recheckOnItemSync(
                ) and viewAlias not in self.__deferredAliases:
                    self.__deferredAliases.append(viewAlias)
                if condition.checkCondition(
                        nationData) == action['show_condition']['result']:
                    if 'prevHint' in action['show_condition']:
                        if self.__prevHint != action['show_condition'][
                                'prevHint']:
                            continue
                    if getActionType(
                            name
                    ) == ACTION_TYPE.HIGHLIGHT_BUTTON and name == self.__prevHint:
                        return True
                    self.hideAllHints()
                    callbackAction = self.getCallbackByName(name)
                    callbackAction()
                    return True

        return False
Ejemplo n.º 3
0
    def checkReturnToHangar(self):
        if self.isLessonSuspended:
            g_bootcampGarage.highlightLobbyHint('HangarButton', True, True)
        elif self.isLessonFinished:
            if self.canGoToBattle:
                LOG_DEBUG_DEV_BOOTCAMP("checkReturnToHangar - hiding 'HangarButton' highlight (isLessonFinished and canGoToBattle)")
                g_bootcampGarage.highlightLobbyHint('HangarButton', False, True)
            else:
                LOG_DEBUG_DEV_BOOTCAMP("checkReturnToHangar - highlighting 'HangarButton' (isLessonFinished and not canGoToBattle)")
                g_bootcampGarage.highlightLobbyHint('HangarButton', True, True)
        elif self.__lessonId == g_bootcamp.getContextIntParameter('randomBattleLesson'):
            name = 'hideHeaderBattleSelector'
            if name in self.bootcampCtrl.getLobbySettings():
                if self.bootcampCtrl.getLobbySettings()[name]:
                    g_bootcampGarage.highlightLobbyHint('HangarButton', True, True)
                    return
            try:
                items = battle_selector_items.getItems()
                if not items.isSelected('random'):
                    return
            except:
                LOG_CURRENT_EXCEPTION_BOOTCAMP()
                LOG_ERROR_BOOTCAMP('battle_selector_items exception')

            g_bootcampGarage.highlightLobbyHint('HangarButton', True, True)
        else:
            g_bootcampGarage.highlightLobbyHint('HangarButton', True, True)
Ejemplo n.º 4
0
 def hideExcessElements(self):
     from Bootcamp import g_bootcamp
     excessElements = [
         'HangarEquipment', 'HangarOptionalDevices', 'HangarQuestControl',
         'HeaderBattleSelector'
     ]
     if self.__lessonId == g_bootcamp.getContextIntParameter(
             'researchSecondVehicleLesson'):
         excessElements.append('HangarCrew')
     if not self.isSecondVehicleSelected():
         self.disableGarageGUIElements(excessElements)