Exemplo n.º 1
0
 def _packStatusBlock(self, data):
     status = ''
     if data['status'] == STATUS.ON_BOARD:
         status = text_styles.statInfo(
             _ms('#vehicle_customization:customization/tooltip/status/onBoard'
                 ))
     elif data['status'] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(
             _ms('#vehicle_customization:customization/tooltip/status/alreadyHave'
                 ))
     elif data['status'] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(
             _ms('#vehicle_customization:customization/tooltip/status/availableForBuy'
                 ))
     elif data['status'] == STATUS.DO_MISSION:
         status = text_styles.warning(
             _ms('#vehicle_customization:customization/tooltip/status/doMission'
                 ))
     elif data['status'] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(text=makeHtmlString(
         'html_templates:lobby/textStyle', 'alignText', {
             'align': 'center',
             'message': status
         }),
                                         padding={
                                             'bottom': -4,
                                             'top': -4
                                         })
Exemplo n.º 2
0
 def _getStatusBlock(division, isLocked, isCompleted):
     statusTitle = text_styles.warning(
         backport.text(
             R.strings.ranked_battles.division.tooltip.status.current()))
     statusText = None
     if division.isQualification():
         statusTitle = text_styles.warning(
             backport.text(R.strings.ranked_battles.division.tooltip.status.
                           currentQual()))
     if isLocked:
         statusTitle = text_styles.critical(
             backport.text(
                 R.strings.ranked_battles.division.tooltip.status.locked()))
         statusText = text_styles.standard(
             backport.text(R.strings.ranked_battles.division.tooltip.status.
                           locked.desc()))
         if division.isPostQualification():
             statusText = text_styles.standard(
                 backport.text(R.strings.ranked_battles.division.tooltip.
                               status.locked.descQual()))
     if isCompleted:
         statusTitle = text_styles.statInfo(
             backport.text(R.strings.ranked_battles.division.tooltip.status.
                           completed()))
         if division.isQualification():
             statusTitle = text_styles.statInfo(
                 backport.text(R.strings.ranked_battles.division.tooltip.
                               status.completedQual()))
     return formatters.packImageTextBlockData(
         title=statusTitle,
         desc=statusText,
         txtPadding=formatters.packPadding(left=10))
Exemplo n.º 3
0
 def __getQuestStatusData(self, quest):
     if not quest.isUnlocked():
         return (text_styles.standard(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_UNAVAILABLE_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_NOTAVAILABLEICON)
     if quest.needToGetReward():
         return (text_styles.alert(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_AWARDNOTRECEIVED_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICON)
     if quest.isInProgress():
         return (text_styles.neutral(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_INPROGRESS_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_INPROGRESSICON)
     if quest.isFullCompleted():
         return (text_styles.statInfo(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_FULLCOMPLETED_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_CHECKMARK)
     if quest.isMainCompleted():
         return (text_styles.statInfo(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_COMPLETED_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_CHECKMARK)
     return (text_styles.main(''), None)
Exemplo n.º 4
0
 def _packStatusBlock(self, data):
     status = ''
     if data['status'] == STATUS.ON_BOARD:
         status = text_styles.statInfo(_ms('#vehicle_customization:customization/tooltip/status/onBoard'))
     elif data['status'] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(_ms('#vehicle_customization:customization/tooltip/status/alreadyHave'))
     elif data['status'] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(_ms('#vehicle_customization:customization/tooltip/status/availableForBuy'))
     elif data['status'] == STATUS.DO_MISSION:
         status = text_styles.warning(_ms('#vehicle_customization:customization/tooltip/status/doMission'))
     elif data['status'] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(text=makeHtmlString('html_templates:lobby/textStyle', 'alignText', {'align': 'center',
      'message': status}), padding={'bottom': -4,
      'top': -4})
 def __packStatusBlock(self):
     if self.__vehicle.isUnlocked:
         status = text_styles.statInfo(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_UNLOCKEDSTATUS)
     elif self.__blueprintData.filledCount == 0:
         status = text_styles.warning(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_EMPTYSTATUS)
     elif self.__blueprintData.filledCount == self.__blueprintData.totalCount:
         status = text_styles.statInfo(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_COMPLETESTATUS)
     else:
         status = text_styles.statusAttention(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_INCOMPLETESTATUS)
     status = text_styles.alignText(status, 'center')
     return formatters.packTextBlockData(text=status)
Exemplo n.º 6
0
 def _packStatusBlock(self, item):
     status = ''
     if item['status'] == STATUS.ON_BOARD:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ONBOARD))
     elif item['status'] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ALREADYHAVE))
     elif item['status'] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_AVAILABLEFORBUY))
     elif item['status'] == STATUS.DO_MISSION:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_DOMISSION))
     elif item['status'] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(text=makeHtmlString('html_templates:lobby/textStyle', 'alignText', {'align': 'center',
      'message': status}), padding={'bottom': -4,
      'top': -4})
