コード例 #1
0
 def showEventsWindow(self, eID, eventType):
     if self.__canNavigate():
         if eventType == constants.EVENT_TYPE.C11N_PROGRESSION:
             _, vehicleIntCD = parseEventID(eID)
             vehicle = self.__itemsCache.items.getVehicleCopyByCD(
                 vehicleIntCD)
             if not vehicle.isCustomizationEnabled():
                 _logger.warning(
                     'Trying to open customization from PBS for incompatible vehicle.'
                 )
                 return
             app = self.__appLoader.getApp()
             view = app.containerManager.getViewByKey(
                 ViewKey(VIEW_ALIAS.LOBBY_CUSTOMIZATION))
             if view is None:
                 lobbyHeaderNavigationPossible = yield self.__lobbyContext.isHeaderNavigationPossible(
                 )
                 if not lobbyHeaderNavigationPossible:
                     return
             self.soundManager.playInstantSound(SOUNDS.SELECT)
         else:
             lobbyHeaderNavigationPossible = yield self.__lobbyContext.isHeaderNavigationPossible(
             )
             if not lobbyHeaderNavigationPossible:
                 return
         if isCelebrityQuest(eID):
             _nyController = dependency.instance(INewYearController)
             if not _nyController.isEnabled():
                 _nyController.showStateMessage()
                 return
         quests_events.showMission(eID, eventType)
         self.destroy()
     return
コード例 #2
0
 def getVO(self):
     questInfo = self._value.get('questInfo', {})
     questID = questInfo.get('questID', None)
     if questInfo and questID is not None:
         _, vehicleIntCD = parseEventID(questID)
         vehicle = self._itemsCache.items.getItemByCD(vehicleIntCD)
         linkBtnEnabled, linkBtnTooltip = getC11nProgressionLinkBtnParams(vehicle)
         self._value['linkBtnEnabled'] = linkBtnEnabled
         self._value['linkBtnTooltip'] = backport.text(linkBtnTooltip)
     return self._value
コード例 #3
0
def showMission(eventID, eventType=None):
    from gui.impl.lobby.missions.daily_quests_view import DailyTabs
    if eventType == constants.EVENT_TYPE.C11N_PROGRESSION:
        itemIntCD, vehicleIntCD = parseEventID(eventID)
        service = dependency.instance(ICustomizationService)
        vehicle = service.getItemByCD(vehicleIntCD)
        service.showCustomization(vehicle.invID,
                                  lambda: showProgressiveItemsView(itemIntCD))
        return
    else:
        eventsCache = dependency.instance(IEventsCache)
        quests = eventsCache.getQuests()
        quest = quests.get(eventID)
        if eventID == BattlePassConsts.FAKE_QUEST_ID:
            hideWebBrowserOverlay()
            showMissionsBattlePass()
            return
        if quest is None:
            prefix = events_helpers.getMarathonPrefix(eventID)
            if prefix is not None:
                return showMissionsMarathon(marathonPrefix=prefix)
        if eventType is not None and eventType == constants.EVENT_TYPE.PERSONAL_MISSION:
            showPersonalMission(eventID)
        elif quest is not None:
            if events_helpers.isMarathon(quest.getGroupID()):
                groups = eventsCache.getGroups()
                group = groups.get(quest.getGroupID())
                groupContent = group.getGroupContent(quests)
                mainQuest = group.getMainQuest(groupContent)
                if mainQuest and quest.getID() != mainQuest.getID():
                    showMissionsGrouped(missionID=quest.getID(),
                                        groupID=group.getID(),
                                        anchor=group.getID())
                else:
                    showMissionsGrouped(anchor=group.getID())
            elif events_helpers.isLinkedSet(quest.getGroupID()):
                showMissionsLinkedSet()
            elif events_helpers.isDailyQuest(quest.getID()):
                showDailyQuests(subTab=DailyTabs.QUESTS)
            elif events_helpers.isPremium(quest.getID()):
                showDailyQuests(subTab=DailyTabs.PREMIUM_MISSIONS)
            else:
                showMissionsCategories(missionID=quest.getID(),
                                       groupID=quest.getGroupID(),
                                       anchor=quest.getGroupID())
        return