def _getRegularStatusFields(self, isLimited, bonusCount, bonusLimit):
     scheduleOrResetLabel = ''
     scheduleTooltip = None
     if isLimited:
         isDaily = self.event.bonusCond.isDaily()
         statusLabel = text_styles.concatStylesWithSpace(
             icons.inProgress(),
             text_styles.standard(
                 _ms(_getDailyLimitedStatusKey(isDaily),
                     count=text_styles.stats(bonusCount),
                     total=text_styles.standard(bonusLimit))))
         statusTooltipData = getBonusLimitTooltip(bonusCount, bonusLimit,
                                                  isDaily)
     else:
         statusTooltipData = getCompletetBonusLimitValueTooltip(
             self.event.getBonusCount())
         statusLabel = text_styles.concatStylesWithSpace(
             icons.inProgress(),
             text_styles.standard(
                 _ms(QUESTS.MISSIONDETAILS_MISSIONSCOMPLETECOUNTER,
                     count=text_styles.stats(self.event.getBonusCount()))))
     if self.event.getWeekDays() or self.event.getActiveTimeIntervals():
         scheduleOrResetLabel = getScheduleLabel()
         scheduleTooltip = getInvalidTimeIntervalsTooltip(self.event)
     elif self.event.bonusCond.isDaily():
         scheduleOrResetLabel = self._getDailyResetStatusLabel()
     return {
         'statusLabel': statusLabel,
         'status': MISSIONS_STATES.NONE,
         'statusTooltipData': statusTooltipData,
         'dateLabel': self._getActiveTimeDateLabel(),
         'scheduleOrResetLabel': scheduleOrResetLabel,
         'scheduleTooltip': scheduleTooltip
     }
 def __formatDescription(self, quests):
     season = self._eventProgression.getCurrentSeason(
     ) or self._eventProgression.getNextSeason()
     currentTime = time_utils.getCurrentLocalServerTimestamp()
     cycle = season.getCycleInfo()
     if not self._eventProgression.modeIsAvailable() or cycle is None:
         return ''
     elif self._eventProgression.isNeedAchieveMaxLevelForDailyQuest():
         maxLevel = self._eventProgression.getMaxPlayerLevel()
         description = backport.text(_R_EPIC_BATTLE.unavailable(),
                                     reason=backport.text(
                                         _R_EPIC_BATTLE.restrict.level(),
                                         level=maxLevel))
         return text_styles.concatStylesWithSpace(
             icons.markerBlocked(), text_styles.error(description))
     elif cycle.endDate - currentTime < time_utils.ONE_DAY:
         icon = icons.inProgress(vspace=-3)
         messageID = _R_EPIC_BATTLE.timeLeft
         valueStyle = text_styles.stats
         timeStr = valueStyle(
             backport.text(R.strings.epic_battle.questsTooltip.epicBattle.
                           lessThanDay()))
         textStyle = text_styles.main
         description = textStyle(
             backport.text(messageID(),
                           cycle=int2roman(cycle.ordinalNumber),
                           time=timeStr))
         return text_styles.concatStylesWithSpace(icon, description)
     elif all(
         (q.isCompleted() for q in quests
          )) and self._eventProgression.isDailyQuestsRefreshAvailable():
         data = time_utils.ONE_DAY - time_utils.getServerRegionalTimeCurrentDay(
         )
         valueStyle = text_styles.tutorial
         timeToStr = valueStyle(
             getTimeStr(data, R.strings.menu.Time.timeLeftShort))
         icon = icons.clockGold()
         textStyle = text_styles.tutorial
         description = textStyle(
             backport.text(_R_EPIC_BATTLE.startIn(), time=timeToStr))
         return text_styles.concatStylesWithSpace(icon, description)
     else:
         getDate = lambda c: c.endDate
         messageID = _R_EPIC_BATTLE.timeLeft
         icon = icons.inProgress(vspace=-3)
         textStyle = text_styles.main
         valueStyle = text_styles.stats
         timeToStr = valueStyle(
             getTimeStr(
                 getDate(cycle) - currentTime,
                 R.strings.menu.Time.timeLeftShort))
         description = textStyle(
             backport.text(messageID(),
                           cycle=int2roman(cycle.ordinalNumber),
                           time=timeToStr))
         return text_styles.concatStylesWithSpace(icon, description)
