def getTutorialEventsDescriptor(): try: from tutorial.doc_loader import getQuestsDescriptor except ImportError: LOG_ERROR('Can not load package tutorial') def getQuestsDescriptor(): return None return getQuestsDescriptor()
def triggerEffect(self): chapterID = self._tutorial.getVars().get(self.getTargetID()) descriptor = getQuestsDescriptor() completed = game_vars.getTutorialsCompleted() chapterIdx = descriptor.getChapterIdx(chapterID) chaptersCount = descriptor.getNumberOfChapters() nextChapterID = self.__getOpenedChapterID( descriptor, completed, chapterIdx, chaptersCount) or self.__getOpenedChapterID( descriptor, completed, 0, chapterIdx) events_dispatcher.showTutorialTabInEventsWindow(nextChapterID)
def invoke(self, content, varID): descriptor = getQuestsDescriptor() chapterID = self.getVar(varID) chapter = descriptor.getChapter(chapterID) value = content['description'] content['description'] = self.getVar(value, default=value) content['header'] = self.__getAwardHeader(content, chapter) content['bgImage'] = self.__getAwardIcon(content, chapter) content['bonuses'] = chapter.getBonus().getValues() content['chapterID'] = chapterID content['showQuestsBtn'] = not descriptor.areAllBonusesReceived(self._bonuses.getCompleted())
def invoke(self, content, varID): descriptor = getQuestsDescriptor() chapterID = self.getVar(varID) chapter = descriptor.getChapter(chapterID) value = content['description'] content['description'] = self.getVar(value, default=value) content['header'] = self.__getAwardHeader(content, chapter) content['bgImage'] = self.__getAwardIcon(content, chapter) content['bonuses'] = chapter.getBonus().getValues() content['chapterID'] = chapterID progrCondition = chapter.getProgressCondition() if progrCondition.getID() == 'vehicleBattlesCount': content['vehicle'] = progrCondition.getValues().get('vehicle') content['showQuestsBtn'] = not descriptor.areAllBonusesReceived(self._bonuses.getCompleted())