Beispiel #1
0
def _getlocalizeLinkedSetQuestString(localizedKey, quest):
    curProgress, totalProgress = getProgressFromQuestWithSingleAccumulative(
        quest)
    kwargs = {
        'cur_progress': _formatNumberInLinkedSetQuest(curProgress),
        'total_progress': _formatNumberInLinkedSetQuest(totalProgress)
    }
    return _ms(localizedKey, **kwargs)
Beispiel #2
0
def _getlocalizeLinkedSetQuestString(localizedKey, quest):
    curProgress, totalProgress = getProgressFromQuestWithSingleAccumulative(
        quest)
    kwargs = {}
    if curProgress is not None and totalProgress is not None:
        kwargs.update({
            'cur_progress':
            backport.getIntegralFormat(curProgress),
            'total_progress':
            backport.getIntegralFormat(totalProgress)
        })
    return _ms(localizedKey, **kwargs)
Beispiel #3
0
 def _getViewDataForAvailableMission(self):
     selectedQuest = self._quests[self._selectedQuestID]
     isCompleted = selectedQuest.isCompleted()
     isAvailable = isCompleted or selectedQuest.isAvailable().isValid
     if isCompleted:
         cardStatus = formatOkTextWithIcon(_ms(LINKEDSET.COMPLETED))
     elif isAvailable:
         cardStatus = _ms(LINKEDSET.AVAILABLE)
     else:
         cardStatus = formatErrorTextWithIcon(_ms(LINKEDSET.NOT_AVAILABLE))
     if len(self._quests) > 1:
         cardTitle = _ms(LINKEDSET.QUEST_CARD_TITLE,
                         mission_name=_ms(
                             LINKEDSET.getMissionName(self._missionID)),
                         quest_name=getLocalizedQuestNameForLinkedSetQuest(
                             selectedQuest))
     else:
         cardTitle = getLocalizedQuestNameForLinkedSetQuest(selectedQuest)
     if isCompleted:
         return self._getViewData(
             title=cardTitle,
             status=cardStatus,
             info=_ms(LINKEDSET.COMPLETED),
             task=_ms(LINKEDSET.REWARD_FOR_COMPLETED_QUEST,
                      quest_name=cardTitle),
             isBackOverlay=isCompleted,
             isMovie=False,
             back=self.getMissionCompleteBackground(self._missionID),
             awards=self.getAwardsFromQuest(selectedQuest))
     elif isAvailable:
         isMovie = self.isQuestBackgroundIsMovie(selectedQuest)
         if isMovie:
             self._setupFlashAnimTexts()
             back = _getQuestItemActiveAnimBackground(
                 self._missionID, self._selectedQuestID + 1)
         else:
             back = self.getQuestActiveBackground(self._missionID,
                                                  self._selectedQuestID + 1)
         if self.isPlayBootcampMission():
             questName = getLocalizedQuestNameForLinkedSetQuest(
                 selectedQuest)
             if self.bootcamp.runCount():
                 btnStartLabel = LINKEDSET.CONTINUE_QUEST_BTN
             else:
                 btnStartLabel = LINKEDSET.START_QUEST_BTN
             btnStartLabel = _ms(btnStartLabel, quest_name=questName)
         else:
             btnStartLabel = None
         progressValue = None
         curProgress, maxProgress = getProgressFromQuestWithSingleAccumulative(
             selectedQuest)
         if curProgress is not None and maxProgress:
             cardStatus = makeHtmlString(
                 'html_templates:lobby/quests/linkedSet',
                 'questProgressTemplate', {
                     'curValue': curProgress,
                     'maxValue': maxProgress
                 })
             progressValue = curProgress * 100 // maxProgress
         return self._getViewData(
             title=cardTitle,
             status=cardStatus,
             description=getLocalizedQuestDescForLinkedSetQuest(
                 selectedQuest),
             isBackOverlay=isCompleted,
             isMovie=isMovie,
             back=back,
             awards=self.getAwardsFromQuest(selectedQuest),
             btnStartLabel=btnStartLabel,
             progressValue=progressValue)
     else:
         questBeforeID = self._quests[self._selectedQuestID - 1]
         questBeforeName = _ms(
             LINKEDSET.QUEST_CARD_TITLE,
             mission_name=_ms(LINKEDSET.getMissionName(self._missionID)),
             quest_name=getLocalizedQuestNameForLinkedSetQuest(
                 questBeforeID))
         return self._getViewData(
             title=cardTitle,
             status=cardStatus,
             info=_ms(LINKEDSET.NOT_AVAILABLE),
             task=_ms(LINKEDSET.COMPLETE_QUEST_BEFORE,
                      quest_name=questBeforeName),
             isBackOverlay=isCompleted,
             isMovie=False,
             back=self.getMissionCompleteBackground(self._missionID),
             awards=self.getAwardsFromQuest(selectedQuest, alpha=0.5))
         return