コード例 #1
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
コード例 #2
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
コード例 #3
0
 def __packAwardBlock(self, formattedBonuses):
     items = formatters.packGroupBlockData(formattedBonuses, padding=formatters.packPadding(top=15))
     awardsWidth = len(formattedBonuses) * _AWARD_STEP + _AWARDS_RIGHT_PADDING
     if awardsWidth > _TOOLTIP_MIN_WIDTH:
         self._setWidth(awardsWidth)
     title = formatters.packTextBlockData(text_styles.middleTitle(backport.text(R.strings.ranked_battles.yearRewards.tooltip.any.reward.title())))
     return formatters.packBuildUpBlockData([title, items], linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
コード例 #4
0
 def __packAwardBlock(self, formattedBonuses):
     items = formatters.packGroupBlockData(
         formattedBonuses,
         align=BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT,
         rendererWidth=80,
         padding=formatters.packPadding(top=10))
     awardsWidth = len(
         formattedBonuses) * _AWARD_STEP + _AWARDS_RIGHT_PADDING
     if awardsWidth > _TOOLTIP_MIN_WIDTH:
         self._setWidth(awardsWidth)
     title = formatters.packTextBlockData(
         text_styles.middleTitle(
             backport.text(R.strings.ranked_battles.yearRewards.tooltip.any.
                           reward.title())))
     return formatters.packBuildUpBlockData([title, items])