Ejemplo n.º 1
0
 def __buildVO(self):
     season = self.__epicController.getCurrentSeason(
     ) or self.__epicController.getNextSeason()
     currentLevel, _ = self.__epicController.getPlayerLevelInfo()
     cycleNumber = 1
     if season is not None:
         cycleNumber = self.__epicController.getCurrentOrNextActiveCycleNumber(
             season)
     level = currentLevel if self.__epicController.isCurrentCycleActive(
     ) else None
     return EpicBattlesWidgetVO(
         epicMetaLevelIconData=getProgressionIconVODict(cycleNumber, level),
         points=str(self.__getSkillPoints()))
Ejemplo n.º 2
0
 def _populate(self):
     super(BattleRoyaleLevelUpView, self)._populate()
     battleRoyaleInfo = self.__ctx[
         'reusableInfo'].personal.getBattleRoyaleInfo()
     title, _ = battleRoyaleInfo.get('accBRTitle', (None, None))
     prevTitle, _ = battleRoyaleInfo.get('prevBRTitle', (None, None))
     maxTitle = self.__battleRoyaleController.getMaxPlayerLevel()
     season = self.__battleRoyaleController.getCurrentSeason() or None
     cycleNumber = 0
     if season is not None:
         cycleNumber = self.__battleRoyaleController.getCurrentOrNextActiveCycleNumber(
             season)
     awardsVO = self._awardsFormatter.getFormattedBonuses(
         self.__getBonuses(title), size=AWARDS_SIZES.BIG)
     awardsSmallVO = self._awardsFormatter.getFormattedBonuses(
         self.__getBonuses(title))
     if prevTitle >= maxTitle or title >= maxTitle:
         self.__maxLvlReached = True
     lvlReachedText = _getTitleString(prevTitle, title)
     data = {
         'awards':
         awardsVO,
         'awardsSmall':
         awardsSmallVO,
         'epicMetaLevelIconData':
         after_battle_reward_view_helpers.getProgressionIconVODict(
             cycleNumber, title),
         'levelUpText':
         lvlReachedText,
         'backgroundImageSrc':
         backport.image(R.images.gui.maps.icons.battleRoyale.backgrounds.
                        back_congrats()),
         'maxLvlReached':
         self.__maxLvlReached
     }
     self.as_setDataS(data)
     return
Ejemplo n.º 3
0
 def _populate(self):
     super(EpicBattlesAfterBattleView, self)._populate()
     epicMetaGame = self.__ctx['reusableInfo'].personal.avatar.extensionInfo
     pMetaLevel, pFamePts = epicMetaGame.get('metaLevel', (None, None))
     prevPMetaLevel, prevPFamePts = epicMetaGame.get(
         'prevMetaLevel', (None, None))
     boosterFLXP = epicMetaGame.get('boosterFlXP', 0)
     originalFlXP = epicMetaGame.get('originalFlXP', 0)
     maxMetaLevel = self.__epicController.getMaxPlayerLevel()
     famePtsToProgress = self.__epicController.getLevelProgress()
     season = self.__epicController.getCurrentSeason() or None
     cycleNumber = 0
     if season is not None:
         cycleNumber = self.__epicController.getCurrentOrNextActiveCycleNumber(
             season)
     famePointsReceived = sum(famePtsToProgress[prevPMetaLevel:pMetaLevel]
                              ) + pFamePts - prevPFamePts
     achievedRank = max(epicMetaGame.get('playerRank', 0), 1)
     rankNameId = R.strings.epic_battle.rank.dyn('rank' + str(achievedRank))
     rankName = toUpper(backport.text(
         rankNameId())) if rankNameId.exists() else ''
     awardsVO = self._awardsFormatter.getFormattedBonuses(
         self.__getBonuses(prevPMetaLevel, pMetaLevel),
         size=AWARDS_SIZES.BIG)
     fameBarVisible = True
     dailyQuestAvailable = False
     if prevPMetaLevel >= maxMetaLevel or pMetaLevel >= maxMetaLevel:
         boosterFLXP = famePointsReceived - originalFlXP if famePointsReceived > originalFlXP else 0
         if prevPMetaLevel >= maxMetaLevel:
             fameBarVisible = False
         else:
             self.__maxLvlReached = True
     lvlReachedText = toUpper(
         backport.text(R.strings.epic_battle.epic_battles_after_battle.
                       Level_Up_Title(),
                       level=pMetaLevel))
     data = {
         'awards':
         awardsVO,
         'progress':
         self.__getProgress(pMetaLevel, pFamePts, prevPMetaLevel,
                            prevPFamePts, maxMetaLevel, boosterFLXP),
         'barText':
         '+' + str(min(originalFlXP, famePointsReceived)),
         'barBoostText':
         '+' + str(boosterFLXP),
         'epicMetaLevelIconData':
         getProgressionIconVODict(cycleNumber, pMetaLevel),
         'rank':
         achievedRank,
         'rankText':
         text_styles.epicTitle(rankName),
         'rankSubText':
         text_styles.promoTitle(
             backport.text(R.strings.epic_battle.epic_battles_after_battle.
                           Achieved_Rank())),
         'levelUpText':
         text_styles.heroTitle(lvlReachedText),
         'backgroundImageSrc':
         backport.image(R.images.gui.maps.icons.epicBattles.backgrounds.
                        back_congrats()),
         'fameBarVisible':
         fameBarVisible,
         'maxLevel':
         maxMetaLevel,
         'maxLvlReached':
         self.__maxLvlReached,
         'questPanelVisible':
         dailyQuestAvailable
     }
     self.as_setDataS(data)
     return
 def __getCycleStatusTooltipPack(self, season):
     items = []
     currentLevel, levelProgress = self.__epicController.getPlayerLevelInfo()
     cycleNumber = self.__epicController.getCurrentOrNextActiveCycleNumber(season)
     items.append(formatters.packTextBlockData(text=text_styles.middleTitle(backport.text(R.strings.epic_battle.tooltips.common.title())), padding=formatters.packPadding(left=20, right=20)))
     currentCycle = season.getCycleInfo()
     tDiff = currentCycle.endDate - time_utils.getCurrentLocalServerTimestamp() if currentCycle is not None else 0
     timeLeft = text_styles.main(getTimeToEndStr(tDiff))
     items.append(formatters.packTextBlockData(text=timeLeft, padding=formatters.packPadding(left=20, right=20)))
     items.append(formatters.packBuildUpBlockData(blocks=[formatters.packBlockDataItem(linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_EPIC_BATTLE_META_LEVEL_BLOCK_LINKAGE, data=getProgressionIconVODict(cycleNumber=cycleNumber, playerLevel=currentLevel), padding=formatters.packPadding(left=-20))], layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER))
     items.append(self.__packLevelBlock(currentLevel))
     if currentLevel < self.__epicController.getMaxPlayerLevel():
         famePtsToProgress = self.__epicController.getPointsProgressForLevel(currentLevel)
         items.append(self.__getCurrentMaxProgressBlock(levelProgress, famePtsToProgress))
         items.append(self.__getPlayerProgressToLevelBlock(levelProgress, famePtsToProgress))
     else:
         unlockedStr = backport.text(R.strings.epic_battle.tooltips.widget.reachedMaxLevel())
         items.append(formatters.packTextBlockData(text=text_styles.main(unlockedStr), padding=formatters.packPadding(left=20, right=20, top=-7)))
     return formatters.packBuildUpBlockData(items, padding=formatters.packPadding(top=20, bottom=10))