示例#1
0
def packRankBlockData(rank,
                      isEnabled=True,
                      shieldStatus=None,
                      linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_RANK_BLOCK_LINKAGE,
                      padding=None):
    data = buildRankVO(rank=rank,
                       isEnabled=isEnabled,
                       imageSize=RANKEDBATTLES_ALIASES.WIDGET_BIG,
                       hasTooltip=True,
                       shieldStatus=shieldStatus,
                       showLadderPoints=False)
    return packBlockDataItem(linkage, data, padding)
 def _buildRankVO(self,
                  rank,
                  isEnabled=False,
                  ladderPoints=None,
                  showLadderPoints=False):
     return buildRankVO(
         rank=rank,
         isEnabled=isEnabled,
         imageSize=RANKEDBATTLES_ALIASES.WIDGET_HUGE
         if self._isHuge() else RANKEDBATTLES_ALIASES.WIDGET_MEDIUM,
         hasTooltip=self._hasAdditionalRankInfo(),
         shieldStatus=self.rankedController.getShieldStatus(rank),
         shieldAnimated=True,
         showLadderPoints=showLadderPoints,
         ladderPoints=ladderPoints)
示例#3
0
 def __packRank(self, rank):
     isCurrent = rank.isCurrent()
     isFinal = isCurrent and rank.getID() == self.rankedController.getAccRanksTotal()
     bgImage = ''
     if isCurrent or isFinal:
         bgImage = RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_PIC_ICON_RANK_SHINE_364X364
     imageSize = RANKEDBATTLES_ALIASES.WIDGET_SMALL
     if isCurrent:
         imageSize = RANKEDBATTLES_ALIASES.WIDGET_HUGE if isFinal else RANKEDBATTLES_ALIASES.WIDGET_BIG
     shieldStatus = self.rankedController.getShieldStatus(rank=rank, isStatic=True) if not isFinal else None
     return {'linkage': 'RankUI',
      'rankData': {'rankVO': buildRankVO(rank, isEnabled=rank.isAcquired(), imageSize=imageSize, shieldStatus=shieldStatus, showShieldLabel=False, showLadderPoints=True),
                   'isBig': isCurrent or isFinal,
                   'isFinal': isFinal,
                   'imageBG': bgImage,
                   'description': '',
                   'isTransparent': not isCurrent,
                   'curIcon': ''}}
 def _populate(self):
     super(RankedBattlesAwardsView, self)._populate()
     if not self.__isDebug:
         self.rankedController.setAwardWindowShown(self.__rankID)
     rank = self.rankedController.getRank(self.__rankID,
                                          vehicle=self.__vehicle)
     if rank.getType() == RANK_TYPES.VEHICLE:
         points = self.rankedController.getLadderPoints()
         scoreTitle = RANKED_BATTLES.AWARDS_LADDERPOINTSTOTAL
         rankID = 'max'
         rankTitle = RANKED_BATTLES.AWARDS_GOTLADDERPOINT
     else:
         points = rank.getPoints()
         scoreTitle = RANKED_BATTLES.AWARDS_NEXTRANKTITLE
         rankID = self.__rankID
         rankTitle = i18n.makeString(RANKED_BATTLES.AWARDS_GOTRANK,
                                     rank=rankID)
     rankVOs = {
         'currentRank': {
             'rankTitle':
             rankTitle,
             'rank':
             buildRankVO(
                 rank=rank,
                 imageSize=RANKEDBATTLES_ALIASES.WIDGET_HUGE,
                 isEnabled=True,
                 shieldStatus=self.rankedController.getShieldStatus(rank)),
             'congratulationTitle':
             RANKED_BATTLES.AWARDS_CONGRATULATION,
             'scoresTitle':
             text_styles.highlightText(
                 i18n.makeString(scoreTitle,
                                 scores=text_styles.promoSubTitle(points))),
             'nextButtonLabel':
             RANKED_BATTLES.AWARDS_YES,
             'awards':
             self.__getAllReceivedAwards()
         }
     }
     self.as_setDataS(rankVOs)
     SoundGroups.g_instance.playSound2D(
         SOUND.getRankAwardAnimationEvent(rankID))