Exemplo n.º 7
0
 def __packStatusBlock(self):
     result = []
     if self.item.isQualification():
         if self.item.isCurrent():
             status = text_styles.warning(
                 backport.text(R.strings.tooltips.battleTypes.ranked.rank.
                               status.qualificationNotEarned()))
         else:
             status = text_styles.statInfo(
                 backport.text(R.strings.tooltips.battleTypes.ranked.rank.
                               status.receivedQualification()))
     elif self.item.isAcquired():
         status = text_styles.statInfo(
             backport.text(R.strings.tooltips.battleTypes.ranked.rank.
                           status.received()))
     elif self.item.isLost():
         status = text_styles.statusAlert(
             backport.text(
                 R.strings.tooltips.battleTypes.ranked.rank.status.lost()))
     else:
         status = text_styles.warning(
             backport.text(R.strings.tooltips.battleTypes.ranked.rank.
                           status.notearned()))
     result.append(
         formatters.packAlignedTextBlockData(
             status,
             BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT,
             padding=formatters.packPadding(top=-4)))
     division = self.item.getDivision()
     if not division.isCurrent() and not division.isCompleted():
         result.append(
             formatters.packTextBlockData(
                 text_styles.main(
                     backport.text(R.strings.tooltips.battleTypes.ranked.
                                   rank.anotherDivision(),
                                   division=division.getUserName()))))
     if self.item.isQualification() and self.item.isCurrent():
         result.append(
             formatters.packTextBlockData(
                 text_styles.main(
                     backport.text(R.strings.tooltips.battleTypes.ranked.
                                   rank.conditions.qualification(),
                                   count=self.rankedController.
                                   getTotalQualificationBattles()))))
     if not self.item.isAcquired():
         result.append(formatters.packTextBlockData(
             self.__packStepsBlock()))
     return result
Exemplo n.º 8
0
 def __getCurrentCycleVehicleRankRow(self):
     isMaxRank = self.__currentRank == self.rankedController.getMaxRank()
     isAccountMastered = self.rankedController.isAccountMastered()
     if isAccountMastered:
         status = _ts.statInfo(
             RANKED_BATTLES.
             RANKEDBATTLESCYCLESVIEW_CURRENTCYCLE_VEHICLERANKCOMMENT)
     else:
         status = ''
     if isAccountMastered and not isMaxRank:
         vehicleRank = self.__currentRank
     else:
         vehicleRank = first(
             self.rankedController.getVehicleRanksChain(
                 g_currentVehicle.item))
     rankIcon = {
         'imageSrc':
         RES_ICONS.MAPS_ICONS_RANKEDBATTLES_ICON_FINAL_CUP_100X100,
         'isEnabled': True,
         'rankID': str(self.rankedController.getAccRanksTotal() + 1)
     }
     return {
         'rankIcon': rankIcon,
         'rankDescr': '',
         'rankAwards': vehicleRank.getAwardsVOs(),
         'receivedStatus': status,
         'isCurrent': False,
         'rankNumber': ''
     }
Exemplo n.º 9
0
 def __packRankRow(self, rank):
     rankIcon = {
         'imageSrc': rank.getIcon('small'),
         'isEnabled': rank.isAcquired(),
         'rankID': str(rank.getID())
     }
     rankAwards = rank.getAwardsVOs()
     if rank.getQuest():
         rankAwards = getRankedQuestsOrderedAwards([rank.getQuest()])
     if rank.isRewardClaimed() and rank.getQuest():
         receivedStr = ''.join([
             makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_OKICON),
             _ts.statInfo(
                 RANKED_BATTLES.
                 RANKEDBATTLESCYCLESVIEW_CURRENTCYCLE_ITEM_AWARDRECIEVED)
         ])
     else:
         receivedStr = ''
     rankID = rank.getID()
     isCurrent = rankID == self.__currentAccRank.getID()
     if rank.isMax() and rankID != 1:
         rankDescr = _ts.main(
             RANKED_BATTLES.RANKEDBATTLEVIEW_PROGRESSBLOCK_BESTRANK)
     else:
         rankDescr = ''
     return {
         'rankIcon': rankIcon,
         'rankDescr': rankDescr,
         'rankAwards': rankAwards,
         'receivedStatus': receivedStr,
         'isCurrent': isCurrent,
         'rankNumber': _ts.main(str(rankID))
     }
Exemplo n.º 10
0
 def __getMultiselectionInfoVO(self):
     allowedLevels = self.falloutCtrl.getConfig().allowedLevels
     showSlots, message = self.__getMultiselectionStatus()
     result = self.prbEntity.canPlayerDoAction()
     if result.isValid:
         statusString = text_styles.statInfo(
             '#fallout:multiselectionSlot/groupReady')
     else:
         statusString = text_styles.critical(
             '#fallout:multiselectionSlot/groupNotReady')
     return {
         'formattedMessage':
         message,
         'showSlots':
         showSlots,
         'indicatorIsEnabled':
         result.isValid,
         'vehicleTypes':
         text_styles.concatStylesWithSpace(
             text_styles.middleTitle(
                 i18n.makeString(
                     '#fallout:multiselectionSlot/selectionStatus')),
             text_styles.main(
                 i18n.makeString(
                     '#fallout:multiselectionSlot/selectionRequirements',
                     level=toRomanRangeString(allowedLevels, step=1)))),
         'statusSrt':
         statusString
     }
