def _update(self): super(BattleAssistant, self)._update() try: self._markerManager.update() g_bootcampEvents.onUIStateChanged(UI_STATE.UPDATE) except Exception: LOG_CURRENT_EXCEPTION_BOOTCAMP()
def _update(self): try: self._hintSystem.update() except: LOG_CURRENT_EXCEPTION_BOOTCAMP() self._updateTimerId = BigWorld.callback(BaseAssistant.ASSISTANT_TICK_LENGTH, self._update)
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)
def getDirectionIndicator(): indicator = None try: indicator = indicators.createDirectIndicator() except Exception: LOG_CURRENT_EXCEPTION_BOOTCAMP() return indicator
def getAction(self, actionName): try: if actionName in self.__actions: return self.__actions[actionName] raise Exception('Action not found - {0}.'.format(actionName)) except: LOG_CURRENT_EXCEPTION_BOOTCAMP() raise
def getLesson(self, lessonId): try: if lessonId in self.__lessons: return self.__lessons[lessonId] raise Exception('Lesson not found - {0}.'.format(lessonId)) except: LOG_CURRENT_EXCEPTION_BOOTCAMP() raise
def __init__(self): super(BattleSettings, self).__init__() self.__defaults = {'hints': {}, 'ribbons': [], 'panels': [], 'lessonPages': {}, 'prebattleHints': set()} self.__config = {} try: self.__loadDefaults() self.__loadConfig() except Exception: LOG_CURRENT_EXCEPTION_BOOTCAMP()
def __init__(self, avatar=None, hintsInfo={}): super(HintSystem, self).__init__() self.__secondaryHintQueue = deque() self.__currentSecondaryHint = None self.__currentHint = None self.__hintsCompleted = deque() self.__hintsNotCompleted = deque() self.__inCooldown = False self.__timeCooldownStart = 0 self.__timeCooldown = 3.0 self._hints = [] self.__currentVoiceover = None self.__voiceoverSchedule = [] replayPlaying = BattleReplay.g_replayCtrl.isPlaying replaySafeHints = (HINT_TYPE.HINT_MESSAGE_AVOID, ) self.__replayPlayer = createReplayPlayHintSystem(self) for hintName, hintParams in hintsInfo.iteritems(): try: hintTypeId = HINT_NAMES.index(hintName) if hintTypeId in HINT_TYPE.BATTLE_HINTS: if replayPlaying and hintTypeId not in replaySafeHints: continue cls = HintSystem.hintsBattleClasses.get(hintTypeId, None) if cls is None: raise Exception('Hint not implemented (%s)' % HINT_NAMES[hintTypeId]) hint = cls(avatar, hintParams) else: cls = HintSystem.hintsLobbyClasses.get(hintTypeId, None) if cls is None: raise Exception('Hint not implemented (%s)' % HINT_NAMES[hintTypeId]) hint = cls(hintParams) timeCompleted = hintParams.get('time_completed', 2.0) cooldownAfter = hintParams.get('cooldown_after', 2.0) voiceover = hintParams.get('voiceover', None) message = hintParams.get('message', 'Default Message') hint.timeCompleted = timeCompleted hint.cooldownAfter = cooldownAfter hint.message = message if voiceover is not None: hint.voiceover = voiceover self.addHint(hint) except: LOG_CURRENT_EXCEPTION_BOOTCAMP() return
def __init__(self): super(GarageSettings, self).__init__() self.__defaults = {'panels': {}} try: defaultSettingsConfig = ResMgr.openSection( GarageSettings.DEFAULTS_XML_PATH) if not defaultSettingsConfig: raise Exception("Can't open defaults config file (%s)" % GarageSettings.DEFAULTS_XML_PATH) panelSection = defaultSettingsConfig['panels'] panels = self.__defaults['panels'] visiblePanels = panelSection['visible'].asString visiblePanelNames = visiblePanels.split() for panelName in visiblePanelNames: panels['hide' + panelName] = False invisiblePanels = panelSection['invisible'].asString invisiblePanelNames = invisiblePanels.split() for panelName in invisiblePanelNames: panels['hide' + panelName] = True except: LOG_CURRENT_EXCEPTION_BOOTCAMP()