Exemple #3
0
 def _getStatusBlock(cls, quest):
     isAvailable, reason = quest.isAvailable()
     if not isAvailable:
         if reason == 'noVehicle':
             key = TOOLTIPS.PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_NOVEHICLE
         else:
             key = TOOLTIPS.PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_NOTAVAILABLE
         text = text_styles.concatStylesWithSpace(icons.markerBlocked(-2),
                                                  text_styles.error(key))
     elif quest.isInProgress():
         if quest.isOnPause:
             text = text_styles.concatStylesWithSpace(
                 icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ONPAUSE,
                                    16, 16, -3, 8),
                 text_styles.playerOnline(
                     TOOLTIPS.
                     PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_ONPAUSE))
         elif quest.areTokensPawned():
             label = _ms(
                 TOOLTIPS.
                 PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_SHEETRECOVERYINPROGRESS,
                 icon=missions_helper.getHtmlAwardSheetIcon(
                     quest.getQuestBranch()),
                 count=quest.getPawnCost())
             text = text_styles.concatStylesWithSpace(
                 icons.inProgress(-1), text_styles.neutral(label))
         else:
             text = text_styles.concatStylesWithSpace(
                 icons.inProgress(-1),
                 text_styles.neutral(
                     TOOLTIPS.
                     PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_INPROGRESS))
     elif quest.isCompleted():
         if quest.areTokensPawned():
             text = text_styles.concatStylesWithSpace(
                 icons.checkmark(-2),
                 text_styles.bonusAppliedText(
                     TOOLTIPS.
                     PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_DONEFREESHEET),
                 missions_helper.getHtmlAwardSheetIcon(
                     quest.getQuestBranch()),
                 text_styles.stats('x%s' % quest.getPawnCost()))
         else:
             text = text_styles.concatStylesWithSpace(
                 icons.checkmark(-2),
                 text_styles.bonusAppliedText(
                     TOOLTIPS.PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_DONE))
     else:
         text = text_styles.main(
             TOOLTIPS.PERSONALMISSIONS_MAPREGION_FOOTER_TITLE_AVAILABLE)
     return formatters.packAlignedTextBlockData(
         text=text,
         align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
         padding=formatters.packPadding(top=-5, bottom=-5))
Exemple #4
0
 def _packProgressStateBlock(self):
     currentLevel = self._item.getLatestOpenedProgressionLevel(
         self.__vehicle)
     if currentLevel == -1 and self._progressionLevel == 1:
         currentLevel = 0
     if self._progressionLevel < 1:
         return None
     else:
         if currentLevel >= self._progressionLevel:
             desc = text_styles.concatStylesToSingleLine(
                 icons.checkmark(),
                 text_styles.bonusAppliedText(
                     getProgressionItemStatusText(self._progressionLevel)))
         elif currentLevel + 1 == self._progressionLevel:
             desc = text_styles.concatStylesToSingleLine(
                 icons.inProgress(),
                 text_styles.neutral(
                     backport.text(
                         R.strings.vehicle_customization.customization.
                         infotype.progression.inProgressState())))
         else:
             desc = text_styles.concatStylesToSingleLine(
                 icons.markerBlocked(),
                 text_styles.error(
                     backport.text(
                         R.strings.vehicle_customization.customization.
                         infotype.progression.notAvailableState.title())))
             desc = text_styles.concatStylesToMultiLine(
                 desc,
                 text_styles.main(
                     backport.text(
                         R.strings.vehicle_customization.customization.
                         infotype.progression.notAvailableState.desc())))
         return formatters.packAlignedTextBlockData(
             text=desc, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER)