Exemplo n.º 11
0
 def __packStatusBlock(self, status):
     statusBlock = []
     statusDyn = R.strings.ranked_battles.yearRewards.tooltip.status.dyn(
         status)
     statusStr = backport.text(statusDyn.title())
     if status in (_RBC.YEAR_REWARD_STATUS_PASSED,
                   _RBC.YEAR_REWARD_STATUS_PASSED_FINAL):
         statusStr = text_styles.warning(statusStr)
     elif status in (_RBC.YEAR_REWARD_STATUS_CURRENT,
                     _RBC.YEAR_REWARD_STATUS_CURRENT_FINAL):
         statusStr = text_styles.statInfo(statusStr)
     else:
         statusStr = text_styles.critical(statusStr)
     statusBlock.append(
         formatters.packAlignedTextBlockData(
             statusStr,
             BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
             padding=formatters.packPadding(top=-4)))
     statusBlock.append(
         formatters.packAlignedTextBlockData(
             text_styles.main(backport.text(statusDyn.description())),
             BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
             padding=formatters.packPadding(top=2, bottom=-2)))
     return formatters.packBuildUpBlockData(
         statusBlock,
         linkage=BLOCKS_TOOLTIP_TYPES.
         TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
         align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER)
Exemplo n.º 12
0
 def __updateMultiselectionData(self):
     falloutCfg = self.__falloutCtrl.getConfig()
     showSlots, msg = self.__getMultiselectionStatus()
     canDo, _ = self.prbDispatcher.canPlayerDoAction()
     data = {
         'multiSelectionIsEnabled':
         self.__multiselectionMode,
         'formattedMessage':
         msg,
         'showSlots':
         showSlots,
         'slots':
         self.__getMultiselectionSlots(),
         'indicatorIsEnabled':
         canDo,
         'vehicleTypes':
         middleTitle(
             i18n.makeString(FALLOUT.MULTISELECTIONSLOT_SELECTIONSTATUS)) +
         ' ' + main(
             i18n.makeString(
                 FALLOUT.MULTISELECTIONSLOT_SELECTIONREQUIREMENTS,
                 level=toRomanRangeString(list(falloutCfg.allowedLevels),
                                          1))),
         'statusSrt':
         statInfo(FALLOUT.MULTISELECTIONSLOT_GROUPREADY)
         if canDo else critical(FALLOUT.MULTISELECTIONSLOT_GROUPNOTREADY)
     }
     self.as_setMultiselectionModeS(data)
 def __getCurrentCycleRankRow(self, rank):
     rankIcon = {
         'imageSrc': rank.getIcon('small'),
         'isEnabled': rank.isAcquired(),
         'rankID': str(rank.getID())
     }
     rankAwards = []
     if rank.isRewardClaimed() and rank.getQuest():
         receivedStr = ''.join([
             makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_OKICON),
             text_styles.statInfo(
                 RANKED_BATTLES.
                 RANKEDBATTLESCYCLESVIEW_CURRENTCYCLE_ITEM_AWARDRECIEVED)
         ])
     else:
         receivedStr = ''
         rankAwards = rank.getAwardsVOs()
     if rank.isMax() and rank.getID() != 1:
         rankDescr = text_styles.main(
             RANKED_BATTLES.RANKEDBATTLEVIEW_PROGRESSBLOCK_BESTRANK)
     else:
         rankDescr = ''
     return {
         'awardReceived': receivedStr,
         'points': str(rank.getPoints()),
         'rankIcon': rankIcon,
         'rankDescr': rankDescr,
         'rankAwards': rankAwards,
         'cycleAwards': rank.getAwardsVOs(forCycleFinish=True)
     }
Exemplo n.º 14
0
 def __getObtainedStatus(self, isAlliance):
     return text_styles.concatStylesWithSpace(
         icons.checkmark(-2),
         text_styles.statInfo(
             PERSONAL_MISSIONS.TANKMODULETOOLTIPDATA_STATUS_OBTAINED
             if not isAlliance else PERSONAL_MISSIONS.
             TANKMODULETOOLTIPDATA_STATUS_ALLIANCE_OBTAINED))
Exemplo n.º 15
0
    def __getAwardsData(self, points, rewardingComplete, isAwarded):
        data = []
        awardsMap = self.__rankedController.getYearAwardsPointsMap()
        for awardName in YEAR_AWARDS_ORDER:
            minPoints, maxPoints = awardsMap[awardName]
            statusText = None
            if points > maxPoints:
                status = _RBC.YEAR_REWARD_STATUS_PASSED_FINAL if rewardingComplete else _RBC.YEAR_REWARD_STATUS_PASSED
            elif maxPoints >= points >= minPoints:
                selectableRewardsCount = self.__rankedController.getYearRewardCount()
                if selectableRewardsCount:
                    status = _RBC.YEAR_REWARD_STATUS_CURRENT_CHOOSE
                    statusText = backport.text(R.strings.ranked_battles.rewardsView.tabs.year.currentChoose())
                    self.as_setChooseRewardBtnCounterS(str(selectableRewardsCount))
                elif rewardingComplete:
                    status = _RBC.YEAR_REWARD_STATUS_CURRENT_FINAL
                    statusText = text_styles.statInfo(backport.text(R.strings.ranked_battles.rewardsView.tabs.year.currentFinal()))
                else:
                    status = _RBC.YEAR_REWARD_STATUS_CURRENT
                    statusText = text_styles.statusAlert(backport.text(R.strings.ranked_battles.rewardsView.tabs.year.current()))
            else:
                status = _RBC.YEAR_REWARD_STATUS_LOCKED_FINAL if rewardingComplete else _RBC.YEAR_REWARD_STATUS_LOCKED
            pointsVO = {}
            if not isAwarded:
                pointsVO = {'text': text_styles.promoTitle(minPoints),
                 'image': backport.image(R.images.gui.maps.icons.rankedBattles.ranked_point_28x28())}
            data.append({'id': awardName,
             'status': status,
             'statusText': statusText,
             'points': pointsVO})

        return data
