def _selectQuest(self, questID):
     motiveQuests = g_eventsCache.getMotiveQuests(filterFunc=self._filterFunc)
     if questID in motiveQuests or self.__questsDescriptor is not None and self.__questsDescriptor.getChapter(questID) is not None:
         return self.as_setSelectedQuestS(questID)
     else:
         if questID in g_eventsCache.getMotiveQuests(filterFunc=lambda q: q.isCompleted()):
             sortedQuests = sorted(motiveQuests.values(), key=lambda q: q.getPriority())
             nextQuest = findFirst(None, sortedQuests)
             if nextQuest:
                 return self.as_setSelectedQuestS(nextQuest.getID())
         SystemMessages.pushI18nMessage(SYSTEM_MESSAGES.QUESTS_NOQUESTSWITHGIVENID)
         return
    def _invalidateEventsData(self):
        result = []
        if self.__questsDescriptor is not None:
            completed = g_itemsCache.items.stats.tutorialsCompleted
            for chapter in self.__questsDescriptor:
                chapterStatus = chapter.getChapterStatus(self.__questsDescriptor, completed)
                if chapterStatus != _EVENT_STATUS.NOT_AVAILABLE:
                    qProgCur, qProgTot, progressBarType = self.__getProgressValues(chapter)
                    result.append({'questID': chapter.getID(),
                     'isNew': False,
                     'status': chapterStatus,
                     'description': chapter.getTitle(),
                     'isSelectable': True,
                     'rendererType': QUESTS_ALIASES.RENDERER_TYPE_QUEST,
                     'tooltip': TOOLTIPS.QUESTS_RENDERER_LABEL,
                     'tasksCount': NO_PROGRESS_COUNT,
                     'maxProgrVal': qProgTot,
                     'currentProgrVal': qProgCur,
                     'progrBarType': progressBarType,
                     'detailsLinkage': QUESTS_ALIASES.TUTORIAL_HANGAR_QUEST_DETAILS_LINKAGE,
                     'detailsPyAlias': QUESTS_ALIASES.TUTORIAL_HANGAR_QUEST_DETAILS_PY_ALIAS})

        svrEvents = self._applyFilters(g_eventsCache.getMotiveQuests().values())
        if len(svrEvents):
            result.append(formatters.packGroupBlock(QUESTS.QUESTS_TITLE_MANEUVERSQUESTS))
            for e in svrEvents:
                infoData = events_helpers.getEventInfo(e, svrEvents)
                infoData.update({'detailsLinkage': QUESTS_ALIASES.TUTORIAL_HANGAR_MOTIVE_QUEST_DETAILS_LINKAGE,
                 'detailsPyAlias': QUESTS_ALIASES.TUTORIAL_HANGAR_MOTIVE_QUEST_DETAILS_PY_ALIAS})
                result.append(infoData)

        self.as_setQuestsDataS({'quests': result,
         'totalTasks': len(svrEvents)})
        return
Exemple #3
0
 def requestQuestInfo(self, questID):
     svrEvents = g_eventsCache.getMotiveQuests()
     event = svrEvents.get(questID)
     settings.visitEventGUI(event)
     info = None
     if event is not None:
         info = events_helpers.getEventDetails(event, svrEvents)
     self.as_updateQuestInfoS(info)
     return
Exemple #4
0
    def __getNextMotiveQuest(self):
        quests = g_eventsCache.getMotiveQuests(lambda q: q.isAvailable() and not q.isCompleted())
        sortedQuests = sorted(quests.values(), key=lambda q: q.getPriority())
        nextQuest = findFirst(None, sortedQuests)
        for quest in sortedQuests:
            if quest.getPriority() > self.__quest.getPriority():
                return quest

        return nextQuest
 def requestQuestInfo(self, questID):
     svrEvents = g_eventsCache.getMotiveQuests()
     event = svrEvents.get(questID)
     settings.visitEventGUI(event)
     info = None
     if event is not None:
         info = events_helpers.getEventDetails(event, svrEvents)
     self.as_updateQuestInfoS(info)
     return
Exemple #6
0
    def __getNextMotiveQuest(self):
        quests = g_eventsCache.getMotiveQuests(
            lambda q: q.isAvailable() and not q.isCompleted())
        sortedQuests = sorted(quests.values(), key=lambda q: q.getPriority())
        nextQuest = findFirst(None, sortedQuests)
        for quest in sortedQuests:
            if quest.getPriority() > self.__quest.getPriority():
                return quest

        return nextQuest
 def _showAward(self, ctx):
     data = ctx[1].data
     motiveQuests = g_eventsCache.getMotiveQuests()
     for qID in data.get('completedQuestIDs', set()):
         if qID in motiveQuests:
             quests_events.showMotiveAward(motiveQuests[qID])
 def _showAward(self, ctx):
     data = ctx[1].data
     motiveQuests = g_eventsCache.getMotiveQuests()
     for qID in data.get('completedQuestIDs', set()):
         if qID in motiveQuests:
             quests_events.showMotiveAward(motiveQuests[qID])