def getQuestsDescriptionForHangarFlag(battleRoyaleController=None):
    quests = battleRoyaleController.getQuests()
    season = battleRoyaleController.getCurrentSeason(
    ) or battleRoyaleController.getNextSeason()
    currentTime = time_utils.getCurrentLocalServerTimestamp()
    cycle = season.getCycleInfo()
    if not battleRoyaleController.isActive() or cycle is None:
        return ''
    elif cycle.endDate - currentTime < time_utils.ONE_DAY:
        icon = icons.inProgress(vspace=-3)
        messageID = _R_BATTLE_ROYALE.timeLeft
        valueStyle = text_styles.stats
        timeStr = valueStyle(
            backport.text(R.strings.battle_royale.questsTooltip.lessThanDay()))
        textStyle = text_styles.main
        description = textStyle(
            backport.text(messageID(),
                          cycle=int2roman(cycle.ordinalNumber),
                          time=timeStr))
        return text_styles.concatStylesWithSpace(icon, description)
    elif all((q.isCompleted() for _, q in quests.items())):
        data = time_utils.ONE_DAY - time_utils.getServerRegionalTimeCurrentDay(
        )
        valueStyle = text_styles.tutorial
        timeToStr = valueStyle(
            getTimeStr(data, R.strings.menu.Time.timeLeftShort))
        icon = icons.clockGold()
        textStyle = text_styles.tutorial
        description = textStyle(
            backport.text(_R_BATTLE_ROYALE.startIn(), time=timeToStr))
        return text_styles.concatStylesWithSpace(icon, description)
    else:
        getDate = lambda c: c.endDate
        messageID = _R_BATTLE_ROYALE.timeLeft
        icon = icons.inProgress(vspace=-3)
        textStyle = text_styles.main
        valueStyle = text_styles.stats
        timeToStr = valueStyle(
            getTimeStr(
                getDate(cycle) - currentTime,
                R.strings.menu.Time.timeLeftShort))
        description = textStyle(
            backport.text(messageID(),
                          cycle=int2roman(cycle.ordinalNumber),
                          time=timeToStr))
        return text_styles.concatStylesWithSpace(icon, description)
Exemple #6
0
 def __packDescription(self, quests, season, isLeagues, isAnyPrimeNow,
                       isAnyPrimeLeftTotal):
     resShortCut = R.strings.ranked_battles.questsTooltip
     isAllCompleted = all((q.isCompleted() for q in quests))
     isAnyPrimeLeftNextDay = self.__rankedController.hasPrimeTimesNextDayLeft(
     )
     icon = icons.markerBlocked()
     timeDelta = time_utils.getTimeDeltaFromNowInLocal(
         time_utils.makeLocalServerTime(season.getEndDate()))
     timeDeltaStr = text_styles.stats(
         backport.getTillTimeStringByRClass(timeDelta,
                                            resShortCut.available))
     text = text_styles.main(
         backport.text(resShortCut.available(), timeDelta=timeDeltaStr))
     if not isAnyPrimeLeftTotal:
         text = text_styles.error(
             backport.getTillTimeStringByRClass(
                 timeDelta, resShortCut.unavailable.seasonEnd))
     elif not isLeagues:
         text = text_styles.error(
             backport.text(resShortCut.unavailable.notInLeagues()))
     elif not isAllCompleted:
         if isAnyPrimeNow:
             icon = icons.inProgress(vspace=-3)
         else:
             text = text_styles.error(
                 backport.text(resShortCut.unavailable.allServersPrime()))
     elif not isAnyPrimeLeftNextDay:
         icon = icons.inProgress(vspace=-3)
     else:
         icon = icons.clockGold()
         timeDelta = EventInfoModel.getDailyProgressResetTimeDelta()
         text = text_styles.tutorial(
             backport.getTillTimeStringByRClass(timeDelta,
                                                resShortCut.cooldown))
     return text_styles.concatStylesWithSpace(icon, text)