Exemplo n.º 16
0
 def _packStatusBlock(self, item):
     status = ""
     if item["status"] == STATUS.ON_BOARD:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ONBOARD))
     elif item["status"] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ALREADYHAVE))
     elif item["status"] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_AVAILABLEFORBUY))
     elif item["status"] == STATUS.DO_MISSION:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_DOMISSION))
     elif item["status"] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(
         text=makeHtmlString("html_templates:lobby/textStyle", "alignText", {"align": "center", "message": status}),
         padding={"bottom": -4, "top": -4},
     )
Exemplo n.º 17
0
 def _packBlocks(self, *args, **kwargs):
     self.__isReceived = bool(args[1])
     items = super(NyDecorationWithStatusTooltipData,
                   self)._packBlocks(*args, **kwargs)
     if self.__isReceived:
         statusText = text_styles.concatStylesWithSpace(
             icons.makeImageTag(RES_ICONS.MAPS_ICONS_NY_ICONS_CHECK,
                                width=24,
                                height=24,
                                vSpace=-6,
                                hSpace=-2),
             text_styles.statInfo(
                 NY.COLLECTIONS_TOOLTIP_DECORATION_OBTAINED))
         statusPadding = formatters.packPadding(left=4, top=-12, bottom=-14)
     else:
         statusText = text_styles.concatStylesWithSpace(
             text_styles.critical(
                 NY.COLLECTIONS_TOOLTIP_DECORATION_NOTOBTAINED))
         statusPadding = formatters.packPadding(left=16, top=-8, bottom=-10)
     bottomBuildUpBlock = [
         formatters.packAlignedTextBlockData(
             text=statusText,
             align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
             padding=statusPadding)
     ]
     items.append(formatters.packBuildUpBlockData(bottomBuildUpBlock))
     return items
Exemplo n.º 18
0
 def __buildStatusBlock(self):
     if self.__isForVehicleRank():
         maxRank = self.rankedController.getMaxRank(
             vehicle=self.item.getVehicle())
         achievedCount = '0'
         if maxRank is not None and maxRank.getType() == RANK_TYPES.VEHICLE:
             achievedCount = maxRank.getSerialID()
         vehicleName = self.item.getVehicle().userName
         achievedStr = text_styles.middleTitle(achievedCount)
         descr = text_styles.main(
             _ms(TOOLTIPS.BATTLETYPES_RANKED_VEHRANK_ACHIEVEDCOUNT,
                 vehName=vehicleName))
         descr = descr + achievedStr
         return formatters.packCounterTextBlockData(
             achievedCount,
             descr,
             padding=formatters.packPadding(left=3, bottom=-5))
     else:
         if self.item.isAcquired():
             status = text_styles.statInfo(
                 TOOLTIPS.BATTLETYPES_RANKED_RANK_STATUS_RECEIVED)
         elif self.item.isLost():
             status = text_styles.statusAlert(
                 TOOLTIPS.BATTLETYPES_RANKED_RANK_STATUS_LOST)
         else:
             status = text_styles.warning(
                 TOOLTIPS.BATTLETYPES_RANKED_RANK_STATUS_NOTEARNED)
         return formatters.packAlignedTextBlockData(
             status,
             BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT,
             padding=formatters.packPadding(top=-4))
