Exemple #1
0
def showMissionAward(quest, ctx):

    def handleEvent():
        prbDispatcher = g_prbLoader.getDispatcher()
        if prbDispatcher is not None and prbDispatcher.getFunctionalState().isNavigationDisabled():
            SystemMessages.pushI18nMessage('#system_messages:queue/isInQueue', type=SystemMessages.SM_TYPE.Error)
            return False
        else:
            showMissionsCategories()
            return True

    eventName = recruit_helper.getSourceIdFromQuest(quest.getID()) or anniversary_helper.getEventNameByQuest(quest)
    if eventName in _EVENTS_REWARD_WINDOW:
        ctx['quest'] = quest
        ctx['eventName'] = eventName
        rewardWindow = _EVENTS_REWARD_WINDOW[eventName](ctx)
        rewardWindow.load()
    else:
        bonuses = getMissionInfoData(quest).getSubstituteBonuses()
        if bonuses:
            lootboxes = getLootboxesFromBonuses(bonuses)
            if lootboxes:
                for lootboxId, lootboxInfo in lootboxes.iteritems():
                    if lootboxId in NewYearLootBoxes.ALL():
                        continue
                    showLootboxesAward(lootboxId=lootboxId, lootboxCount=lootboxInfo['count'], isFree=lootboxInfo['isFree'])

            else:
                missionAward = awards.MissionAward(quest, ctx, handleEvent)
                if missionAward.getAwards():
                    shared_events.showMissionAwardWindow(missionAward)
def showMissionAward(quest, ctx):
    eventName = recruit_helper.getSourceIdFromQuest(quest.getID())
    if eventName in _EVENTS_REWARD_WINDOW:
        ctx['quest'] = quest
        ctx['eventName'] = eventName
        rewardWindow = _EVENTS_REWARD_WINDOW[eventName](ctx)
        rewardWindow.load()
    else:
        missionAward = awards.MissionAward(quest, ctx, showMissionsForCurrentVehicle)
        if missionAward.getAwards():
            shared_events.showMissionAwardWindow(missionAward)
Exemple #3
0
def showMissionAward(quest, ctx):
    eventName = recruit_helper.getSourceIdFromQuest(
        quest.getID()) or anniversary_helper.getEventNameByQuest(quest)
    if eventName in _EVENTS_REWARD_WINDOW:
        ctx['quest'] = quest
        ctx['eventName'] = eventName
        rewardWindow = _EVENTS_REWARD_WINDOW[eventName](ctx)
        rewardWindow.load()
    else:
        bonuses = getMissionInfoData(quest).getSubstituteBonuses()
        if bonuses:
            lootboxes = getLootboxesFromBonuses(bonuses)
            if lootboxes:
                for lootboxId, lootboxInfo in lootboxes.iteritems():
                    showLootboxesAward(lootboxId=lootboxId,
                                       lootboxCount=lootboxInfo['count'],
                                       isFree=lootboxInfo['isFree'])

            else:
                missionAward = awards.MissionAward(quest, ctx,
                                                   showMissionsCategories)
                if missionAward.getAwards():
                    shared_events.showMissionAwardWindow(missionAward)
Exemple #4
0
 def _isQuestOfThisGroup(cls, questID):
     return getSourceIdFromQuest(questID) is not None