Exemple #7
0
 def requestMissionData(self, index):
     isObtained = not self._bootcamp.needAwarding()
     vehicleSelector = self.getComponent(QUESTS_ALIASES.MISSIONS_VEHICLE_SELECTOR_ALIAS)
     if vehicleSelector is not None:
         criteria = REQ_CRITERIA.VEHICLE.LEVELS([self._TANK_LEVEL]) | REQ_CRITERIA.IN_OWNERSHIP
         vehicleSelector.setCriteria(criteria, [])
     bTypesData = formatters.packMissionBonusTypeElements([ARENA_BONUS_TYPE.REGULAR])
     bTypes = self._COMMA.join([ iconData.iconLabel for iconData in bTypesData ])
     tooltipBody = makeString(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE_BODY, battleBonusTypes=bTypes)
     missionData = {'title': text_styles.promoSubTitle(backport.text(R.strings.bootcamp.quest.title())),
      'battleConditions': [{'rendererLinkage': MISSIONS_ALIASES.BATTLE_CONDITION,
                            'linkageBig': MISSIONS_ALIASES.ANG_GROUP_BIG_LINKAGE,
                            'isDetailed': True,
                            'data': [{'title': text_styles.promoSubTitle(backport.text(R.strings.bootcamp.quest.name())),
                                      'description': text_styles.highlightText(backport.text(R.strings.bootcamp.quest.condition())),
                                      'state': MISSIONS_ALIASES.NONE,
                                      'icon': backport.image(R.images.gui.maps.icons.quests.battleCondition.c_128.icon_battle_condition_battles_128x128()),
                                      'maxDescLines': self._LINES_IN_DESCR}],
                            'linkage': MISSIONS_ALIASES.ANG_GROUP_DETAILED_LINKAGE}],
      'statusLabel': text_styles.concatStylesWithSpace(icons.inProgress(), text_styles.standard(backport.text(R.strings.quests.missionDetails.missionsComplete(), count=text_styles.stats(self._MISSIONS_DONE), total=text_styles.standard(self._MISSIONS_COUNT)))),
      'awards': [{'label': text_styles.gold(backport.text(R.strings.menu.premium.packet.days3())),
                  'padding': self._AWARD_LABEL_PADDING,
                  'imgSource': backport.image(R.images.gui.maps.icons.quests.bonuses.big.premium_3()),
                  'align': LABEL_ALIGN.RIGHT,
                  'tooltip': TOOLTIPS.AWARDITEM_PREMIUM,
                  'obtainedImage': backport.image(R.images.gui.maps.icons.library.awardObtained()),
                  'isObtained': isObtained,
                  'obtainedImageOffset': self._OBTAINED_IMAGE_OFFSET}, {'label': text_styles.gold(self._GOLD_LABEL),
                  'padding': self._AWARD_LABEL_PADDING,
                  'imgSource': backport.image(R.images.gui.maps.icons.quests.bonuses.big.gold()),
                  'align': LABEL_ALIGN.RIGHT,
                  'tooltip': TOOLTIPS.AWARDITEM_GOLD,
                  'obtainedImage': backport.image(R.images.gui.maps.icons.library.awardObtained()),
                  'isObtained': isObtained,
                  'obtainedImageOffset': self._OBTAINED_IMAGE_OFFSET}],
      'background': 'default',
      'prebattleConditions': [formatters.packMissionPrebattleCondition(text_styles.main(bTypesData[0].iconLabel), ''.join([ iconData.icon for iconData in bTypesData ]), makeTooltip(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE, tooltipBody))],
      'uiDecoration': backport.image(R.images.gui.maps.icons.quests.decorations.default_750x264()),
      'statusTooltipData': {}}
     self.as_setMissionDataS(missionData)
     return
 def _getStatusBlock(self, operation):
     if not operation.isUnlocked():
         block = formatters.packBuildUpBlockData([
             formatters.packAlignedTextBlockData(
                 text=text_styles.concatStylesWithSpace(
                     icons.markerBlocked(-2),
                     text_styles.error(
                         TOOLTIPS.
                         PERSONALMISSIONS_OPERATION_FOOTER_TITLE_NOTAVAILABLE
                     )),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(top=-5)),
             formatters.packAlignedTextBlockData(
                 text=text_styles.main(
                     TOOLTIPS.
                     PERSONALMISSIONS_OPERATION_FOOTER_DESCR_DOPREVOPERATION
                 ),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(bottom=14))
         ])
     elif operation.isFullCompleted():
         block = formatters.packAlignedTextBlockData(
             text=text_styles.concatStylesWithSpace(
                 icons.doubleCheckmark(1),
                 text_styles.bonusAppliedText(
                     TOOLTIPS.
                     PERSONALMISSIONS_OPERATION_FOOTER_TITLE_EXCELLENTDONE)
             ),
             align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
             padding=formatters.packPadding(top=-5, bottom=12))
     elif operation.isAwardAchieved():
         data = [
             formatters.packAlignedTextBlockData(
                 text=text_styles.concatStylesWithSpace(
                     icons.checkmark(-2),
                     text_styles.bonusAppliedText(
                         TOOLTIPS.
                         PERSONALMISSIONS_OPERATION_FOOTER_TITLE_DONE)),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(top=-5))
         ]
         currentCount = operation.getFreeTokensCount()
         totalCount = operation.getFreeTokensTotalCount()
         if currentCount < totalCount:
             data.append(
                 formatters.packAlignedTextBlockData(
                     text=text_styles.concatStylesToSingleLine(
                         text_styles.main(
                             TOOLTIPS.
                             PERSONALMISSIONS_OPERATION_FOOTER_DESCR_FREESHEETS
                         ), missions_helper.AWARD_SHEET_ICON,
                         text_styles.bonusAppliedText(currentCount),
                         text_styles.main(' / %s' % totalCount)),
                     align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                     padding=formatters.packPadding(bottom=14)))
         else:
             currentCount = len(operation.getFullCompletedQuests(True))
             totalCount = operation.getQuestsCount()
             data.append(
                 formatters.packAlignedTextBlockData(
                     text=text_styles.concatStylesToSingleLine(
                         text_styles.main(
                             TOOLTIPS.
                             PERSONALMISSIONS_OPERATION_FOOTER_DESCR_QUESTSFULLYDONE
                         ), text_styles.bonusAppliedText(currentCount),
                         text_styles.main(' / %s' % totalCount)),
                     align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                     padding=formatters.packPadding(bottom=14)))
         block = formatters.packBuildUpBlockData(data)
     elif operation.isInProgress():
         currentCount, totalCount = operation.getTokensCount()
         block = formatters.packBuildUpBlockData([
             formatters.packAlignedTextBlockData(
                 text=text_styles.concatStylesWithSpace(
                     icons.inProgress(-1),
                     text_styles.neutral(
                         TOOLTIPS.
                         PERSONALMISSIONS_OPERATION_FOOTER_TITLE_INPROGRESS)
                 ),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(top=-5)),
             formatters.packAlignedTextBlockData(
                 text=text_styles.concatStylesToSingleLine(
                     text_styles.main(
                         TOOLTIPS.
                         PERSONALMISSIONS_OPERATION_FOOTER_DESCR_COMPLETIONTOKENS
                     ), text_styles.bonusAppliedText(currentCount),
                     text_styles.main(' / %s' % totalCount)),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(bottom=14))
         ])
     elif not operation.hasRequiredVehicles():
         block = formatters.packBuildUpBlockData([
             formatters.packAlignedTextBlockData(
                 text=text_styles.concatStylesWithSpace(
                     icons.markerBlocked(-2),
                     text_styles.error(
                         TOOLTIPS.
                         PERSONALMISSIONS_OPERATION_FOOTER_TITLE_NOTAVAILABLE
                     )),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(top=-5)),
             formatters.packAlignedTextBlockData(
                 text=text_styles.main(
                     TOOLTIPS.
                     PERSONALMISSIONS_OPERATION_FOOTER_DESCR_NOVEHICLE),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(bottom=14))
         ])
     else:
         block = formatters.packBuildUpBlockData([
             formatters.packAlignedTextBlockData(
                 text=text_styles.stats(
                     TOOLTIPS.
                     PERSONALMISSIONS_OPERATION_FOOTER_TITLE_AVAILABLE),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(top=-5)),
             formatters.packAlignedTextBlockData(
                 text=text_styles.main(
                     TOOLTIPS.
                     PERSONALMISSIONS_OPERATION_FOOTER_DESCR_SELECTQUEST),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 padding=formatters.packPadding(bottom=14))
         ])
     return block
    def __updateFooter(self):
        chainState = self.__getChainState(self.getChain())
        isQuestInProgress = False
        btnVisible = False
        btnEnabled = False
        btnLabel = ''
        descr = ''
        currentOperation = self.getOperation()
        chainClassifier = currentOperation.getChainClassifier(
            self.getChainID())
        vehicleClass = getTypeShortUserName(chainClassifier.classificationAttr)
        pm = self._eventsCache.getPersonalMissions()
        branch = self.getBranch()
        freeSheets = pm.getFreeTokensCount(branch)
        pawnedSheets = pm.getPawnedTokensCount(branch)
        if not chainState.hasUnlocked:
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(PERSONAL_MISSIONS.STATUSPANEL_STATUS_LOCKED))
        elif chainState.questInProgress is not None:
            quest = chainState.questInProgress
            if quest.isOnPause:
                status = text_styles.concatStylesWithSpace(
                    icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ONPAUSE,
                                       16, 16, -3, 8),
                    text_styles.playerOnline(quest.getUserName()))
            else:
                isQuestInProgress = True
                status = text_styles.concatStylesWithSpace(
                    icons.inProgress(),
                    text_styles.tutorial(quest.getUserName()))
            if quest.areTokensPawned():
                descr = text_styles.neutral(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_PAWNED,
                        count=quest.getPawnCost(),
                        icon=getHtmlAwardSheetIcon(quest.getQuestBranch())))
            elif quest.isMainCompleted():
                descr = text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_IMPROVE)
            elif quest.canBePawned() and not quest.isDisabled():
                btnVisible = True
                pawnCost = quest.getPawnCost()
                btnLabel = _ms(
                    PERSONAL_MISSIONS.STATUSPANEL_FREESHEETBTN_LABEL,
                    count=pawnCost,
                    icon=getHtmlAwardSheetIcon(quest.getQuestBranch()))
                if pawnCost <= freeSheets:
                    btnEnabled = True
        elif chainState.isFullCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.doubleCheckmark(1),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLEXCELLENTDONE,
                        vehicleClass=vehicleClass)))
        elif chainState.isCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.checkmark(-2),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLDONE,
                        vehicleClass=vehicleClass)))
        elif not chainState.hasVehicle:
            if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
                template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_PM2
            else:
                template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_REGULAR
            vehData = getChainVehRequirements(currentOperation,
                                              self.getChainID(),
                                              useIcons=False)
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(_ms(template, vehData=vehData)))
        else:
            status = text_styles.concatStylesWithSpace(
                icons.makeImageTag(
                    RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16,
                    -2),
                text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_SELECTTASK))
        tankwomanQuests = []
        for operation in pm.getAllOperations().itervalues():
            tankwomanQuests.extend(
                operation.getQuestsByFilter(
                    PersonalMission.needToGetTankWoman).itervalues())

        counterText = ''
        tankwomanVisible = False
        if tankwomanQuests:
            counterText = text_styles.highlightText('x%s' %
                                                    len(tankwomanQuests))
            tankwomanVisible = True
        self.as_setStatusDataS({
            'statusText': status,
            'descrText': descr,
            'btnVisible': btnVisible,
            'btnEnabled': btnEnabled,
            'btnLabel': btnLabel,
            'sheetsBlockData': {
                'freeSheetsIcon':
                AwardSheetPresenter.getIcon(AwardSheetPresenter.Size.MID),
                'freeSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_FREESHEETS,
                        count=text_styles.highlightText(freeSheets))),
                'pawnedSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_PAWNEDSHEETS,
                        count=text_styles.highlightText(pawnedSheets))),
                'tooltipData': {
                    'isSpecial':
                    True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.FREE_SHEET_RETURN if freeSheets
                    or pawnedSheets else TOOLTIPS_CONSTANTS.FREE_SHEET,
                    'specialArgs': [currentOperation.getCampaignID()]
                },
                'popover':
                PERSONAL_MISSIONS_ALIASES.FREE_SHEET_POPOVER,
                'popoverData': {
                    'branch': branch
                }
            },
            'tankgirlsBlockData': {
                'counterText': counterText,
                'visible': tankwomanVisible,
                'tooltipData': {
                    'isSpecial': True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.PERSONAL_MISSIONS_TANKWOMAN,
                    'specialArgs': []
                },
                'popover': PERSONAL_MISSIONS_ALIASES.TANK_GIRLS_POPOVER
            },
            'tooltip': None,
            'isQuestInProgress': isQuestInProgress
        })
        return