Exemplo n.º 19
0
 def _packReceivedBlock(self, winEarnedCount, loseEarnedCount):
     block = []
     block.append(
         self._getConditionHeaderBlock(
             strValue=RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS_HEADER))
     if winEarnedCount > 0:
         winIcon = RES_ICONS.getRankedTooltipTopIcon(winEarnedCount)
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     _ms(RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS,
                         battlesNum=winEarnedCount,
                         team=text_styles.statInfo(
                             RANKED_BATTLES.TOOLTIP_STEP_WINNERS))),
                 img=winIcon,
                 txtPadding=formatters.packPadding(left=17)))
     if winEarnedCount > 0 and loseEarnedCount > 0:
         block.append(
             self._getOrBlock(
                 padding=formatters.packPadding(left=70, bottom=10)))
     if loseEarnedCount > 0:
         loseIcon = RES_ICONS.getRankedTooltipLoseIcon(loseEarnedCount)
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     _ms(RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS,
                         battlesNum=loseEarnedCount,
                         team=text_styles.critical(
                             RANKED_BATTLES.TOOLTIP_STEP_LOSERS))),
                 img=loseIcon,
                 txtPadding=formatters.packPadding(left=17)))
     return formatters.packBuildUpBlockData(
         block, 0,
         BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
Exemplo n.º 20
0
 def _packAwardsBlock(self, quest):
     subBlocks = []
     if quest.isCompleted():
         middleTitle = formatters.packImageTextBlockData(
             title=text_styles.statInfo(
                 TOOLTIPS.BATTLETYPES_RANKED_RANK_AWARD_RECEIVED),
             img=RES_ICONS.MAPS_ICONS_BUTTONS_CHECKMARK,
             imgPadding=formatters.packPadding(left=2, top=3),
             txtOffset=20)
     else:
         middleTitle = formatters.packTextBlockData(
             text_styles.middleTitle(
                 TOOLTIPS.BATTLETYPES_RANKED_RANK_REWARD))
     listData = self.item.getAwardsVOs()
     awardsWidth = len(listData) * _AWARD_STEP
     if awardsWidth < _TOOLTIP_MIN_WIDTH:
         awardsWidth = _TOOLTIP_MIN_WIDTH
     else:
         awardsWidth += _AWARDS_RIGHT_PADDING
     self._setWidth(awardsWidth)
     subBlocks.append(middleTitle)
     subBlocks.append(
         formatters.packGroupBlockData(
             listData, padding=formatters.packPadding(top=15)))
     return subBlocks
Exemplo n.º 21
0
 def _getStatusData(self):
     message = ''
     if self.vehicleStats.battleCnt:
         message = text_styles.statInfo(backport.text(R.strings.session_stats.tankInfo.status.total(), total=self.vehicleStats.battleCnt))
     else:
         message = text_styles.warning(backport.text(R.strings.session_stats.tankInfo.status.warning()))
     return TankStatusVO(status=message)
Exemplo n.º 22
0
 def __packAwardsBlock(self, quest):
     subBlocks = []
     if quest.isCompleted():
         middleTitle = formatters.packImageTextBlockData(
             title=text_styles.statInfo(
                 backport.text(R.strings.tooltips.battleTypes.ranked.rank.
                               award.received())),
             img=backport.image(
                 R.images.gui.maps.icons.buttons.checkmark()),
             imgPadding=formatters.packPadding(left=2, top=3),
             txtOffset=20)
     else:
         if quest.isQualificationQuest():
             middleTitleText = backport.text(
                 R.strings.tooltips.battleTypes.ranked.rank.
                 qualificationReward(),
                 count=quest.getQualificationBattlesCount())
         else:
             middleTitleText = backport.text(
                 R.strings.tooltips.battleTypes.ranked.rank.reward())
         middleTitle = formatters.packTextBlockData(
             text_styles.middleTitle(middleTitleText))
     listData = getRankedAwardsFormatter().getFormattedBonuses(
         quest.getBonuses())
     awardsWidth = len(listData) * _AWARD_STEP
     if awardsWidth < _TOOLTIP_MIN_WIDTH:
         awardsWidth = _TOOLTIP_MIN_WIDTH
     else:
         awardsWidth += _AWARDS_RIGHT_PADDING
     self._setWidth(awardsWidth)
     subBlocks.append(middleTitle)
     subBlocks.append(
         formatters.packGroupBlockData(
             listData, padding=formatters.packPadding(top=15)))
     return subBlocks
Exemplo n.º 23
0
 def __getStatus(self, itemPrice):
     if itemPrice.price.gold == 0:
         statusText = text_styles.statInfo(
             backport.text(_RScopeTradeIn.personaltradeOffPriceText()))
         isFreeExchange = True
     else:
         statusText = backport.text(_RScopeTradeIn.tradeOffPriceText())
         isFreeExchange = False
     return (statusText, isFreeExchange)
Exemplo n.º 24
0
 def __packStatusBlock(self):
     if self.__blueprintData.filledCount == 0:
         status = text_styles.warning(TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_EMPTYSTATUS)
     elif self.__blueprintData.filledCount == self.__blueprintData.totalCount:
         status = text_styles.statInfo(TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_COMPLETESTATUS)
     else:
         status = text_styles.statusAttention(TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_INCOMPLETESTATUS)
     status = text_styles.alignText(status, 'center')
     return formatters.packTextBlockData(text=status, padding=formatters.packPadding(top=5, bottom=-3))
 def _packBlocks(self, *args):
     tooltipBlocks = super(ReserveTooltipData, self)._packBlocks()
     reserves = self._getData().getReserve()
     isPlayerLegionary = self._getEntity().getPlayerInfo().isLegionary()
     reserveId = args[0]
     reserve = reserves.getReserveById(reserveId)
     reserveName = getReserveNameVO(reserve.getType())
     reserveLevel = reserve.getLevel()
     selected = reserve in reserves.getSelectedReserves()
     reserveCount = reserves.getReserveCount(reserve.getType(),
                                             reserve.getLevel())
     if selected:
         reserveCount -= 1
     if reserve.intCD is None:
         _logger.error('%s intCD is None! Check wgsh version on staging.',
                       reserveName)
         return tooltipBlocks
     else:
         item = self.context.buildItem(reserve.intCD)
         tooltipBlocks.append(
             self.__getHeaderBlock(item, reserveName, reserveLevel,
                                   reserveCount, isPlayerLegionary))
         tooltipBlocks.append(
             formatters.packBuildUpBlockData(
                 self.__getMainParamsBlock(reserveName, item),
                 padding=formatters.packPadding(left=10,
                                                right=10,
                                                top=-4,
                                                bottom=-2),
                 linkage=BLOCKS_TOOLTIP_TYPES.
                 TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
                 gap=-2,
                 blockWidth=450))
         tooltipBlocks.append(
             formatters.packBuildUpBlockData(
                 self.__getAdditionalParamsBlock(reserve),
                 padding=formatters.packPadding(left=10,
                                                right=10,
                                                top=-4,
                                                bottom=-2),
                 gap=-2))
         if selected:
             status = R.strings.fortifications.reserves.tooltip.selected()
         else:
             status = R.strings.fortifications.reserves.tooltip.readyToSelect(
             )
         tooltipBlocks.append(
             formatters.packAlignedTextBlockData(
                 text_styles.statInfo(backport.text(status)),
                 align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
                 blockWidth=430,
                 padding=formatters.packPadding(left=10,
                                                right=10,
                                                top=-7,
                                                bottom=-7)))
         return tooltipBlocks
Exemplo n.º 26
0
 def __updateMultiselectionData(self):
     falloutCfg = self.__falloutCtrl.getConfig()
     showSlots, msg = self.__getMultiselectionStatus()
     canDo, _ = self.prbDispatcher.canPlayerDoAction()
     data = {'multiSelectionIsEnabled': self.__multiselectionMode,
      'formattedMessage': msg,
      'showSlots': showSlots,
      'slots': self.__getMultiselectionSlots(),
      'indicatorIsEnabled': canDo,
      'vehicleTypes': middleTitle(i18n.makeString(FALLOUT.MULTISELECTIONSLOT_SELECTIONSTATUS)) + ' ' + main(i18n.makeString(FALLOUT.MULTISELECTIONSLOT_SELECTIONREQUIREMENTS, level=toRomanRangeString(list(falloutCfg.allowedLevels), 1))),
      'statusSrt': statInfo(FALLOUT.MULTISELECTIONSLOT_GROUPREADY) if canDo else critical(FALLOUT.MULTISELECTIONSLOT_GROUPNOTREADY)}
     self.as_setMultiselectionModeS(data)
Exemplo n.º 27
0
 def __getMultiselectionInfoVO(self):
     allowedLevels = self._falloutCtrl.getConfig().allowedLevels
     showSlots, message = self.__getMultiselectionStatus()
     canDoAction, _ = self.prbDispatcher.canPlayerDoAction()
     if canDoAction:
         statusString = text_styles.statInfo('#fallout:multiselectionSlot/groupReady')
     else:
         statusString = text_styles.critical('#fallout:multiselectionSlot/groupNotReady')
     return {'formattedMessage': message,
      'showSlots': showSlots,
      'indicatorIsEnabled': canDoAction,
      'vehicleTypes': text_styles.concatStylesWithSpace(text_styles.middleTitle(i18n.makeString('#fallout:multiselectionSlot/selectionStatus')), text_styles.main(i18n.makeString('#fallout:multiselectionSlot/selectionRequirements', level=toRomanRangeString(allowedLevels, step=1)))),
      'statusSrt': statusString}
Exemplo n.º 28
0
 def __getQuestStatusData(self, quest):
     if not quest.isUnlocked():
         return (text_styles.standard(
             _ms(QUESTS.TILECHAINSVIEW_TASKTYPE_UNAVAILABLE_TEXT)),
                 RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_NOTAVAILABLEICON)
     if quest.needToGetReward():
         return (text_styles.alert(
             _ms(QUESTS.TILECHAINSVIEW_TASKTYPE_AWARDNOTRECEIVED_TEXT)),
                 RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICON)
     if quest.isInProgress():
         return (text_styles.neutral(
             _ms(QUESTS.TILECHAINSVIEW_TASKTYPE_INPROGRESS_TEXT)),
                 RES_ICONS.MAPS_ICONS_LIBRARY_INPROGRESSICON)
     if quest.isFullCompleted():
         return (text_styles.statInfo(
             _ms(QUESTS.TILECHAINSVIEW_TASKTYPE_FULLCOMPLETED_TEXT)),
                 RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_CHECKMARK)
     if quest.isMainCompleted():
         return (text_styles.statInfo(
             _ms(QUESTS.TILECHAINSVIEW_TASKTYPE_COMPLETED_TEXT)),
                 RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_CHECKMARK)
     return (text_styles.main(''), None)
Exemplo n.º 29
0
 def __packActiveState(self, time):
     state = text_styles.main(
         makeString(TOOLTIPS.BOOSTERSWINDOW_BOOSTER_ACTIVE_VALUE,
                    time=text_styles.stats(time)))
     return formatters.packBuildUpBlockData([
         formatters.packAlignedTextBlockData(
             text_styles.statInfo(
                 TOOLTIPS.BOOSTERSWINDOW_BOOSTER_ACTIVE_TITLE),
             BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
             padding={'bottom': 4}),
         formatters.packAlignedTextBlockData(
             state, BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER)
     ])
 def __setQualificationProgress(self, rank):
     division = rank.getDivision()
     divisionID = division.getID()
     total = self.__rankedController.getTotalQualificationBattles()
     stats = self.__rankedController.getStatsComposer()
     current = stats.divisionsStats.get(divisionID, {}).get('battles', 0)
     isCompleted = division.isCompleted()
     if not isCompleted:
         progressShortcut = R.strings.ranked_battles.division.status.qualification.progress(
         )
         titleShortcut = R.strings.ranked_battles.division.status.qualification(
         )
         progressSmall = text_styles.superPromoTitle(
             backport.text(progressShortcut,
                           current=text_styles.superPromoTitleEm(current),
                           total=total))
         progressTextSmall = text_styles.superPromoTitle(
             backport.text(titleShortcut, progress=progressSmall))
         progressBig = text_styles.grandTitle(
             backport.text(progressShortcut,
                           current=text_styles.grandTitleYellow(current),
                           total=total))
         progressTextBig = text_styles.grandTitle(
             backport.text(titleShortcut, progress=progressBig))
     else:
         progressTextSmall = ''
         progressTextBig = ''
     qualificationDescr = ''
     numQualificationQuestBattles = sorted(
         self.__rankedController.getQualificationQuests().keys())
     if numQualificationQuestBattles:
         numQualificationQuestBattles.append(total)
         if isCompleted:
             qualificationDescr = text_styles.concatStylesToSingleLine(
                 icons.check(),
                 text_styles.statInfo(
                     backport.text(R.strings.ranked_battles.division.status.
                                   qualificationDescr.complete())))
         else:
             qualificationDescr = text_styles.main(
                 backport.text(R.strings.ranked_battles.division.status.
                               qualificationDescr.progress(),
                               battlesTotal=total,
                               battlesList=', '.join([
                                   str(x)
                                   for x in numQualificationQuestBattles
                               ])))
     self.as_setQualificationProgressS(progressTextSmall, progressTextBig,
                                       isCompleted, qualificationDescr)
 def __updateSelectedVehicle(self):
     vehicle = g_currentVehicle.item
     suitableVehicles = self.__carousel.getSuitableVehicles()
     if suitableVehicles and vehicle and vehicle.intCD in suitableVehicles:
         selectedVeh = getVehicleDataVO(vehicle)
         selectedVeh.update(
             {'tooltip': TOOLTIPS.MISSIONS_VEHICLE_SELECTOR_LIST})
         status = text_styles.statInfo(
             QUESTS.MISSIONS_VEHICLESELECTOR_STATUS_SELECTED)
     elif suitableVehicles:
         label = QUESTS.MISSIONS_VEHICLESELECTOR_STATUS_SELECT
         style = text_styles.premiumVehicleName
         selectedVeh = {
             'buyTank': True,
             'iconSmall': RES_ICONS.MAPS_ICONS_LIBRARY_EMPTY_SELECTION,
             'smallInfoText': style(label),
             'tooltip': TOOLTIPS.MISSIONS_VEHICLE_SELECTOR_SELECT
         }
         status = ''
     else:
         label = QUESTS.MISSIONS_VEHICLESELECTOR_STATUS_LIST
         style = text_styles.premiumVehicleName
         selectedVeh = {
             'buyTank': True,
             'iconSmall': RES_ICONS.MAPS_ICONS_LIBRARY_EMPTY_SELECTION,
             'smallInfoText': style(label),
             'tooltip': TOOLTIPS.MISSIONS_VEHICLE_SELECTOR_LIST
         }
         status = text_styles.critical(
             QUESTS.MISSIONS_VEHICLESELECTOR_STATUS_NOTAVAILABLE)
     selectedVeh.update(isUseRightBtn=False)
     suitableVehiclesCount = self.__carousel.getSuitableVehiclesCount()
     totalVehiclesCount = self.__carousel.getTotalVehiclesCount()
     if suitableVehiclesCount == 0:
         suitableStyle = text_styles.unavailable
     else:
         suitableStyle = text_styles.highTitle
     count = '{} / {}'.format(suitableStyle(suitableVehiclesCount),
                              text_styles.main(totalVehiclesCount))
     title = text_styles.highTitle(
         ms(QUESTS.MISSIONS_VEHICLESELECTOR_TITLE, count=count))
     self.as_setInitDataS({'title': title, 'statusText': status})
     self.as_showSelectedVehicleS(selectedVeh)
Exemplo n.º 32
0
 def _packConditionsBlock(self, *args, **kwargs):
     block = []
     winnersBattlesNum = self.rankedController.getRanksTops(isLoser=False,
                                                            earned=True)
     losersBattlesNum = self.rankedController.getRanksTops(isLoser=True,
                                                           earned=True)
     block.append(
         formatters.packTextBlockData(
             text_styles.middleTitle(
                 RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS_HEADER),
             padding=formatters.packPadding(bottom=7)))
     if winnersBattlesNum:
         winIcon = RES_ICONS.getRankedTooltipTopIcon(winnersBattlesNum)
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     _ms(RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS,
                         battlesNum=winnersBattlesNum,
                         team=text_styles.statInfo(
                             RANKED_BATTLES.TOOLTIP_STEP_WINNERS))),
                 img=winIcon,
                 txtPadding=formatters.packPadding(left=17)))
     if winnersBattlesNum and losersBattlesNum:
         block.append(
             formatters.packTextBlockData(
                 text_styles.hightlight(RANKED_BATTLES.TOOLTIP_STEP_OR),
                 padding=formatters.packPadding(left=70, bottom=10)))
     if losersBattlesNum:
         loseIcon = RES_ICONS.getRankedTooltipTopIcon(losersBattlesNum)
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     _ms(RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS,
                         battlesNum=losersBattlesNum,
                         team=text_styles.critical(
                             RANKED_BATTLES.TOOLTIP_STEP_LOSERS))),
                 img=loseIcon,
                 txtPadding=formatters.packPadding(left=17)))
     return formatters.packBuildUpBlockData(
         block, 0,
         BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
 def _packReceivedBlock(self, winEarnedCount, loseEarnedCount):
     block = []
     block.append(
         self._getConditionHeaderBlock(strValue=backport.text(
             R.strings.ranked_battles.tooltip.step.conditions.header())))
     if winEarnedCount > 0:
         winIcon = R.images.gui.maps.icons.rankedBattles.tops.top.c_54x50.dyn(
             'top{}'.format(winEarnedCount))
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     backport.text(
                         R.strings.ranked_battles.tooltip.step.conditions(),
                         battlesNum=winEarnedCount,
                         team=text_styles.statInfo(
                             backport.text(R.strings.ranked_battles.tooltip.
                                           step.winners())))),
                 img=winIcon,
                 txtPadding=formatters.packPadding(left=17)))
     if winEarnedCount > 0 and loseEarnedCount > 0:
         block.append(
             self._getOrBlock(
                 padding=formatters.packPadding(left=70, bottom=10)))
     if loseEarnedCount > 0:
         loseIcon = R.images.gui.maps.icons.rankedBattles.tops.lose.c_54x50.dyn(
             'top{}'.format(loseEarnedCount))
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     backport.text(
                         R.strings.ranked_battles.tooltip.step.conditions(),
                         battlesNum=loseEarnedCount,
                         team=text_styles.critical(
                             backport.text(R.strings.ranked_battles.tooltip.
                                           step.losers())))),
                 img=loseIcon,
                 txtPadding=formatters.packPadding(left=17)))
     return formatters.packBuildUpBlockData(
         block, 0,
         BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
Exemplo n.º 34
0
 def _packAwardsReceivedFootnoteBlock(self, alreadyReachedPrestigeLevel):
     if alreadyReachedPrestigeLevel:
         rewardBlockText = formatters.packImageTextBlockData(
             title=text_styles.statInfo(
                 i18n.makeString(
                     EPIC_BATTLE.PRESTIGEPROGRESS_TOOLTIP_AWARDRECEIVED)),
             img=RES_ICONS.MAPS_ICONS_BUTTONS_CHECKMARK,
             imgPadding=formatters.packPadding(left=2, top=3),
             padding=formatters.packPadding(top=0,
                                            left=20,
                                            bottom=0,
                                            right=20))
     else:
         rewardBlockText = formatters.packTextBlockData(text_styles.warning(
             i18n.makeString(
                 EPIC_BATTLE.PRESTIGEPROGRESS_TOOLTIP_AWARDNOTYETCLAIMED)),
                                                        padding=formatters.
                                                        packPadding(
                                                            top=0,
                                                            left=20,
                                                            bottom=0,
                                                            right=20))
     return rewardBlockText
Exemplo n.º 35
0
 def __buildStatusBlock(self):
     if self.__isForCurrentVehicleRank():
         achievedCount = self.item.getSerialID()
         vehicleName = self.item.getVehicle().userName
         achievedStr = text_styles.middleTitle(achievedCount)
         descr = text_styles.main(
             _ms(TOOLTIPS.BATTLETYPES_RANKED_VEHRANK_ACHIEVEDCOUNT,
                 vehName=vehicleName))
         descr = descr + achievedStr
         return formatters.packCounterTextBlockData(
             achievedCount, descr, padding=formatters.packPadding(left=3))
     if self.item.isAcquired():
         status = text_styles.statInfo(
             TOOLTIPS.BATTLETYPES_RANKED_RANK_STATUS_RECEIVED)
     elif self.item.isLost():
         status = text_styles.statusAlert(
             TOOLTIPS.BATTLETYPES_RANKED_RANK_STATUS_LOST)
     else:
         status = text_styles.warning(
             TOOLTIPS.BATTLETYPES_RANKED_RANK_STATUS_NOTEARNED)
     return formatters.packAlignedTextBlockData(
         status,
         BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
         padding=formatters.packPadding(top=-4))
 def __getObtainedStatus(self):
     return text_styles.concatStylesWithSpace(
         icons.checkmark(-2),
         text_styles.statInfo(
             PERSONAL_MISSIONS.TANKMODULETOOLTIPDATA_STATUS_OBTAINED))
Exemplo n.º 37
0
 def __getSelectedVehicle(self, vehsList):
     selectedVehicle = self.__getVehicleByID(self.__selectedVehicleID, vehsList)
     vName = self.__getVehicleName(selectedVehicle)
     return main(i18n.makeString(INGAME_GUI.RESPAWNVIEW_NEXTVEHICLENAME)) + statInfo(vName)
Exemplo n.º 38
0
 def __packActiveState(self, time):
     title = text_styles.statInfo(TOOLTIPS.BOOSTERSWINDOW_BOOSTER_ACTIVE_TITLE)
     state = text_styles.main(makeString(TOOLTIPS.BOOSTERSWINDOW_BOOSTER_ACTIVE_VALUE, time=text_styles.stats(time)))
     return formatters.packBuildUpBlockData([formatters.packAlignedTextBlockData(title, BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding={'bottom': 4}), formatters.packAlignedTextBlockData(state, BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER)])