def __getData(self): stateFlags = self.__getShowStateFlags() isCompleted = stateFlags['isRankedWelcomeViewStarted'] stateFlags['isRankedWelcomeViewStarted'] = True self.__setShowStateFlags(stateFlags) rulePositive, ruleNegative = self.__getRules() self.rankedController.getRanksChain() ranks = [ rank.getIcon('big') for rank in self.rankedController.getRanksChain() if rank.getID() > 0 ] return {'header': text_styles.superPromoTitle(RANKED_BATTLES.WELCOMESCREEN_HEADER), 'rules': [{'image': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_ICN_TANKS, 'description': text_styles.hightlight(RANKED_BATTLES.WELCOMESCREEN_LEFTRULE), 'tooltip': makeTooltip(RANKED_BATTLES.WELCOMESCREEN_LEFTRULETOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_LEFTRULETOOLTIP_BODY)}, {'image': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_ICN_CREW, 'description': text_styles.hightlight(RANKED_BATTLES.WELCOMESCREEN_CENTERRULE), 'tooltip': makeTooltip(RANKED_BATTLES.WELCOMESCREEN_CENTERRULETOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_CENTERRULETOOLTIP_BODY)}, {'image': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_AWARD, 'description': text_styles.hightlight(RANKED_BATTLES.WELCOMESCREEN_RIGHTRULE), 'tooltip': makeTooltip(RANKED_BATTLES.WELCOMESCREEN_RIGHTRULETOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_RIGHTRULETOOLTIP_BODY)}], 'ranks': ranks, 'rulePositive': rulePositive, 'ruleNegative': ruleNegative, 'rankDescription': text_styles.superPromoTitle(RANKED_BATTLES.WELCOMESCREEN_RANKDESCR), 'ranksDescription': text_styles.promoSubTitle(RANKED_BATTLES.WELCOMESCREEN_RANKSDESCR), 'equalityText': RANKED_BATTLES.WELCOMESCREEN_EQUALITYTEXT, 'rulesDelimeterText': text_styles.promoSubTitle(RANKED_BATTLES.WELCOMESCREEN_RULESDELIMETER), 'btnLbl': RANKED_BATTLES.WELCOMESCREEN_BTN, 'btnTooltip': makeTooltip(RANKED_BATTLES.RANKEDBATTLEVIEW_NOTRANKEDBLOCK_OKTOOLTIP_HEADER, RANKED_BATTLES.RANKEDBATTLEVIEW_NOTRANKEDBLOCK_OKTOOLTIP_BODY), 'closeLbl': RANKED_BATTLES.WELCOMESCREEN_CLOSEBTN, 'closeBtnTooltip': makeTooltip(RANKED_BATTLES.WELCOMESCREEN_CLOSEBTNTOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_CLOSEBTNTOOLTIP_BODY), 'bgImage': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_BG_RANK_BLUR, 'isComplete': bool(isCompleted)}
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 __getAwardsRibbonBlock(self, cycle): rank = self.rankedController.getMaxRankForCycle(cycle.ID) awardsForTheLastRankVO = self.__packAwards(cycle) titleTxtStr = _ms(RANKED_BATTLES.RANKEDAWARDS_AWARDSBLOCK_TITLE, cycleNumber=cycle.ordinalNumber) allAwardsForCycleDict = self.rankedController.getAllAwardsForCycle( cycleID=cycle.ID) crystalCount = allAwardsForCycleDict.pop(Currency.CRYSTAL, { 'count': 0 }).get('count') allAwardsForCycleVO = self.__formatBonusVO(allAwardsForCycleDict) return { 'descriptionTxt': text_styles.stats( RANKED_BATTLES.RANKEDAWARDS_AWARDSBLOCK_DESCRIPTION), 'titleTxt': text_styles.promoSubTitle(titleTxtStr), 'pointsTxt': text_styles.superPromoTitle(str(cycle.points)), 'crystalsTxt': text_styles.superPromoTitle(str(crystalCount)), 'rankIcon': { 'imageSrc': rank.getIcon('medium'), 'smallImageSrc': rank.getIcon('small'), 'isEnabled': True, 'isMaster': rank.isMax(), 'rankID': str(rank.getID()), 'rankCount': str(getattr(rank, 'getSerialID', lambda: '')()), 'hasTooltip': False }, 'awards': awardsForTheLastRankVO, 'awardsHeaderTxt': text_styles.highTitle( RANKED_BATTLES.RANKEDAWARDS_AWARDSBLOCK_AWARDSHEADERTXT), 'crystalsImage': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_ICON_RANK_FINAL_PROXY_80X80, 'pointsImage': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_ICON_FINAL_CUP_80X80, 'pointsLabelTxt': text_styles.stats(RANKED_BATTLES.RANKEDAWARDS_AWARDSBLOCK_POINTS), 'crystalsLabelTxt': text_styles.stats(RANKED_BATTLES.RANKEDAWARDS_AWARDSBLOCK_CRYSTAL), 'boxImage': rank.getBoxIcon(size='120x100', isOpened=False), 'ribbonAwards': allAwardsForCycleVO }
def _populate(self): super(GammaWizardView, self)._populate() self._currentGammaValue = self._changeGammaValue = self._gammaWizard.gamma self.as_initDataS({ 'title': text_styles.superPromoTitle(SETTINGS.GAMMAWIZARD_TITLE), 'header': text_styles.highlightText(SETTINGS.GAMMAWIZARD_HEADER), 'description': text_styles.main(SETTINGS.GAMMAWIZARD_DESCRIPTION), 'applyLabel': SETTINGS.GAMMAWIZARD_APPLY, 'cancelLabel': SETTINGS.GAMMAWIZARD_CANCEL, 'defaultLabel': SETTINGS.GAMMAWIZARD_DEFAULT, 'currentValue': self._currentGammaValue, 'gammaTooltip': makeTooltip(SETTINGS.GAMMAWIZARD_TOOLTIP_HEADER, SETTINGS.GAMMAWIZARD_TOOLTIP_BODY), 'minValue': self.MIN_VALUE, 'maxValue': self.MAX_VALUE, 'defaultValue': self.DEFAULT_VALUE })
def __getData(self): bottomItems = self.__getBottomItems() centerTextStr = RANKED_BATTLES.RANKEDBATTLESUNREACHABLEVIEW_UNREACHABLETEXT centerTextStr = text_styles.vehicleStatusCriticalText(centerTextStr) bottomTextStr = text_styles.highTitle( RANKED_BATTLES.RANKEDBATTLESUNREACHABLEVIEW_BOTTOMTEXT) return { 'bottomRules': bottomItems, 'headerText': text_styles.superPromoTitle( RANKED_BATTLES.RANKEDBATTLESUNREACHABLEVIEW_HEADERTEXT), 'centerText': self.__formatUnreachableLevels(centerTextStr), 'bottomText': self.__formatUnreachableLevels(bottomTextStr), 'closeBtnLabel': RANKED_BATTLES.RANKEDBATTLESUNREACHABLEVIEW_CLOSEBTNLABEL, 'closeBtnTooltip': '', 'bgImage': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_XLESSVIEW_BG_PIC_RANK_LOCK, 'centerImg': RES_ICONS. MAPS_ICONS_RANKEDBATTLES_XLESSVIEW_RANKED_BATTLE_LOCKED_SM, 'centerImgBig': RES_ICONS. MAPS_ICONS_RANKEDBATTLES_XLESSVIEW_RANKED_BATTLE_LOCKED_BIG }
def __getStartData(self): staticData = {'statusText': _ts.superPromoTitle(_ms(RANKED_BATTLES.RANKEDBATTLECYCLESVIEW_TITLE)), 'closeBtn': _ms(RANKED_BATTLES.RANKEDBATTLESCYCLESVIEW_BTNCLOSE), 'bgImage': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_BG_RANK_BLUR} self.__currentTab = self.__getSeason().getCycleID() staticData.update(self.__buildCycleData()) return staticData
def _populate(self): super(ColorSettingsView, self)._populate() if self.app is not None: self._savedBackgroundAlpha = self.app.getBackgroundAlpha() self.app.setBackgroundAlpha(0) self.addListener(GameEvent.ON_BACKGROUND_ALPHA_CHANGE, self.__onExternalBackgroundAlphaChange, EVENT_BUS_SCOPE.GLOBAL) self.as_initDataS({'header': text_styles.superPromoTitle(SETTINGS.COLORSETTINGS_VIEW_HEADER), 'typesHeader': text_styles.highTitle(SETTINGS.COLORSETTINGS_VIEW_SUBTITLE), 'typesDesc': text_styles.main(SETTINGS.COLORSETTINGS_VIEW_DESCRIPTION), 'applyLabel': i18n.makeString(SETTINGS.APPLY_BUTTON), 'cancelLabel': i18n.makeString(SETTINGS.CANCEL_BUTTON), 'settingsTypes': self.__getTypes(), 'closeLabel': i18n.makeString(SETTINGS.COLORSETTINGS_VIEW_CLOSEBTN), 'beforeStr': text_styles.promoSubTitle(SETTINGS.COLORSETTINGS_VIEW_BEFORE), 'afterStr': text_styles.promoSubTitle(SETTINGS.COLORSETTINGS_VIEW_AFTER), 'filtersHeader': text_styles.highTitle(SETTINGS.COLORSETTINGS_TAB_FILTERS), 'filterPowerLabel': i18n.makeString(SETTINGS.COLORSETTINGS_TAB_FILTERS_INTENSITY), 'filtersTypes': self.__getFiltersTypes(), 'manualHeader': text_styles.highTitle(SETTINGS.COLORSETTINGS_TAB_CUSTOMSETTINGS), 'brightnessLabel': i18n.makeString(SETTINGS.COLORSETTINGS_TAB_CUSTOMSETTINGS_BRIGHTNESS), 'contrastLabel': i18n.makeString(SETTINGS.COLORSETTINGS_TAB_CUSTOMSETTINGS_CONTRAST), 'saturationLabel': i18n.makeString(SETTINGS.COLORSETTINGS_TAB_CUSTOMSETTINGS_SATURATION), 'resetLabel': i18n.makeString(SETTINGS.COLORSETTINGS_VIEW_RESETBTN)}) self.as_updateDataS(self.__selectedTabIdx, self.__initSettings) self.__blur = CachedBlur(enabled=False) return
def _populate(self): super(EventBoardsDetailsContainerView, self)._populate() data = { 'linkage': self._linkage, 'title': text_styles.superPromoTitle(self.eventData.getName()) } data.update(self._extra) self.as_setInitDataS(data)
def __getHeaderBlock(self, vehItemDict): block = [] icon = getTypeBigIconPath(vehItemDict['veh'].type, vehItemDict['veh'].isElite) paramName = '/'.join((self.getTriggerChainID(), 'one')) values = {'vehicles': vehItemDict['title'], 'discount': vehItemDict['price']} titleDescr = text_styles.superPromoTitle(self._getShortDescription(paramName, **values)) block.append(formatters.packImageTextBlockData(title=titleDescr, img=icon, imgPadding=formatters.packPadding(left=10, top=-15), txtGap=-6, txtOffset=84, padding=formatters.packPadding(top=15, bottom=-17))) return block
def getHeader(self): return text_styles.superPromoTitle( makeHtmlString( 'html_templates:lobby/textStyle', 'alignText', { 'align': 'center', 'message': _ms(PERSONAL_MISSIONS.OPERATIONUNLOCKEDWINDOW_HEADER, title=self._nextOperation.getShortUserName()) }))
def onDaySelect(self, date): formattedDate = datetime.fromtimestamp(date) selectedDayOfWeek = self.__weekDays[formattedDate.weekday()] self.as_setDayDataS({ 'primeTimeGroupData': self.__constructPrimeTimes(date), 'dayText': text_styles.superPromoTitle(formattedDate.day), 'dayNameText': text_styles.middleTitle(selectedDayOfWeek) })
def __setData(self): self.as_setDataS({'header': text_styles.superPromoTitle(RANKED_BATTLES.RANKEDBATTLEVIEW_TITLE), 'closeLbl': RANKED_BATTLES.RANKEDBATTLEVIEW_CLOSEBTN, 'closeDescr': RANKED_BATTLES.RANKEDBATTLEVIEW_CLOSEBTNDESCR, 'playVideoLbl': RANKED_BATTLES.RANKEDBATTLEVIEW_PLAYVIDEOBTN, 'playVideoBtnEnabled': False, 'calendarStatus': self.__getStatusBlock(), 'progressBlock': self.__buildProgressData(), 'awardsBlock': self.__getAwardsBlock(), 'bgImgPath': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_BG_RANK_BLUR, 'isUpdateProgress': False})
def __getStatusText(self): season = self.__getSeason() seasonName = season.getUserName() if seasonName is None: seasonNumber = season.getNumber() if seasonNumber and (isinstance(seasonNumber, int) or seasonNumber.isdigit()): seasonName = int2roman(int(seasonNumber)) return text_styles.superPromoTitle( _ms(RANKED_BATTLES.RANKEDBATTLECYCLESVIEW_TITLE, season=seasonName))
def _populate(self): super(RankedBattlesStageCompleteView, self)._populate() if self.__season is not None: cycle = self.__season.getAllCycles()[self._quest.getCycleID()] rank = self.rankedController.getRank(self._quest.getRank()) try: proxy_currency_count = first( self._quest.getBonuses(Currency.CRYSTAL)).getValue() except AttributeError: proxy_currency_count = 0 self.as_setDataS({ 'rank': { 'imageSrc': rank.getIcon('small'), 'smallImageSrc': None, 'isEnabled': True, 'isMaster': False, 'rankID': str(rank.getID()) }, 'boxImage': rank.getBoxIcon(), 'bestRankTitle': RANKED_BATTLES.SEASONCOMPLETE_BESTRANK, 'proxyCurrency': text_styles.highTitle( i18n.makeString( RANKED_BATTLES.SEASONCOMPLETE_PROXYCURRENCY, value=text_styles.superPromoTitle( proxy_currency_count))), 'scoresTitle': text_styles.highlightText( i18n.makeString(RANKED_BATTLES.SEASONCOMPLETE_SCORESEARNED, scores=text_styles.bonusLocalText( cycle.points))), 'congratulationTitle': i18n.makeString(RANKED_BATTLES.SEASONCOMPLETE_STAGECOMPLETE, stage=cycle.ordinalNumber), 'nextButtonLabel': RANKED_BATTLES.AWARDS_YES, 'bgSource': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_BG_RANK_BLUR }) self.as_setRewardsDataS({ 'ribbonType': 'ribbon2', 'rendererLinkage': 'RibbonAwardAnimUI', 'gap': 20, 'rendererWidth': 80, 'rendererHeight': 80, 'awards': self._packAwards() }) return
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) progressShortcut = R.strings.ranked_battles.division.status.qualification.progress( ) titleShortcut = R.strings.ranked_battles.division.status.qualification( ) progressSmall = text_styles.superPromoTitleEm( backport.text(progressShortcut, current=text_styles.superPromoTitle(current), total=total)) progressTextSmall = text_styles.superPromoTitle( backport.text(titleShortcut, progress=progressSmall)) progressBig = text_styles.grandTitleYellow( backport.text(progressShortcut, current=text_styles.grandTitle(current), total=total)) progressTextBig = text_styles.grandTitle( backport.text(titleShortcut, progress=progressBig)) self.as_setQualificationProgressS(progressTextSmall, progressTextBig, division.isCompleted())
def __setData(self, leagueData=None): season = self.rankedController.getCurrentSeason() self.as_setDataS({ 'header': text_styles.superPromoTitle( RANKED_BATTLES.RANKEDBATTLEVIEW_TITLE) % { 'cycle': season.getCycleOrdinalNumber() }, 'closeLbl': RANKED_BATTLES.RANKEDBATTLEVIEW_CLOSEBTN, 'closeDescr': RANKED_BATTLES.RANKEDBATTLEVIEW_CLOSEBTNDESCR, 'playVideoLbl': RANKED_BATTLES.RANKEDBATTLEVIEW_PLAYVIDEOBTN, 'playVideoBtnEnabled': False, 'calendarStatus': self.__getStatusBlock(), 'progressBlock': self.__buildProgressData(), 'awardsBlock': self.__getAwardsBlock(leagueData), 'bgImgPath': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_BG_RANK_BLUR, 'isUpdateProgress': False })
def _populate(self): super(GammaWizardView, self)._populate() if self.app is not None: self._savedBackgroundAlpha = self.app.getBackgroundAlpha() self.app.setBackgroundAlpha(0) self.addListener(GameEvent.ON_BACKGROUND_ALPHA_CHANGE, self.__onExternalBackgroundAlphaChange, EVENT_BUS_SCOPE.GLOBAL) self._currentGammaValue = self._changeGammaValue = self._gammaWizard.gamma self.as_initDataS({'title': text_styles.superPromoTitle(SETTINGS.GAMMAWIZARD_TITLE), 'header': text_styles.highlightText(SETTINGS.GAMMAWIZARD_HEADER), 'description': text_styles.main(SETTINGS.GAMMAWIZARD_DESCRIPTION), 'applyLabel': SETTINGS.GAMMAWIZARD_APPLY, 'cancelLabel': SETTINGS.GAMMAWIZARD_CANCEL, 'defaultLabel': SETTINGS.GAMMAWIZARD_DEFAULT, 'currentValue': self._currentGammaValue, 'gammaTooltip': makeTooltip(SETTINGS.GAMMAWIZARD_TOOLTIP_HEADER, SETTINGS.GAMMAWIZARD_TOOLTIP_BODY), 'minValue': self.MIN_VALUE, 'maxValue': self.MAX_VALUE, 'defaultValue': self.DEFAULT_VALUE}) return
def _packSkillViewVO(self): unspentSkillPoints = self.epicMetaGameCtrl.getSkillPoints() showSkillPoint = unspentSkillPoints > 0 data = EpicBattlesSkillViewVO( skillPoints=unspentSkillPoints, skills=[], showSkillPoints=showSkillPoint, header=text_styles.superPromoTitle( EPIC_BATTLE.METAABILITYSCREEN_MANAGE_RESERVES_HEADER), headerBig=text_styles.grandTitle( EPIC_BATTLE.METAABILITYSCREEN_MANAGE_RESERVES_HEADER), skillsLabel=self.__getUnspentPointsStr(showSkillPoint), skillInfo=self._packSkillInfo(), backgroundImageSrc=RES_ICONS. MAPS_ICONS_EPICBATTLES_BACKGROUNDS_META_BLUR_BG)._asdict() skillLvls = self.epicMetaGameCtrl.getSkillLevels() allSkills = self.epicMetaGameCtrl.getSkillInformation() for skillID, skillInfo in allSkills.iteritems(): lvl = skillLvls[skillID] if skillID in skillLvls else 0 icon = RES_ICONS.getEpicBattlesSkillIcon( '176x176', skillInfo.levels[max(1, lvl)].icon) name = skillInfo.levels[max(1, lvl)].name descr = skillInfo.levels[max(1, lvl)].longDescr if lvl == 0: label = text_styles.standard( EPIC_BATTLE.METAABILITYSCREEN_ABILITY_NOT_UNLOCKED) else: label = self._getLevelStr(lvl) data['skills'].append( EpicBattleSkillVO(skillID=skillID, level=lvl, maxLevel=len(skillInfo.levels), title=text_styles.highTitle(name), smallTitle=text_styles.middleTitle(name), desc=descr, label=label, skillLevelLabels=_SKILL_LEVEL_TEXTS, iconUrl=icon)._asdict()) return data
def buildRoleTypePages(headerTitle, roleType): roleActions = [] rolesToActions = getRolesActions() for action in rolesToActions[roleType]: actionLabel = ACTION_TYPE_TO_LABEL[action] roleActions.append({ 'image': backport.image( R.images.gui.maps.icons.roleExp.actions.c_128x128.dyn( actionLabel)()), 'description': backport.text(R.strings.menu.roleExp.action.dyn(actionLabel)()) }) roleTypeLabel = ROLE_TYPE_TO_LABEL[roleType] pages = [] _addPage( pages, headerTitle, text_styles.superPromoTitle( backport.text(R.strings.menu.roleExp.roleName.dyn(roleTypeLabel)(), groupName=makeHtmlString( 'html_templates:vehicleRoles', 'roleTitle', { 'message': backport.text( R.strings.menu.roleExp.roleGroupName.dyn( roleTypeLabel)()) }))), text_styles.mainBig( backport.text( R.strings.ingame_help.detailsHelp.role.description())), [], backport.image( R.images.gui.maps.icons.battleHelp.rolesHelp.dyn(roleTypeLabel)()), roleImage=backport.image( R.images.gui.maps.icons.roleExp.roles.c_100x100.dyn(roleTypeLabel) ()), roleActions=roleActions) return pages
def _getBuyingPanelData(self): vehiclePrice = self.__eventProgression.getRewardVehiclePrice( g_currentPreviewVehicle.item.intCD) storedPoints = self.__eventProgression.actualRewardPoints haveEnoughPoints = 0 < storedPoints >= vehiclePrice if not haveEnoughPoints: resID = R.strings.tooltips.vehiclePreview.buyButton.notEnoughPrestigePoints buyButtonTooltip = makeTooltip( body=backport.text(resID.header(), points=vehiclePrice)) else: buyButtonTooltip = '' formatMoney = text_styles.superPromoTitleEm if storedPoints > 0 else text_styles.superPromoTitleErr formatPrice = text_styles.superPromoTitleEm if haveEnoughPoints else text_styles.superPromoTitleErr tokensIcon = icons.makeImageTag(source=backport.image( R.images.gui.maps.icons.epicBattles.rewardPoints.c_32x32()), width=32, height=32, vSpace=-6, hSpace=3) return { 'title': text_styles.superPromoTitle( backport.text( R.strings.event_progression.vehicle_preview.title())), 'money': text_styles.concatStylesToSingleLine( formatMoney(str(storedPoints)), tokensIcon), 'price': text_styles.concatStylesToSingleLine( formatPrice(str(vehiclePrice)), tokensIcon), 'buyButtonEnabled': haveEnoughPoints and not buyButtonTooltip, 'buyButtonLabel': backport.text( R.strings.vehicle_preview.buyingPanel.buyBtn.label.buy()), 'buyButtonTooltip': buyButtonTooltip }
def __getSubtitleLabel(self): operation = self._eventsCache.personalMissions.getOperations()[ self.__operationID] return text_styles.superPromoTitle( _ms(PERSONAL_MISSIONS.AWARDCONGRATULATIONVIEW_SUBTITLE, title=operation.getShortUserName()))
def _getTitle(self, title): return text_styles.superPromoTitle(title)
def __getData(self): filters = self.__getFilters() isCompleted = filters['isRankedWelcomeViewStarted'] filters['isRankedWelcomeViewStarted'] = True self.__setFilters(filters) rulePositive, ruleNegative = self.__getRules() ranks = [RES_ICONS.getRankIcon('114x160', i) for i in xrange(1, 6)] ranks.append( RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKS_114X160_RANKVEHMASTER) return { 'header': text_styles.superPromoTitle(RANKED_BATTLES.WELCOMESCREEN_HEADER), 'rules': [{ 'image': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_ICN_TANKS, 'description': text_styles.hightlight(RANKED_BATTLES.WELCOMESCREEN_LEFTRULE), 'tooltip': makeTooltip( RANKED_BATTLES.WELCOMESCREEN_LEFTRULETOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_LEFTRULETOOLTIP_BODY) }, { 'image': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_ICN_CREW, 'description': text_styles.hightlight( RANKED_BATTLES.WELCOMESCREEN_CENTERRULE), 'tooltip': makeTooltip( RANKED_BATTLES.WELCOMESCREEN_CENTERRULETOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_CENTERRULETOOLTIP_BODY) }, { 'image': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_RANKEDBATTESVIEW_AWARD, 'description': text_styles.hightlight(RANKED_BATTLES.WELCOMESCREEN_RIGHTRULE), 'tooltip': makeTooltip( RANKED_BATTLES.WELCOMESCREEN_RIGHTRULETOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_RIGHTRULETOOLTIP_BODY) }], 'ranks': ranks, 'rulePositive': rulePositive, 'ruleNegative': ruleNegative, 'ranksDescription': text_styles.promoSubTitle(RANKED_BATTLES.WELCOMESCREEN_RANKSDESCR), 'equalityText': RANKED_BATTLES.WELCOMESCREEN_EQUALITYTEXT, 'rulesDelimeterText': text_styles.promoSubTitle( RANKED_BATTLES.WELCOMESCREEN_RULESDELIMETER), 'btnLbl': RANKED_BATTLES.WELCOMESCREEN_BTN, 'btnTooltip': makeTooltip( RANKED_BATTLES. RANKEDBATTLEVIEW_NOTRANKEDBLOCK_OKTOOLTIP_HEADER, RANKED_BATTLES.RANKEDBATTLEVIEW_NOTRANKEDBLOCK_OKTOOLTIP_BODY), 'closeLbl': RANKED_BATTLES.WELCOMESCREEN_CLOSEBTN, 'closeBtnTooltip': makeTooltip(RANKED_BATTLES.WELCOMESCREEN_CLOSEBTNTOOLTIP_HEADER, RANKED_BATTLES.WELCOMESCREEN_CLOSEBTNTOOLTIP_BODY), 'bgImage': RES_ICONS.MAPS_ICONS_RANKEDBATTLES_BG_RANK_BLUR, 'isComplete': bool(isCompleted) }