Exemple #10
0
 def makeLabel(key):
     return text_styles.neutral(icons.inProgress() + _ms(key))
    def __updateFooter(self):
        chainState = self.__getChainState(self.getChain())
        isQuestInProgress = False
        btnVisible = False
        btnEnabled = False
        btnLabel = ''
        descr = ''
        currentOperation = self.getOperation()
        currentVehicleType = currentOperation.getChainVehicleClass(
            self.getChainID())
        vehicleClass = getTypeShortUserName(currentVehicleType)
        pm = self._eventsCache.personalMissions
        freeSheets = pm.getFreeTokensCount()
        pawnedSheets = pm.getPawnedTokensCount()
        if not chainState.hasUnlocked:
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(PERSONAL_MISSIONS.STATUSPANEL_STATUS_LOCKED))
        elif chainState.questInProgress is not None:
            quest = chainState.questInProgress
            isQuestInProgress = True
            status = text_styles.concatStylesWithSpace(
                icons.inProgress(), text_styles.tutorial(quest.getUserName()))
            if quest.areTokensPawned():
                descr = text_styles.neutral(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_PAWNED,
                        count=quest.getPawnCost(),
                        icon=icons.makeImageTag(
                            RES_ICONS.
                            MAPS_ICONS_PERSONALMISSIONS_SHEET_RECEIVED_SMALL,
                            16, 16, -3, 8)))
            elif quest.isMainCompleted():
                descr = text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_IMPROVE)
            elif quest.canBePawned():
                btnVisible = True
                pawnCost = quest.getPawnCost()
                btnLabel = _ms(
                    PERSONAL_MISSIONS.STATUSPANEL_FREESHEETBTN_LABEL,
                    count=pawnCost,
                    icon=icons.makeImageTag(
                        RES_ICONS.
                        MAPS_ICONS_PERSONALMISSIONS_SHEET_RECEIVED_SMALL, 16,
                        16, -3, 8))
                if pawnCost <= freeSheets:
                    btnEnabled = True
        elif chainState.isFullCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.checkmark(-2),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLEXCELLENTDONE,
                        vehicleClass=vehicleClass)))
        elif chainState.isCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.checkmark(-2),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLDONE,
                        vehicleClass=vehicleClass)))
        elif not chainState.hasVehicle:
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_NOVEHICLE,
                        vehicleClass=vehicleClass)))
        else:
            status = text_styles.concatStylesWithSpace(
                icons.makeImageTag(
                    RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16,
                    -2),
                text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_SELECTTASK))

        def tankwomanFilter(quest):
            tankman, isMainBonus = quest.getTankmanBonus()
            return tankman and (quest.needToGetAddReward() and not isMainBonus
                                or quest.needToGetMainReward() and isMainBonus)

        tankwomanQuests = []
        for operation in pm.getOperations().itervalues():
            tankwomanQuests.extend(
                operation.getQuestsByFilter(tankwomanFilter).itervalues())

        counterText = ''
        tankwomanVisible = False
        if tankwomanQuests:
            counterText = text_styles.highlightText('x%s' %
                                                    len(tankwomanQuests))
            tankwomanVisible = True
        self.as_setStatusDataS({
            'statusText': status,
            'descrText': descr,
            'btnVisible': btnVisible,
            'btnEnabled': btnEnabled,
            'btnLabel': btnLabel,
            'sheetsBlockData': {
                'freeSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_FREESHEETS,
                        count=text_styles.highlightText(freeSheets))),
                'pawnedSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_PAWNEDSHEETS,
                        count=text_styles.highlightText(pawnedSheets))),
                'tooltipData': {
                    'isSpecial':
                    True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.FREE_SHEET_RETURN if freeSheets
                    or pawnedSheets else TOOLTIPS_CONSTANTS.FREE_SHEET,
                    'specialArgs': []
                },
                'popover':
                PERSONAL_MISSIONS_ALIASES.FREE_SHEET_POPOVER
            },
            'tankgirlsBlockData': {
                'counterText': counterText,
                'visible': tankwomanVisible,
                'tooltipData': {
                    'isSpecial': True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.PERSONAL_MISSIONS_TANKWOMAN,
                    'specialArgs': []
                },
                'popover': PERSONAL_MISSIONS_ALIASES.TANK_GIRLS_POPOVER
            },
            'tooltip': None,
            'isQuestInProgress': isQuestInProgress
        })
        return