Пример #1
0
    def _showAward(self, ctx):
        data = ctx[1].data
        allQuests = g_eventsCache.getAllQuests(includePotapovQuests=True)
        needToShowVehAwardWindow = False
        for qID in data.get('completedQuestIDs', set()):
            if qID in allQuests:
                for tokenID, children in allQuests[qID].getChildren().iteritems():
                    for chID in children:
                        chQuest = allQuests[chID]
                        if chQuest.getType() == EVENT_TYPE.POTAPOV_QUEST:
                            needToShowVehAwardWindow = True
                            break

        if needToShowVehAwardWindow:
            for vehTypeCompDescr in data.get('vehicles') or {}:
                quests_events.showVehicleAward(Vehicle(typeCompDescr=abs(vehTypeCompDescr)))
Пример #2
0
    def _showAward(self, ctx):
        data = ctx[1].data
        allQuests = g_eventsCache.getAllQuests(includePotapovQuests=True)
        needToShowVehAwardWindow = False
        for qID in data.get('completedQuestIDs', set()):
            if qID in allQuests:
                for tokenID, children in allQuests[qID].getChildren().iteritems():
                    for chID in children:
                        chQuest = allQuests[chID]
                        if chQuest.getType() == EVENT_TYPE.POTAPOV_QUEST:
                            needToShowVehAwardWindow = True
                            break

        if needToShowVehAwardWindow:
            for vehTypeCompDescr in data.get('vehicles') or {}:
                quests_events.showVehicleAward(Vehicle(typeCompDescr=abs(vehTypeCompDescr)))
Пример #3
0
    def _showAward(self, ctx):
        data = ctx[1].data
        completedQuests = {}
        allQuests = self.eventsCache.getAllQuests(includePotapovQuests=True)
        needToShowVehAwardWindow = False
        for qID in data.get('completedQuestIDs', set()):
            if qID in allQuests:
                if self.isShowCongrats(allQuests[qID]):
                    completedQuests[qID] = (allQuests[qID], {'eventsCache': self.eventsCache})
                for tokenID, children in allQuests[qID].getChildren().iteritems():
                    for chID in children:
                        chQuest = allQuests[chID]
                        if chQuest.getType() == EVENT_TYPE.POTAPOV_QUEST:
                            needToShowVehAwardWindow = True
                            break

        if needToShowVehAwardWindow:
            for vehiclesData in data.get('vehicles', []):
                for vehTypeCompDescr in vehiclesData:
                    quests_events.showVehicleAward(Vehicle(typeCompDescr=abs(vehTypeCompDescr)))

        for quest, context in completedQuests.itervalues():
            self._showWindow(quest, context)