def updateStatus(self): if g_currentPreviewVehicle.hasModulesToSelect(): if g_currentPreviewVehicle.isModified(): icon = icons.makeImageTag( backport.image( R.images.gui.maps.icons.library.info_yellow()), 24, 24, -7, -4) text = text_styles.neutral('%s%s' % (backport.text( R.strings.vehicle_preview.modulesPanel.status.text()), icon)) else: icon = icons.makeImageTag( backport.image(R.images.gui.maps.icons.library.info()), 24, 24, -7, -4) text = text_styles.stats('%s%s' % (backport.text( R.strings.vehicle_preview.modulesPanel.Label()), icon)) tooltip = TOOLTIPS.VEHICLEPREVIEW_MODULS else: icon = icons.makeImageTag( backport.image(R.images.gui.maps.icons.library.info()), 24, 24, -7, -4) text = text_styles.stats('%s%s' % (backport.text( R.strings.vehicle_preview.modulesPanel.noModulesOptions()), icon)) tooltip = TOOLTIPS.VEHICLEPREVIEW_MODULSNOMODULES self.as_setStatusInfoS(text, tooltip, g_currentPreviewVehicle.getVehiclePreviewType(), needToShowAnim=self.__showAnimation())
def __getRankedBattleQuestsVO(self): quests = self._eventsCache.getActiveQuests(lambda q: isRankedDaily(q.getID())) label = '' totalCount = len(quests) completedQuests = len([ q for q in quests.itervalues() if q.isCompleted() ]) commonQuestsIcon = R.images.gui.maps.icons.library.outline.quests_disabled() if totalCount > 0: commonQuestsIcon = R.images.gui.maps.icons.library.outline.quests_available() diff = totalCount - completedQuests isLeagues = self.__rankedController.isAccountMastered() isAnyPrimeNow = self.__rankedController.hasAvailablePrimeTimeServers() isAnyPrimeLeftTotal = self.__rankedController.hasPrimeTimesTotalLeft() isAnyPrimeLeftNextDay = self.__rankedController.hasPrimeTimesNextDayLeft() if not isAnyPrimeLeftTotal or not isLeagues: label = icons.makeImageTag(backport.image(R.images.gui.maps.icons.library.CancelIcon_1())) elif diff > 0: if isAnyPrimeNow: label = backport.text(R.strings.menu.hangar_header.battle_quests_label.active(), total=diff) else: label = icons.makeImageTag(backport.image(R.images.gui.maps.icons.library.CancelIcon_1())) elif not isAnyPrimeLeftNextDay: label = icons.makeImageTag(backport.image(R.images.gui.maps.icons.library.ConfirmIcon_1())) else: label = icons.makeImageTag(backport.image(R.images.gui.maps.icons.library.time_icon())) questsVo = [self._headerQuestFormaterVo(totalCount > 0, backport.image(commonQuestsIcon), label, HANGAR_HEADER_QUESTS.QUEST_GROUP_RANKED_DAILY, flag=backport.image(R.images.gui.maps.icons.library.hangarFlag.flag_ranked()), tooltip=TOOLTIPS_CONSTANTS.RANKED_QUESTS_PREVIEW, isTooltipSpecial=True)] return self._wrapQuestGroup(HANGAR_HEADER_QUESTS.QUEST_GROUP_RANKED_DAILY, '', questsVo)
def wrapVO(items): result = {} if items: result = { 'items': items, 'isEnabled': True, 'topTitle': text_styles.concatStylesToSingleLine( icons.makeImageTag(source=backport.image( R.images.gui.maps.icons.library.icon_gift()), width=17, height=15, vSpace=0), text_styles.vehicleStatusCriticalTextSmall( VEHICLE_PREVIEW.BUYINGPANEL_PRESENT)), 'topTitleSmall': icons.makeImageTag(source=backport.image( R.images.gui.maps.icons.library.icon_gift()), width=17, height=15, vSpace=0) } return result
def _getUnavailableStatusFields(self, errorMsg): """ Gets status fields data for unavailable mission state. Data used in mission card to display its unavailable state. """ if errorMsg == 'requirements': isVehAvailable = self.event.vehicleReqs.isAnyVehicleAcceptable( ) or len(self.event.vehicleReqs.getSuitableVehicles()) > 0 if not isVehAvailable: statusText = _ms(QUESTS.MISSIONDETAILS_STATUS_WRONGVEHICLE) else: statusText = _ms(QUESTS.MISSIONDETAILS_STATUS_NOTAVAILABLE) notAvailableIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_MARKER_BLOCKED, 14, 14, -2, 10) statusMsg = text_styles.concatStylesWithSpace( notAvailableIcon, text_styles.error(statusText)) tooltipData = getDisabledRequirementTooltip(self.event) else: clockIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_TIMERICON, 16, 16, -2, 8) statusMsg = text_styles.concatStylesWithSpace( clockIcon, text_styles.error(QUESTS.MISSIONDETAILS_STATUS_NOTAVAILABLE)) if errorMsg in ('invalid_weekday', 'invalid_time_interval'): tooltipData = getInvalidTimeIntervalsTooltip(self.event) else: tooltipData = self._getMissionDurationTooltipData() return { 'statusLabel': statusMsg, 'status': EVENT_STATUS.NOT_AVAILABLE, 'statusTooltipData': tooltipData }
def __getAvailabilityStr(self): _, time, _ = self.epicQueueController.getPrimeTimeStatus() timeLeftStr = time_utils.getTillTimeString(time, EPIC_BATTLE.STATUS_TIMELEFT) if not self.epicQueueController.isInPrimeTime(): availablePrimeTime = self.epicQueueController.hasAnySeason( ) and self.epicQueueController.getPrimeTimeStatus()[1] != 0 if availablePrimeTime: return text_styles.main( i18n.makeString(EPIC_BATTLE.TOOLTIP_EPICBATTLE_AVAILABLEIN, time=timeLeftStr)) return None currPerformanceGroup = self.epicQueueController.getPerformanceGroup() if currPerformanceGroup == EPIC_PERF_GROUP.HIGH_RISK: attention = text_styles.error( MENU.HEADERBUTTONS_BATTLE_MENU_ATTENTION_LOWPERFORMANCE) return icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_MARKER_BLOCKED, vSpace=-3) + ' ' + attention elif currPerformanceGroup == EPIC_PERF_GROUP.MEDIUM_RISK: attention = text_styles.neutral( MENU.HEADERBUTTONS_BATTLE_MENU_ATTENTION_REDUCEDPERFORMANCE) return icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICON, vSpace=-3) + ' ' + attention else: return None
def _populate(self): super(UseAwardSheetWindow, self)._populate() self.as_setSettingsS({ 'title': self.meta.getTitle(), 'submitBtnLabel': self.meta.getSubmitButtonLabel(), 'cancelBtnLabel': self.meta.getCancelButtonLabel() }) icon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16, -3, 0) if self.meta.isAvailable() else icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON, 16, 16, -4, 0) text = text_styles.neutral(self.meta.getInfoText( )) if self.meta.isAvailable() else text_styles.alert( self.meta.getWarningText()) statusText = text_styles.concatStylesWithSpace(icon, text) self.as_setDataS({ 'neededLabel': text_styles.highlightText(self.meta.getNeededText()), 'neededValue': text_styles.highlightText(self.meta.getPawnCost()), 'totalLabel': text_styles.main(self.meta.getTotalText()), 'totalValue': text_styles.main(self.meta.getFreeSheets()), 'statusText': statusText, 'icon': self.meta.getIcon() })
def __getCurrentMaxProgress(self, playerLevel, playerFamePts): items = [] famePtsToProgress = self.getPointsProgressForLevel(playerLevel) currentPoint = text_styles.stats(str(playerFamePts)) fameTo = text_styles.main(str(famePtsToProgress)) currentPointMaxPoint = text_styles.concatStylesWithSpace( currentPoint, text_styles.main('/'), fameTo) text = text_styles.main(currentPointMaxPoint) marginTop = 7 icon = None if self.isFrontLine: marginTop = 0 iconSrc = backport.image( R.images.gui.maps.icons.epicBattles.fame_point_tiny()) icon = icons.makeImageTag(source=iconSrc, width=24, height=24) elif self.isSteelHunter: marginTop = 6 iconSrc = backport.image( R.images.gui.maps.icons.battleRoyale.progression_point()) icon = icons.makeImageTag(source=iconSrc, width=16, height=16) if icon is not None: text = text_styles.concatStylesWithSpace(text, icon) items.append( formatters.packAlignedTextBlockData( text=text, align=BLOCKS_TOOLTIP_TYPES.ALIGN_RIGHT, padding=formatters.packPadding(left=20, right=20, top=-35))) return formatters.packBuildUpBlockData( items, padding=formatters.packPadding(top=marginTop))
def getEfficiencyVO(currentSeasonEfficiency, currentSeasonEfficiencyDiff): delta = '' if currentSeasonEfficiencyDiff is not None: if currentSeasonEfficiencyDiff > 0: delta = text_styles.concatStylesToSingleLine( icons.makeImageTag( backport.image(R.images.gui.maps.icons.rankedBattles. league.delta_plus()), 11, 16, -3), text_styles.bonusAppliedText( ranked_formatters.getFloatPercentStrStat( currentSeasonEfficiencyDiff))) if currentSeasonEfficiencyDiff < 0: delta = text_styles.concatStylesToSingleLine( icons.makeImageTag( backport.image(R.images.gui.maps.icons.rankedBattles. league.delta_minus()), 11, 16, -3), text_styles.error( ranked_formatters.getFloatPercentStrStat( currentSeasonEfficiencyDiff))) return { 'icon': 'efficiency', 'label': '', 'value': ranked_formatters.getFloatPercentStrStat(currentSeasonEfficiency), 'delta': delta }
def __getConfirmator(self, withoutBenefits, period, price): if withoutBenefits: return plugins.HtmlMessageConfirmator( 'buyPremWithoutBenefitsConfirmation', 'html_templates:lobby/dialogs', 'confirmBuyPremWithoutBenefeits', { 'days': text_styles.stats(period), Currency.GOLD: text_styles.concatStylesWithSpace( text_styles.gold(BigWorld.wg_getGoldFormat(price)), icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2)) }) localKey = 'premiumContinueConfirmation' if self.wasPremium else 'premiumBuyConfirmation' return plugins.MessageConfirmator( localKey, ctx={ 'days': text_styles.stats(period), Currency.GOLD: text_styles.concatStylesWithSpace( text_styles.gold(BigWorld.wg_getGoldFormat(price)), icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2)) })
def __packTitle(self): name = text_styles.highTitle( _ms(TOOLTIPS.BATTLETYPES_RANKED_RANK_NAME, rank=self.item.getUserName())) shieldMaxHp = 0 if self.__shieldStatus is not None: _, _, shieldMaxHp, _, _ = self.__shieldStatus if shieldMaxHp > 0: comment = text_styles.standard( _ms(TOOLTIPS.BATTLETYPES_RANKED_HAVESHIELD, hp=text_styles.stats(shieldMaxHp))) elif self.item.canBeLost(): comment = text_styles.concatStylesWithSpace( icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICON, vSpace=-3), text_styles.neutral( TOOLTIPS.BATTLETYPES_RANKED_RANK_CANBELOST)) else: comment = text_styles.concatStylesWithSpace( icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_LOCKICON, width=9, height=13, vSpace=-2), text_styles.main(TOOLTIPS.BATTLETYPES_RANKED_RANK_CANTBELOST)) return formatters.packTextBlockData( text_styles.concatStylesToMultiLine(name, comment))
def __setInitData(self): if self._model.getNotifiedMessagesCount(NotificationGroup.INVITE) > 0: self.__currentGroup = NotificationGroup.INVITE else: self.__currentGroup = NotificationGroup.INFO self.as_setInitDataS({ 'scrollStepFactor': LIST_SCROLL_STEP_FACTOR, 'btnBarSelectedIdx': NotificationGroup.ALL.index(self.__currentGroup), 'tabsData': { 'tabs': [ self.__makeTabItemVO( icons.makeImageTag( RES_ICONS. MAPS_ICONS_LIBRARY_NOTIF_FILTERS_INFORMATION_16X16, 16, 16, -4, 0), TOOLTIPS.NOTIFICATIONSVIEW_TAB_INFO), self.__makeTabItemVO( icons.makeImageTag( RES_ICONS. MAPS_ICONS_LIBRARY_NOTIF_FILTERS_INVITATIONS_24X16, 24, 16, -5, 0), TOOLTIPS.NOTIFICATIONSVIEW_TAB_INVITES), self.__makeTabItemVO( icons.makeImageTag( RES_ICONS. MAPS_ICONS_LIBRARY_NOTIF_FILTERS_GIFT_16X16, 16, 16, -4, 0), TOOLTIPS.NOTIFICATIONSVIEW_TAB_OFFERS) ] } })
def formatVehicleNationAndTypeIcon(vehicle, path): iconType = icons.makeImageTag( Vehicle.getTypeSmallIconPath(vehicle.type, vehicle.isPremium)) iconNation = icons.makeImageTag(RES_ICONS.getFilterNation( vehicle.nationName), width=26, height=16) level = int2roman(vehicle.level) return makeHtmlString( path, 'vehicle', {'msg': '{}{}{}'.format(iconNation, iconType, level)})
def __setQuestTrackingData(self): questProgress = self.sessionProvider.shared.questProgress selectedQuest = questProgress.getSelectedQuest() setting = self.settingsCore.getSetting(QUESTS_PROGRESS.VIEW_TYPE) self.__isProgressTrackingEnabled = setting == QuestsProgressViewType.TYPE_STANDARD self.__isProgressTrackingAvailable = selectedQuest and selectedQuest.hasBattleProgress( ) trackingData = [] personalMissions = self.eventsCache.getPersonalMissions() for quest in sorted(questProgress.getInProgressQuests().itervalues(), key=lambda q: q.getQuestBranch()): isSelected = quest == selectedQuest operation = personalMissions.getOperationsForBranch( quest.getQuestBranch())[quest.getOperationID()] trackingData.append({ 'isTrackingAvailable': quest.hasBattleProgress(), 'eyeBtnVisible': self.__isProgressTrackingEnabled and isSelected, 'selected': isSelected, 'missionName': makeString(quest.getShortUserName()), 'fullMissionName': makeString(quest.getUserName()), 'operationName': makeString(operation.getShortUserName()), 'vehicle': QUESTSPROGRESS.getOperationTrackingIcon(operation.getID()), 'questID': quest.getID(), 'onPause': quest.isOnPause }) progressTracingText = '' if not self.__isProgressTrackingAvailable: progressTracingText = ''.join( (icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ALERTBIGICON, 24, 24, -6, 0), text_styles.alert( INGAME_GUI.STATISTICS_TAB_PROGRESSTRACING_NOTAVAILABLE))) trackingStatus = '' if len(trackingData) > 1: trackingStatus = ''.join( (icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_NOTIFICATIONS_OFF, 16, 16, -2, 0), ' ', text_styles.standard( PERSONAL_MISSIONS.QUESTPROGRESSTRACKING_TRACKINGSTATUS))) self.as_updateProgressTrackingS({ 'text': progressTracingText, 'trackingStatus': trackingStatus, 'trackingData': trackingData })
def _getHeader(self, currentEvent): eventID = currentEvent.getEventID() isRegistered = self._eventsController.getHangarFlagData().isRegistered( eventID) isRegistrationNeeded = currentEvent.getLimits( ).getIsRegistrationNeeded() if isRegistrationNeeded and not isRegistered: if currentEvent.isRegistrationFinishSoon(): flagIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_TIME_ICON) else: flagIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_FLAG_ICON) textData = currentEvent.getFormattedRemainingTime( EVENT_DATE_TYPE.PARTICIPANTS_FREEZE) msgText = TOOLTIPS.HANGAR_ELEN_HEADER_TOENDOFREGISTRATION time = textData[0] if textData[0] is not 0 else 1 timeText = textData[1] if textData[1] else FORMAT_MINUTE_STR timeName = EVENT_BOARDS.time_period(str(timeText)) text = '{} {} {} {}'.format(flagIcon, text_styles.tutorial(_ms(msgText)), text_styles.tutorial(time), text_styles.tutorial(timeName)) else: textData = currentEvent.getFormattedRemainingTime( EVENT_DATE_TYPE.END) msgText = TOOLTIPS.HANGAR_ELEN_HEADER_TOEND time = textData[0] if textData[0] is not 0 else 1 timeText = textData[1] if textData[1] else FORMAT_MINUTE_STR timeName = EVENT_BOARDS.time_period(str(timeText)) if currentEvent.isEndSoon(): flagIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_TIME_ICON) text = '{} {} {} {}'.format(flagIcon, text_styles.tutorial(_ms(msgText)), text_styles.tutorial(time), text_styles.tutorial(timeName)) else: flagIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_FLAG_ICON) text = '{} {} {} {}'.format(flagIcon, text_styles.main(_ms(msgText)), text_styles.stats(time), text_styles.stats(timeName)) return formatters.packImageTextBlockData( title=text_styles.highTitle( _ms(TOOLTIPS.HANGAR_ELEN_HEADER_NAME, name=currentEvent.getName())), img=currentEvent.getKeyArtSmall(), txtPadding=formatters.packPadding(top=22), txtOffset=20, txtGap=-8, desc=text)
def __populateSeasonsData(self): seasons = [] pqType = self.__navInfo.selectedPQType for seasonID, season in _getQuestsCache().getSeasons().iteritems(): tiles = [] for tile in sorted(season.getTiles().values(), key=operator.methodcaller('getID')): isCompleted, isUnlocked = tile.isAwardAchieved(), tile.isUnlocked() iconID = tile.getIconID() if isCompleted: bgImgUp = event_items.getTileNormalUpIconPath(iconID) bgImgOver = event_items.getTileNormalOverIconPath(iconID) else: bgImgUp = event_items.getTileGrayUpIconPath(iconID) bgImgOver = event_items.getTileGrayOverIconPath(iconID) vehicleBonus = tile.getVehicleBonus() if vehicleBonus is not None: vehLevelStr = icons.makeImageTag(Vehicle.getLevelSmallIconPath(vehicleBonus.level), 16, 16, -3, 0) vehTypeStr = icons.makeImageTag(Vehicle.getTypeSmallIconPath(vehicleBonus.type), 16, 16, -3, 0) vehicleBonusLabel = i18n.makeString(QUESTS.PERSONAL_SEASONS_TILELABEL, type=vehTypeStr, level=vehLevelStr, name=vehicleBonus.userName) else: vehicleBonusLabel = '' tokenIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_QUESTS_TOKEN16, 16, 16, -3, 0) if isUnlocked and not isCompleted and pqType == QUESTS_ALIASES.SEASON_VIEW_TAB_RANDOM: gottenTokensCount, totalTokensCount = tile.getTokensCount() progress = text_styles.standard(i18n.makeString(QUESTS.PERSONAL_SEASONS_TILEPROGRESS, count=text_styles.gold(str(gottenTokensCount)), total=str(totalTokensCount), icon=tokenIcon)) else: progress = '' if tile.isFullCompleted(): animation = event_items.getTileAnimationPath(iconID) else: animation = None if pqType == QUESTS_ALIASES.SEASON_VIEW_TAB_RANDOM: tooltipType = TOOLTIPS_CONSTANTS.PRIVATE_QUESTS_TILE else: tooltipType = TOOLTIPS_CONSTANTS.PRIVATE_QUESTS_FALLOUT_TILE tiles.append({'id': tile.getID(), 'isNew': isUnlocked and quest_settings.isPQTileNew(tile.getID()), 'label': text_styles.standard(vehicleBonusLabel), 'progress': progress, 'isCompleted': isUnlocked and isCompleted, 'enabled': isUnlocked, 'image': bgImgUp, 'imageOver': bgImgOver, 'animation': animation, 'tooltipType': tooltipType}) seasons.append({'id': seasonID, 'title': quests_fmts.getFullSeasonUserName(season), 'tiles': tiles}) self.as_setSeasonsDataS({'seasons': seasons}) return
def updateStatus(self): if g_currentPreviewVehicle.hasModulesToSelect(): if g_currentPreviewVehicle.isModified(): icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_INFO_YELLOW, 24, 24, -7, -4) text = text_styles.neutral('%s%s' % (_ms(VEHICLE_PREVIEW.MODULESPANEL_STATUS_TEXT), icon)) else: icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_INFO, 24, 24, -7, -4) text = text_styles.stats('%s%s' % (_ms(VEHICLE_PREVIEW.MODULESPANEL_LABEL), icon)) tooltip = TOOLTIPS.VEHICLEPREVIEW_MODULS else: icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_INFO, 24, 24, -7, -4) text = text_styles.stats('%s%s' % (_ms(VEHICLE_PREVIEW.MODULESPANEL_NOMODULESOPTIONS), icon)) tooltip = TOOLTIPS.VEHICLEPREVIEW_MODULSNOMODULES self.as_setStatusInfoS(text, tooltip)
def _getVehicleDescrStr(vehicle): if vehicle.isElite: vehTypeIcon = icons.makeImageTag( source=RES_ICONS.maps_icons_vehicletypes_elite_all_png( vehicle.type), width=24, height=24, vSpace=-6) else: vehTypeIcon = icons.makeImageTag( RES_ICONS.maps_icons_vehicletypes_all_png(vehicle.type)) return text_styles.concatStylesToSingleLine( text_styles.stats(int2roman(vehicle.level)), vehTypeIcon, text_styles.main(vehicle.userName))
def _getCompleteStatusFields(self, isLimited, bonusCount, bonusLimit): """ Gets status fields data for completed mission state. Data used in detailed mission view to display its completed state. For completed daily quests return unavailable state fields. """ statusTooltipData = None dateLabel = self._getActiveTimeDateLabel() resetDateLabel = '' status = EVENT_STATUS.COMPLETED if isLimited and bonusLimit > 1: statusLabel = text_styles.bonusAppliedText( _ms(QUESTS.MISSIONDETAILS_MISSIONSCOMPLETE, count=text_styles.bonusAppliedText(bonusCount), total=text_styles.standard(bonusLimit))) statusTooltipData = getCompletetBonusLimitTooltip() else: progressDesc = text_styles.success(_ms(QUESTS.QUESTS_STATUS_DONE)) icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_OKICON, 16, 16, -2, 8) statusLabel = text_styles.concatStylesToSingleLine( icon, progressDesc) if self.event.bonusCond.isDaily(): status = EVENT_STATUS.NOT_AVAILABLE dateLabel = text_styles.concatStylesWithSpace( icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_TIMERICON, 16, 16, -2, 8), text_styles.error(QUESTS.MISSIONDETAILS_STATUS_NOTAVAILABLE), self._getCompleteDailyStatus( QUESTS.MISSIONDETAILS_STATUS_COMPLETED_DAILY)) resetDateLabel = self._getDailyResetStatusLabel() return { 'statusLabel': statusLabel, 'dateLabel': dateLabel, 'status': status, 'bottomStatusText': text_styles.concatStylesWithSpace( icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_DONE, 32, 32, -8), text_styles.missionStatusAvailable( QUESTS.MISSIONDETAILS_BOTTOMSTATUSCOMPLETE)), 'statusTooltipData': statusTooltipData, 'resetDateLabel': resetDateLabel }
def __getStatusData(self, selectedQuest): if selectedQuest.isOnPause: status = MISSIONS_STATES.IS_ON_PAUSE icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ONPAUSE, 16, 16, -3, 8) text = text_styles.playerOnline(INGAME_GUI.STATISTICS_TAB_QUESTS_STATUS_ONPAUSE) else: status = MISSIONS_STATES.IN_PROGRESS icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_INPROGRESSICON, 16, 16, -2, 8) if selectedQuest.isMainCompleted(): text = text_styles.neutral(INGAME_GUI.STATISTICS_TAB_QUESTS_STATUS_INCREASERESULT) else: text = text_styles.neutral(INGAME_GUI.STATISTICS_TAB_QUESTS_STATUS_INPROGRESS) statusLabel = text_styles.concatStylesToSingleLine(icon, text) return {'statusLabel': statusLabel, 'status': status}
def __getEpicBattleQuestsVO(self): if not self.__epicController.isEnabled(): return None else: quests = [ q for q in self._questController.getQuestForVehicle( g_currentVehicle.item) if isDailyEpic(q.getGroupID()) ] totalCount = len(quests) completedQuests = len([q for q in quests if q.isCompleted()]) libraryIcons = R.images.gui.maps.icons.library commonQuestsIcon = libraryIcons.outline.quests_available() if not totalCount: commonQuestsIcon = libraryIcons.outline.quests_disabled() label = '' elif not self.__epicController.isDailyQuestsUnlocked(): label = icons.makeImageTag( backport.image(libraryIcons.CancelIcon_1())) elif completedQuests != totalCount: label = backport.text( R.strings.menu.hangar_header.battle_quests_label.dyn( LABEL_STATE.ACTIVE)(), total=totalCount - completedQuests) else: currentCycleEndTime, _ = self.__epicController.getCurrentCycleInfo( ) cycleTimeLeft = currentCycleEndTime - time_utils.getCurrentLocalServerTimestamp( ) if cycleTimeLeft < ONE_DAY or not self.__epicController.isDailyQuestsRefreshAvailable( ): label = icons.makeImageTag( backport.image(libraryIcons.ConfirmIcon_1())) else: label = icons.makeImageTag( backport.image(libraryIcons.time_icon())) quests = [ self._headerQuestFormaterVo( totalCount > 0, backport.image(commonQuestsIcon), label, HANGAR_HEADER_QUESTS.QUEST_TYPE_COMMON, flag=backport.image(R.images.gui.maps.icons.library. hangarFlag.flag_epic()), tooltip=TOOLTIPS_CONSTANTS.EPIC_QUESTS_PREVIEW, isTooltipSpecial=True) ] return self._wrapQuestGroup( HANGAR_HEADER_QUESTS.QUEST_GROUP_COMMON, '', quests)
def makeTableHeaderVO(currentPlayerCount, maxPlayerCount, currentLegCount, maxLegCount): total = i18n.makeString(FORTIFICATIONS.SORTIE_LISTVIEW_TEAMMEMBERS, current=str(currentPlayerCount), max=str(maxPlayerCount)) legionariesIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_LEGIONNAIRE, 16, 16, -4, 0) label = total + ' (' + legionariesIcon + ' ' + str( currentLegCount) + ' / ' + str(maxLegCount) + ')' return [{ 'buttonWidth': 212, 'buttonHeight': 40, 'sortOrder': 0, 'toolTip': '-', 'defaultSortDirection': 'ascending', 'label': label, 'showSeparator': True, 'textAlign': 'left' }, { 'buttonWidth': 67, 'buttonHeight': 40, 'sortOrder': 0, 'toolTip': '-', 'defaultSortDirection': 'ascending', 'label': i18n.makeString(FORTIFICATIONS.STRONGHOLDTABLE_RATING), 'showSeparator': True }, { 'buttonWidth': 216, 'buttonHeight': 40, 'sortOrder': 0, 'toolTip': '-', 'defaultSortDirection': 'ascending', 'label': i18n.makeString(FORTIFICATIONS.STRONGHOLDTABLE_TECH), 'showSeparator': False }]
def __getAvailableStatus(self, pawnsCount): return text_styles.warning( _ms(PERSONAL_MISSIONS.TANKMODULETOOLTIPDATA_STATUS_AVAILABLE, count=pawnsCount, img=icons.makeImageTag( RES_ICONS.MAPS_ICONS_PERSONALMISSIONS_FREE_SHEET, 24, 24, -6, 0)))
def _getUnavailableStatusFields(self, errorMsg): """ Gets status fields data for unavailable mission state. Data used in detailed mission view to display its unavailable state. """ scheduleLabel = '' dateLabel = '' scheduleTooltip = None if errorMsg != 'requirement': clockIcon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_TIMERICON, 16, 16, -2, 8) timeLeft = self.event.getNearestActivityTimeLeft() if timeLeft is not None: startTimeLeft = timeLeft[0] timeStatusText = text_styles.standard( _ms('#quests:missionDetails/status/notAvailable/%s' % errorMsg, time=self._getTillTimeString(startTimeLeft))) dateLabel = text_styles.concatStylesWithSpace( clockIcon, text_styles.error(QUESTS.MISSIONDETAILS_STATUS_WRONGTIME), timeStatusText) if errorMsg in ('invalid_weekday', 'invalid_time_interval'): scheduleLabel = getScheduleLabel() scheduleTooltip = getInvalidTimeIntervalsTooltip(self.event) return { 'status': EVENT_STATUS.NOT_AVAILABLE, 'dateLabel': dateLabel, 'scheduleOrResetLabel': scheduleLabel, 'scheduleTooltip': scheduleTooltip }
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) }
def __init__(self, tankman, firstNameID, firstNameGroup, lastNameID, lastNameGroup, iconID, iconGroup): hasUniqueData = self.__hasUniqueData(tankman, firstNameID, lastNameID, iconID) isFemale = tankman.descriptor.isFemale if isFemale: price = self.itemsCache.items.shop.passportFemaleChangeCost else: price = self.itemsCache.items.shop.passportChangeCost super(TankmanChangePassport, self).__init__( tankman, (plugins.TankmanChangePassportValidator(tankman), plugins.MessageConfirmator( 'replacePassport/unique' if hasUniqueData else 'replacePassportConfirmation', ctx={ Currency.GOLD: text_styles.concatStylesWithSpace( text_styles.gold(BigWorld.wg_getGoldFormat(price)), icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2)) }))) self.firstNameID = firstNameID self.firstNameGroup = firstNameGroup self.lastNameID = lastNameID self.lastNameGroup = lastNameGroup self.iconID = iconID self.iconGroup = iconGroup self.isFemale = isFemale self.isPremium = tankman.descriptor.isPremium self.price = price
def _status(i18nKey, style, icon = None): message = CLANS.clanprofile_summaryview_statusmsg(i18nKey) if icon is not None: message = i18n.makeString(message, icon=icons.makeImageTag(icon, 16, 16, -4, 0)) else: message = i18n.makeString(message) return style(message)
def __packQuestSlot(self, quest = None): ttHeader, ttBody, ttAttention, ttNote = (None, None, None, None) if quest is not None: tile = _getQuestsCache().getTiles()[quest.getTileID()] season = _getQuestsCache().getSeasons()[tile.getSeasonID()] isInProgress = True ttHeader = quest.getUserName() ttBody = quests_fmts.getFullTileUserName(season, tile) if quest.needToGetReward(): icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16, -3, 0) description = text_styles.neutral(i18n.makeString(QUESTS.PERSONAL_SEASONS_SLOTS_GETAWARD, icon=icon)) ttAttention = i18n.makeString(TOOLTIPS.PRIVATEQUESTS_SLOT_MISSIONCOMPLETE_ATTENTION) else: description = text_styles.standard(quests_fmts.getPQFullDescription(quest)) ttNote = i18n.makeString(TOOLTIPS.PRIVATEQUESTS_SLOT_MISSION_NOTE) title = text_styles.middleTitle(i18n.makeString(QUESTS.PERSONAL_SEASONS_SLOTS_TITLE, questName=quest.getUserName())) else: title, isInProgress = '', False description = text_styles.disabled(i18n.makeString(QUESTS.PERSONAL_SEASONS_SLOTS_NODATA)) ttHeader = i18n.makeString(TOOLTIPS.PRIVATEQUESTS_SLOT_EMPTY_HEADER) ttBody = i18n.makeString(TOOLTIPS.PRIVATEQUESTS_SLOT_EMPTY_BODY) return {'id': quest.getID() if quest else None, 'title': title, 'description': description, 'inProgress': isInProgress, 'completed': quest and quest.needToGetReward(), 'ttHeader': ttHeader, 'ttBody': ttBody, 'ttNote': ttNote, 'ttAttention': ttAttention}
def __makeTimeOfBattle(self, item, battleItem, currentState): result = {} if currentState == FORTIFICATION_ALIASES.CLAN_BATTLE_IS_IN_BATTLE: icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_BATTLERESULTICON_1, 16, 16, -3, 0) formattedText = text_styles.error(i18n.makeString(I18N_FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_ISBATTLE)) result['text'] = icon + ' ' + formattedText elif currentState == FORTIFICATION_ALIASES.CLAN_BATTLE_BEGINS: battleID = item.getBattleID() timer = {} htmlFormatter = text_styles.alert('###') locale = text_styles.main(i18n.makeString(I18N_FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_BEFOREBATTLE)) result['text'] = locale if battleItem: startTimeLeft = battleItem.getRoundStartTimeLeft() else: startTimeLeft = item.getStartTimeLeft() timer['useUniqueIdentifier'] = True timer['uniqueIdentifier'] = battleID timer['deltaTime'] = startTimeLeft timer['htmlFormatter'] = htmlFormatter timer['timerDefaultValue'] = '00' result['timer'] = timer else: lastBattleTimeUserString = '%s - %s' % (BigWorld.wg_getShortTimeFormat(item.getStartTime()), BigWorld.wg_getShortTimeFormat(item.getFinishTime())) result['text'] = text_styles.main(lastBattleTimeUserString) return result
def getAdditionalText(self): if self.__nextXp is not None: expCount = '%s<nobr>%s' % (BigWorld.wg_getIntegralFormat(self.__nextXp), icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_XPCOSTICON, 18, 18, -8, 0)) additionalText = _ms(MENU.AWARDWINDOW_REFERRAL_NEXTTANKMAN, expCount=text_styles.credits(expCount)) else: additionalText = '' return text_styles.main(additionalText)
def __setCarouselInitData(self): self.as_setCarouselInitS({ 'icoFilter': RES_ICONS.MAPS_ICONS_BUTTONS_FILTER, 'durationType': _getDurationTypeVO(), 'durationSelectIndex': 0, 'onlyPurchased': True, 'icoPurchased': RES_ICONS.MAPS_ICONS_FILTERS_PRESENCE, 'message': '{2}{0}\n{1}'.format( text_styles.neutral( VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_HEADER), text_styles.main( VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_DESCRIPTION), icons.makeImageTag( RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, vSpace=-3)), 'fitterTooltip': makeTooltip( VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_FILTER_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_FILTER_BODY), 'chbPurchasedTooltip': makeTooltip( VEHICLE_CUSTOMIZATION. CUSTOMIZATION_CAROUSEL_CHBPURCHASED_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_BODY) })
def _packHiddenBlock(self): subBlocks = [] if not self._rented: subBlocks.append( formatters.packTextParameterWithIconBlockData( name=text_styles.main(TANK_CAROUSEL_FILTER.INFOTIP_RENT), value='', icon=ICON_TEXT_FRAMES.RENTALS, padding=formatters.packPadding(left=-50, top=-3, bottom=-18), nameOffset=20)) if not self._event: icon = icons.makeImageTag( RES_ICONS.MAPS_ICONS_BATTLETYPES_40X40_EVENT, width=22, height=22, vSpace=-8) text = text_styles.main(TANK_CAROUSEL_FILTER.INFOTIP_EVENT) subBlocks.append( formatters.packTextBlockData( text='{} {}'.format(icon, text), padding=formatters.packPadding(left=6, top=5, bottom=0))) return formatters.packBuildUpBlockData( subBlocks, linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE )
def _populate(self): super(LobbyMenu, self)._populate() self.__addListeners() state = MENU_CONSTANTS.STATE_SHOW_ALL if self.bootcamp.isInBootcamp(): state = MENU_CONSTANTS.STATE_HIDE_ALL elif constants.IS_CHINA: state = MENU_CONSTANTS.STATE_SHOW_SERVER_NAME elif not constants.IS_SHOW_SERVER_STATS: state = MENU_CONSTANTS.STATE_HIDE_SERVER_STATS_ITEM self.as_setMenuStateS(state) self.as_setVersionMessageS(_getVersionMessage(self.promo)) bootcampIcon = RES_ICONS.MAPS_ICONS_BOOTCAMP_MENU_MENUBOOTCAMPICON bootcampIconSource = icons.makeImageTag(bootcampIcon, 33, 27, -8, 0) if self.bootcamp.isInBootcamp(): self.as_setBootcampButtonLabelS(BOOTCAMP.REQUEST_BOOTCAMP_FINISH, bootcampIconSource) elif self.lobbyContext.getServerSettings().isBootcampEnabled(): if self.bootcamp.runCount() > 0: bootcampLabel = BOOTCAMP.REQUEST_BOOTCAMP_RETURN else: bootcampLabel = BOOTCAMP.REQUEST_BOOTCAMP_START self.as_setBootcampButtonLabelS(bootcampLabel, bootcampIconSource) else: self.as_showBootcampButtonS(False) if events.isPlayerEntityChanging: self.as_showBootcampButtonS(False) if not self.manualController.isActivated( ) or self.bootcamp.isInBootcamp() or self.__isInQueue(): self.as_showManualButtonS(False)
def __updateStatus(self): prefix = i18n.makeString(FORTIFICATIONS.SETTINGSDEFENCEHOURPOPOVER_DEFENCEHOURTITLE) prefix = text_styles.highTitle(prefix) if self._isFortFrozen(): toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_FREEZED) icon = RES_ICONS.MAPS_ICONS_LIBRARY_ERRORICON_1 imageSource = icons.makeImageTag(icon, 16, 16, -4, 0) currentStatus = text_styles.error(i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_FREEZED)) currentStatus = imageSource + " " + currentStatus elif self.__defencePeriod: toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_ACTIVATED) currentStatus = "".join( ( icons.checkmark(), text_styles.success(" " + i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_ACTIVATED)), ) ) elif self.__checkConditions(): toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_CANBEACTIVATED) currentStatus = "".join( ( icons.alert(), text_styles.alert(" " + i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_NOTACTIVATED)), ) ) else: toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_CANNOTBEACTIVATED) currentStatus = "".join( ( icons.notAvailable(), text_styles.standard(" " + i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_NOTAVAILABLE)), ) ) self.as_setMainStatusS(prefix, currentStatus, toolTip)
def construct(self): module = self.module block = [] def checkLocalization(key): localization = _ms('#artefacts:%s' % key) return (key != localization, localization) if self.lobbyContext.getServerSettings().spgRedesignFeatures.isStunEnabled(): isRemovingStun = module.isRemovingStun else: isRemovingStun = False onUseStr = '%s/removingStun/onUse' if isRemovingStun else '%s/onUse' onUse = checkLocalization(onUseStr % module.descriptor.name) always = checkLocalization('%s/always' % module.descriptor.name) restriction = checkLocalization('%s/restriction' % module.descriptor.name) if bonus_helper.isSituationalBonus(module.name): effectDesc = text_styles.bonusPreviewText(_ms(module.shortDescription)) icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_TOOLTIP_ASTERISK_OPTIONAL, 16, 16, 0, 4) desc = params_formatters.packSituationalIcon(effectDesc, icon) else: desc = text_styles.bonusAppliedText(_ms(module.shortDescription)) if module.itemTypeID == ITEM_TYPES.optionalDevice: block.append(formatters.packTitleDescBlock(title='', desc=desc, padding=formatters.packPadding(top=-8))) else: topPadding = 0 if always[0] and always[1]: block.append(formatters.packTitleDescBlock(title=text_styles.middleTitle(TOOLTIPS.EQUIPMENT_ALWAYS), desc=text_styles.bonusAppliedText(always[1]))) topPadding = 5 if onUse[0] and onUse[1]: block.append(formatters.packTitleDescBlock(title=text_styles.middleTitle(TOOLTIPS.EQUIPMENT_ONUSE), desc=text_styles.main(onUse[1]), padding=formatters.packPadding(top=topPadding))) topPadding = 5 if restriction[0] and restriction[1]: block.append(formatters.packTitleDescBlock(title=text_styles.middleTitle(TOOLTIPS.EQUIPMENT_RESTRICTION), desc=text_styles.main(restriction[1]), padding=formatters.packPadding(top=topPadding))) return block
def __updateClubData(self): resultVO = _IntroViewVO() club = self.getClub() if self.clubsState.getStateID() == CLIENT_CLUB_STATE.HAS_CLUB and club: profile = self.clubsCtrl.getProfile() limits = self.clubsCtrl.getLimits() resultVO.setClubLabel(club.getUserName()) resultVO.setClubDBbID(club.getClubDbID()) resultVO.setClubLadderChevron(club) resultVO.showAdditionalButton(_ms(CYBERSPORT.WINDOW_INTRO_ADDITIONALBTN_LIST), TOOLTIPS.CYBERSPORT_INTRO_ADDITIONALBTN) resultVO.moveToTheUnitByCreateButton() resultVO.openClubProfileByChevronClick() if club.hasActiveUnit(): unitInfo = club.getUnitInfo() resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_JOINTEAM), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_JOINTEAM) if unitInfo.isInBattle(): isInBattleIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_SWORDSICON, 16, 16, -3, 0) resultVO.setClubDescription(text_styles.neutral('%s %s' % (isInBattleIcon, _ms(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_TEAMINBATTLE)))) else: resultVO.setClubDescription(text_styles.neutral(CYBERSPORT.STATICFORMATIONPROFILEWINDOW_STATUSLBL_CLUBISCALLED)) else: canCreateUnit = limits.canCreateUnit(profile, club) if canCreateUnit.success: resultVO.setClubDescription(text_styles.neutral(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_ASSEMBLINGTEAM)) resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ASSEMBLETEAM) elif canCreateUnit.reason == CLIENT_CLUB_RESTRICTIONS.NOT_ENOUGH_MEMBERS: if club.getPermissions().isOwner(): resultVO.setClubDescription(text_styles.main(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_NOTENOUGHPLAYERS)) resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ADDPLAYERS), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ADDPLAYERS) else: resultVO.setClubDescription(text_styles.error(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_OWNERASSEMBLINGTEAM), isBackVisible=True) resultVO.showCreateButton(_ms('#cybersport:window/intro/create/btn/private/seeStaff'), '#tooltips:cyberSport/intro/createBtn/addPlayers/private') resultVO.needAddPlayers() else: resultVO.setClubDescription(text_styles.error(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_NOTENOUGHPERMISSIONS_ASSEMBLINGTEAM), isBackVisible=True) resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM), '#tooltips:StaticFormationProfileWindow/actionBtn/notEnoughPermissions', enabled=False) elif self.clubsState.getStateID() == CLIENT_CLUB_STATE.NO_CLUB: resultVO.setNoClubChevron(isApplicationSent=False) resultVO.setClubLabel(_ms(CYBERSPORT.WINDOW_INTRO_TEAM_HEADER_STATICTEAMS)) resultVO.setClubDescription(text_styles.main(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_CREATEORFIND)) resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_LOOK), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_LOOK) elif self.clubsState.getStateID() == CLIENT_CLUB_STATE.SENT_APP: resultVO.setNoClubChevron(isApplicationSent=True) resultVO.openClubProfileByChevronClick() if club is not None: resultVO.setClubLabel(club.getUserName()) resultVO.setClubLadderChevron(club) resultVO.setClubDescription(text_styles.neutral(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_WAITINGFORREQUEST)) resultVO.showCancelButton(_ms(CYBERSPORT.WINDOW_INTRO_CANCEL_BTN_LABEL), TOOLTIPS.CYBERSPORT_INTRO_CANCELBTN) resultVO.showAdditionalButton(_ms(CYBERSPORT.WINDOW_INTRO_ADDITIONALBTN_LIST), TOOLTIPS.CYBERSPORT_INTRO_ADDITIONALBTN) else: resultVO.fillDefault() resultVO.acceptNavigationByChevron(False) isBattlesAvailable, _ = self.clubsCtrl.getAvailabilityCtrl().getStatus() if not isBattlesAvailable: resultVO.setClubDescriptionTooltip(TOOLTIPS_CONSTANTS.LADDER_REGULATIONS) resultVO.setClubDescription('{0}{1}'.format(icons.alert(), text_styles.main(CYBERSPORT.LADDERREGULATIONS_WARNING)), True) self.as_setStaticTeamDataS(resultVO.getData()) return
def _populate(self): super(ReferralReferralsIntroWindow, self)._populate() contentKey = 'referrals' if self.__isNewbie else 'phenix' referrerNameFmt = text_styles.warning(self.__referrerName) handIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_REFERRAL_REFERRALSMALLHAND, 16, 16, -4, 0) self.as_setDataS({'titleTF': text_styles.promoTitle(i18n.makeString(MENU.REFERRALREFERRALSINTROWINDOW_TEXT_BLOCK_TITLE, userName=getattr(BigWorld.player(), 'name', 'Unknown'))), 'bodyTF': text_styles.main(i18n.makeString(MENU.referralreferralsintrowindow_text_block_body(contentKey), referrerName=referrerNameFmt, handIcon=handIcon)), 'squadTF': text_styles.main(i18n.makeString(MENU.REFERRALREFERRALSINTROWINDOW_TEXT_BLOCK_SQUAD_TEXT))})
def __addAdditionalBlocks(self, playersCount, legionariesCount): if playersCount > 0: self._list.insert(0, {'headerText': text_styles.standard(i18n.makeString(CYBERSPORT.WINDOW_UNIT_CANDIDATES_TEAM))}) if playersCount > 0 and legionariesCount > 0: self._list.append({'emptyRender': True}) if legionariesCount > 0: self._list.append({'headerText': '%s%s' % (icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_LEGIONNAIRE, 16, 16, -4, 0), text_styles.standard(i18n.makeString(CYBERSPORT.WINDOW_UNIT_CANDIDATES_LEGIONARIES))), 'headerToolTip': TOOLTIPS.CYBERSPORT_STATICFORMATION_WAITLIST_LEGIONNAIRES})
def __getTokensInfo(self, tile): text, tooltip = ('', None) if self.__questsType == QUESTS_ALIASES.SEASON_VIEW_TAB_RANDOM: tokensCount = tile.getTotalTokensCount() tokenIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_QUESTS_TOKEN16, 16, 16, -3, 0) text = text_styles.main(_ms(QUESTS.SEASONAWARDSWINDOW_TOKENSCOUNT, count=str(tokensCount), icon=tokenIcon)) tooltip = TOOLTIPS_CONSTANTS.PRIVATE_QUESTS_TOKENS_AWARD return (text, tooltip)
def __updateStatus(self): if g_currentPreviewVehicle.isPresent(): if g_currentPreviewVehicle.isModified(): icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16, -3, 0) text = text_styles.neutral('%s %s' % (icon, _ms(VEHICLE_PREVIEW.MODULESPANEL_STATUS_TEXT))) else: text = text_styles.main(VEHICLE_PREVIEW.MODULESPANEL_LABEL) self.as_updateVehicleStatusS(text)
def __initData(self): ms = i18n.makeString igrIcon = RES_ICONS.MAPS_ICONS_LIBRARY_PREMIUM_SMALL icon = icons.makeImageTag(igrIcon, 34, 16, -4) self.as_setWindowTitleS(ms(MENU.PROMOPREMIUMIGRWINDOW_WINDOWTITLE)) self.as_setTitleS(text_styles.highTitle(ms(MENU.PROMOPREMIUMIGRWINDOW_TITLE))) self.as_setTextS(text_styles.standard(ms(MENU.PROMOPREMIUMIGRWINDOW_TEXT, iconIgr=icon))) self.as_setApplyButtonLabelS(ms(MENU.PROMOPREMIUMIGRWINDOW_APPLYBUTTONLABEL))
def __makeTableData(self): ms = i18n.makeString result = [] refSystem = game_control.g_instance.refSystem referrals = refSystem.getReferrals() numOfReferrals = len(referrals) for i, item in enumerate(referrals): referralNumber = text_styles.stats(ms('%d.' % (i + 1))) dbID = item.getAccountDBID() user = self.usersStorage.getUser(dbID) if not user: raise AssertionError('User must be defined') contactConverter = ContactConverter() contactData = contactConverter.makeVO(user) xpIcon = RES_ICONS.MAPS_ICONS_LIBRARY_NORMALXPICON icon = icons.makeImageTag(xpIcon, 16, 16, -3, 0) bonus, timeLeft = item.getBonus() if bonus == 1: multiplier = '-' multiplierTooltip = TOOLTIPS.REFERRALMANAGEMENTWINDOW_MULTIPLIER_X1 icon = '' else: multiplier = 'x%s' % BigWorld.wg_getNiceNumberFormat(bonus) multiplierTooltip = '' if timeLeft: multiplierTime = text_styles.main(ms(item.getBonusTimeLeftStr())) expMultiplierText = text_styles.standard(ms(MENU.REFERRALMANAGEMENTWINDOW_REFERRALSTABLE_LEFTTIME, time=multiplierTime)) else: expMultiplierText = '' multiplierFactor = text_styles.credits(multiplier) multiplierStr = ms(icon + '<nobr>' + multiplierFactor + ' ' + expMultiplierText) referralData = {'accID': dbID, 'fullName': user.getFullName(), 'userName': user.getName(), 'clanAbbrev': user.getClanAbbrev()} canInviteToSquad = self.prbFunctional.getEntityType() in (PREBATTLE_TYPE.NONE, PREBATTLE_TYPE.TRAINING) or self.prbFunctional.getEntityType() == PREBATTLE_TYPE.SQUAD and self.prbFunctional.getPermissions().canSendInvite() btnEnabled = canInviteToSquad or False btnTooltip = TOOLTIPS.REFERRALMANAGEMENTWINDOW_CREATESQUADBTN_DISABLED_SQUADISFULL else: btnEnabled = True btnTooltip = TOOLTIPS.REFERRALMANAGEMENTWINDOW_CREATESQUADBTN_ENABLED result.append({'isEmpty': False, 'contactData': contactData, 'referralNo': referralNumber, 'referralVO': referralData, 'exp': BigWorld.wg_getNiceNumberFormat(item.getXPPool()), 'multiplier': multiplierStr, 'multiplierTooltip': multiplierTooltip, 'btnEnabled': btnEnabled, 'btnTooltip': btnTooltip}) if numOfReferrals < self.MIN_REF_NUMBER: for i in xrange(numOfReferrals, self.MIN_REF_NUMBER): referralNumber = text_styles.disabled(ms(MENU.REFERRALMANAGEMENTWINDOW_REFERRALSTABLE_EMPTYLINE, lineNo=str(i + 1))) result.append({'isEmpty': True, 'referralNo': referralNumber}) self.as_setTableDataS(result)
def _packHiddenBlock(self): subBlocks = [] if self._hideRented: subBlocks.append(formatters.packTextParameterWithIconBlockData(name=text_styles.main(TANK_CAROUSEL_FILTER.INFOTIP_RENT), value='', icon=ICON_TEXT_FRAMES.RENTALS, padding=formatters.packPadding(left=-50, top=-3, bottom=-18), nameOffset=20)) if self._hideEvent: icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_BATTLETYPES_40X40_EVENT, width=22, height=22, vSpace=-8) text = text_styles.main(TANK_CAROUSEL_FILTER.INFOTIP_EVENT) subBlocks.append(formatters.packTextBlockData(text='{} {}'.format(icon, text), padding=formatters.packPadding(left=6, top=5, bottom=0))) return formatters.packBuildUpBlockData(subBlocks, linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
def __playersLabel(self, playerCount, limit): if playerCount == 0: players = text_styles.standard(str(playerCount)) else: players = text_styles.main(str(playerCount)) resultCount = ''.join((players, text_styles.standard(' / {0} )'.format(limit)))) legionariesIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_LEGIONNAIRE, 16, 16, -4, 0) leftBrace = text_styles.standard('( ') result = leftBrace + legionariesIcon + resultCount return result
def __setInitData(self): """ Initialize current group Prepare and set init data in AS """ if self._model.getNotifiedMessagesCount(NOTIFICATION_GROUP.INVITE) > 0: self.__currentGroup = NOTIFICATION_GROUP.INVITE else: self.__currentGroup = NOTIFICATION_GROUP.INFO self.as_setInitDataS({'scrollStepFactor': LIST_SCROLL_STEP_FACTOR, 'btnBarSelectedIdx': NOTIFICATION_GROUP.ALL.index(self.__currentGroup), 'tabsData': {'tabs': [self.__makeTabItemVO(icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_NOTIF_FILTERS_INFORMATION_16X16, 16, 16, -4, 0), TOOLTIPS.NOTIFICATIONSVIEW_TAB_INFO), self.__makeTabItemVO(icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_NOTIF_FILTERS_INVITATIONS_24X16, 24, 16, -5, 0), TOOLTIPS.NOTIFICATIONSVIEW_TAB_INVITES), self.__makeTabItemVO(icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_NOTIF_FILTERS_GIFT_16X16, 16, 16, -4, 0), TOOLTIPS.NOTIFICATIONSVIEW_TAB_OFFERS)]}})
def _packBlocks(self, *args, **kwargs): blocks = super(TokensAwardTooltipData, self)._packBlocks(*args, **kwargs) blocks.append( formatters.packTextBlockData( text_styles.main( i18n.makeString( TOOLTIPS.QUESTS_SEASONAWARD_TOKENS_DESCRIPTION, icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_QUESTS_TOKEN16, 16, 16, -3, 0), ) ) ) ) return blocks
def __addAdditionalBlocks(self, playersCount, legionariesCount): headerClanPlayers = {'headerText': text_styles.standard(i18n.makeString(FORTIFICATIONS.FORTBATTLEROOM_LISTHEADER_CLANPLAYERS))} emptyRenders = {'emptyRender': True} legionariesIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_LEGIONNAIRE, 16, 16, -4, 0) textResult = legionariesIcon + text_styles.standard(i18n.makeString(FORTIFICATIONS.FORTBATTLEROOM_LISTHEADER_LEGIONARIESPLAYERS)) headerLegionasriesPlayers = {'headerText': textResult, 'headerToolTip': TOOLTIPS.FORTIFICATION_BATTLEROOMLEGIONARIES} if playersCount > 0: self._list.insert(0, headerClanPlayers) if playersCount > 0 and legionariesCount > 0: self._list.append(emptyRenders) if legionariesCount > 0: self._list.append(headerLegionasriesPlayers)
def __updateData(self): fort = self.fortCtrl.getFort() extra = self.unitFunctional.getExtra() result = [] activeConsumes = dict(((otID, slotIdx) for slotIdx, (otID, level) in extra.getConsumables().iteritems())) for orderTypeID in constants.FORT_ORDER_TYPE.CONSUMABLES: orderItem = fort.getOrder(orderTypeID) building = fort.getBuilding(orderItem.buildingID) isBuildingReady = building is not None isSelected = orderTypeID in activeConsumes isSelectedInThisSlot = isSelected and activeConsumes[orderTypeID] == self.__slotIdx isConsumableEnabled = isSelectedInThisSlot or not isSelected and orderItem.count > 0 showArsenalIcon = isBuildingReady and not isSelected if isSelectedInThisSlot: returnBtnLabel = FORTIFICATIONS.ORDERSELECTPOPOVER_RETURNBTNLABEL else: returnBtnLabel = '' orderLevelLabel = text_styles.main(_ms(FORTIFICATIONS.ORDERSELECTPOPOVER_ORDERLEVEL, orderLevel=fort_formatters.getTextLevel(orderItem.level))) if not isBuildingReady: icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_REDNOTAVAILABLE, 16, 16, -2, 0) description = '%s %s' % (icon, text_styles.error(_ms(FORTIFICATIONS.ORDERSELECTPOPOVER_NOTAVAILABLE))) orderCountText = '' elif not isSelected: description = orderLevelLabel if orderItem.count: orderCountText = text_styles.standard(_ms(FORTIFICATIONS.ORDERSELECTPOPOVER_ORDERCOUNT, orderNumber=text_styles.stats(str(orderItem.count)))) else: orderCountText = text_styles.standard(_ms(FORTIFICATIONS.ORDERSELECTPOPOVER_ORDERCOUNT, orderNumber=text_styles.error(str(orderItem.count)))) else: if isSelectedInThisSlot: description = '' else: description = orderLevelLabel icon = icons.nut() orderCountText = icon + text_styles.success(_ms(FORTIFICATIONS.ORDERSELECTPOPOVER_SELECTED)) result.append({'orderID': orderTypeID, 'orderIconSrc': orderItem.icon, 'headerText': text_styles.middleTitle(_ms(orderItem.userName)), 'descriptionText': description, 'orderCountText': orderCountText, 'isEnabled': isConsumableEnabled, 'isSelected': isSelectedInThisSlot, 'showArsenalIcon': showArsenalIcon, 'returnBtnLabel': returnBtnLabel, 'orderLevel': orderItem.level}) self.as_setDataS({'orders': result}) return
def showAcceptClanInviteDialog(clanName, clanAbbrev, callback): from gui import DialogsInterface DialogsInterface.showDialog( I18nConfirmDialogMeta( "clanConfirmJoining", messageCtx={ "icon": icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICON, 16, 16, -4, 0), "clanName": text_styles.stats( i18n.makeString(DIALOGS.CLANCONFIRMJOINING_MESSAGE_CLANNAME, clanAbbr=clanAbbrev, clanName=clanName) ), "clanExit": text_styles.standard(i18n.makeString(DIALOGS.CLANCONFIRMJOINING_MESSAGE_CLANEXIT)), }, ), callback, )
def __prepareAndPassVehiclesData(self): values = [] for vehicleCD in g_itemsCache.items.stats.eliteVehicles: try: vehicle = g_itemsCache.items.getItemByCD(vehicleCD) if not vehicle.xp: continue values.append( { "id": vehicle.intCD, "vehicleType": getVehicleTypeAssetPath(vehicle.type), "vehicleName": vehicle.shortUserName, "xp": vehicle.xp, "isSelectCandidate": vehicle.isFullyElite, "vehicleIco": vehicle.iconSmall, "nationIco": getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31), } ) except: continue labelBuilder = builder().addStyledText("middleTitle", i18n.makeString(MENU.EXCHANGE_RATE)) if self.__xpForFree is not None: labelBuilder.addStyledText( self.__getActionStyle(), i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL) ) labelBuilder.addStyledText( "expText", i18n.makeString( MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE, icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2), forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree), ), ) vehicleData = { "isHaveElite": bool(values), "vehicleList": values, "tableHeader": self._getTableHeader(), "xpForFree": self.__xpForFree, "rateLabel": labelBuilder.render(), "xpAction": g_itemsCache.items.shop.isXPConversionActionActive, } self.as_vehiclesDataChangedS(vehicleData) return
def requestBuildingInfo(self, uid): infoData = {} id = self.getBuildingIDbyUID(uid) self.__markAsVisited(id) buildingStatus = self.__getBuildingStatus(id) infoData['buildingName'] = text_styles.highTitle(i18n.makeString(FORTIFICATIONS.buildings_buildingname(uid))) infoData['buildingID'] = uid infoData['longDescr'] = text_styles.standard(i18n.makeString(FORTIFICATIONS.buildingsprocess_longdescr(uid))) buttonLbl = FORTIFICATIONS.BUILDINGSPROCESS_BUTTONLBL if buildingStatus == self.BUILDING_STATUS.BUILT: buttonLbl = text_styles.standard(i18n.makeString(FORTIFICATIONS.BUILDINGSPROCESS_BUTTONLBLBUILT)) infoData['buttonLabel'] = i18n.makeString(buttonLbl) infoData['orderInfo'] = self.__makeOrderInfoData(uid) isVisibleBtn = True isEnableBtn = True statusMsg = '' statusIconTooltip = None if buildingStatus == self.BUILDING_STATUS.BUILT: statusMsg = ''.join((icons.checkmark(), text_styles.success(i18n.makeString(FORTIFICATIONS.BUILDINGSPROCESS_STATUSMSG_BUILT)))) isEnableBtn = False isVisibleBtn = False statusIconTooltip = self.__makeStatusTooltip(True) buttonTooltip = self.__makeButtonTooltip(self.BUILDING_STATUS.BUILT, None) elif buildingStatus == self.BUILDING_STATUS.NOT_AVAILABLE: isEnableBtn = False isVisibleBtn = True statusMsg = text_styles.error(i18n.makeString(FORTIFICATIONS.BUILDINGSPROCESS_BUILDINGINFO_STATUSMESSAGE)) imageSource = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_REDNOTAVAILABLE, 12, 12, 0, 0) statusMsg = imageSource + ' ' + statusMsg statusIconTooltip = self.__makeStatusTooltip(False) buttonTooltip = self.__makeButtonTooltip(self.BUILDING_STATUS.NOT_AVAILABLE, None) else: buttonTooltip = self.__makeButtonTooltip(self.BUILDING_STATUS.AVAILABLE, i18n.makeString(FORTIFICATIONS.buildings_buildingname(uid))) infoData['isVisibleBtn'] = isVisibleBtn infoData['isEnableBtn'] = isEnableBtn infoData['statusMsg'] = statusMsg infoData['statusIconTooltip'] = statusIconTooltip infoData['buttonTooltip'] = buttonTooltip buildingIcon = FortViewHelper.getPopoverIconSource(uid, FORT_BATTLE_DIVISIONS.ABSOLUTE.maxFortLevel) infoData['buildingIcon'] = buildingIcon self.as_responseBuildingInfoS(infoData) return
def __packSpecialTypeBlock(self): string = '' addComma = lambda str: ('{0}, '.format(str) if str else str) if self._specials['premium']: string += _ms(TANK_CAROUSEL_FILTER.INFOTIP_ONLY_PREMIUM) if self._specials['elite']: string = addComma(string) string += _ms(TANK_CAROUSEL_FILTER.INFOTIP_ONLY_ELITE) if self._specials['favorite']: string = addComma(string) string += _ms(TANK_CAROUSEL_FILTER.INFOTIP_ONLY_FAVORITE) if self._specials['bonus']: icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_MULTYXP) xpRate = text_styles.stats('x{0}'.format(g_itemsCache.items.shop.dailyXPFactor)) string = addComma(string) string += '{0}{1}'.format(icon, xpRate) if self._specials['igr']: string = addComma(string) string += icons.premiumIgrSmall() return formatters.packTextBlockData(text=text_styles.main(string), padding=formatters.packPadding(top=-5, bottom=5, left=15))
def __makeStatsBlock(self, listValues): lst = [] for item in listValues: flag = item.get('flag', None) if flag is not None and not bool(self.__stateMask & flag): continue localKey = item.get('local', None) value = item.get('value', None) isTimeExpired = item.get('timeExpired', False) tooltipBody = item.get('tooltip', None) textStyle = item.get('textStyle', None) isUseTextStylePattern = textStyle is not None valueStyle = text_styles.stats localKey = i18n.makeString(CLANS.clanprofile_summaryview_blocklbl(localKey)) tooltipHeader = localKey if isTimeExpired: valueStyle = text_styles.standard tooltipBody = CLANS.CLANPROFILE_SUMMARYVIEW_TOOLTIP_RATINGOUTDATED_BODY elif tooltipBody is None: tooltipBody = None tooltipHeader = None if not isinstance(value, str): value = BigWorld.wg_getIntegralFormat(value) icon = item.get('icon', None) if icon is not None: icon = icons.makeImageTag(icon, 16, 16, -4, 0) value = icon + ' ' + value if isUseTextStylePattern: truncateVo = {'isUseTruncate': isUseTextStylePattern, 'textStyle': textStyle, 'maxWidthTF': 140} else: truncateVo = None lst.append({'label': text_styles.main(localKey), 'value': valueStyle(str(value)) if not isUseTextStylePattern else value, 'tooltipHeader': tooltipHeader, 'tooltipBody': i18n.makeString(tooltipBody) if tooltipBody is not None else '', 'isUseTextStyle': isUseTextStylePattern, 'truncateVo': truncateVo}) return lst
def __setCarouselInitData(self): self.as_setCarouselInitS({'icoFilter': RES_ICONS.MAPS_ICONS_BUTTONS_FILTER, 'durationType': _getDurationTypeVO(), 'durationSelectIndex': 0, 'onlyPurchased': True, 'icoPurchased': RES_ICONS.MAPS_ICONS_FILTERS_PRESENCE, 'message': '{2}{0}\n{1}'.format(text_styles.neutral(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_HEADER), text_styles.main(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_DESCRIPTION), icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, vSpace=-3)), 'fitterTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_FILTER_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_FILTER_BODY), 'chbPurchasedTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_BODY)})
def __stateTextStyleFormatter(self, state): if self.__restrictionType in self.__WARNING_UNIT_MESSAGES and self._playerInfo.isReady: return ' '.join((icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON, vSpace=-3), text_styles.alert(state))) if self.__restrictionType not in self.__NOT_CRITICAL_STATES: return text_styles.error(state) return text_styles.main(state)
def _populate(self): super(ReferralReferrerIntroWindow, self)._populate() blocks = [self.__packContentBlock('invite_block', RES_ICONS.MAPS_ICONS_LIBRARY_REFERRALINVITEICON_1, ctx={'inviteCount': self.__invitesCount, 'link': self.__makeHyperLink(OpenLinkEvent.INVIETES_MANAGEMENT, MENU.REFERRALREFERRERINTROWINDOW_TEXTBLOCK_LINK)}, showLinkBtn=True), self.__packContentBlock('squad_block', RES_ICONS.MAPS_ICONS_BATTLETYPES_40X40_SQUAD), self.__packContentBlock('referrals_block', RES_ICONS.MAPS_ICONS_REFERRAL_REFERRALHAND, ctx={'icon': icons.makeImageTag(RES_ICONS.MAPS_ICONS_REFERRAL_REFERRALSMALLHAND, 16, 16, -4, 0)})] self.as_setDataS({'titleMsg': text_styles.promoTitle(i18n.makeString(MENU.REFERRALREFERRERINTROWINDOW_TITLEMESSAGE)), 'blocksVOs': blocks})
def getAdditionalText(self): result = [] for _, xpFactor in _getRefSystemPeriods(): result.append('%s<nobr>x%s' % (icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_XPCOSTICON, 18, 18, -8, 0), BigWorld.wg_getNiceNumberFormat(xpFactor))) return text_styles.main(_ms(MENU.AWARDWINDOW_REFERRAL_COMPLETE, modifiers=', '.join(result)))
def __setCarouselInitData(self): self.as_setCarouselInitS({'icoFilter': RES_ICONS.MAPS_ICONS_BUTTONS_FILTER, 'durationType': [self.__getDurationTypeVO('{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_ALWAYS), icons.gold()), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_ALWAYS)), _ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_LOWERCASE_ALWAYS))), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_ALWAYS)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED)), self.__getDurationTypeVO('{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_MONTH), icons.credits()), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_MONTH)), _ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_LOWERCASE_MONTH))), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_MONTH)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED)), self.__getDurationTypeVO('{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_WEEK), icons.credits()), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_WEEK)), _ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_LOWERCASE_WEEK))), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_WEEK)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED))], 'durationSelectIndex': 0, 'onlyPurchased': True, 'icoPurchased': RES_ICONS.MAPS_ICONS_FILTERS_PRESENCE, 'message': '{2}{0}\n{1}'.format(text_styles.neutral(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_HEADER), text_styles.main(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_DESCRIPTION), icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16, -3, 0)), 'fitterTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_CAROUSEL_FILTER_HEADER, TOOLTIPS.CUSTOMIZATION_CAROUSEL_FILTER_BODY), 'chbPurchasedTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_HEADER, TOOLTIPS.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_BODY)})
def __prepareAndPassVehiclesData(self): values = [] for vehicleCD in g_itemsCache.items.stats.eliteVehicles: try: vehicle = g_itemsCache.items.getItemByCD(vehicleCD) if not vehicle.xp: continue values.append({'id': vehicle.intCD, 'vehicleType': getVehicleTypeAssetPath(vehicle.type), 'vehicleName': vehicle.shortUserName, 'xp': vehicle.xp, 'xpStrValue': BigWorld.wg_getIntegralFormat(vehicle.xp), 'isSelectCandidate': vehicle.isFullyElite, 'vehicleIco': vehicle.iconSmall, 'nationIco': getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31)}) except: continue labelBuilder = builder().addStyledText('middleTitle', i18n.makeString(MENU.EXCHANGE_RATE)) if self.__xpForFree is not None: labelBuilder.addStyledText(self.__getActionStyle(), i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL)) labelBuilder.addStyledText('expText', i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE, icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2), forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree))) exchangeHeaderData = {'labelText': labelBuilder.render(), 'rateFromIcon': ICON_TEXT_FRAMES.GOLD, 'rateToIcon': ICON_TEXT_FRAMES.ELITE_XP, 'rateFromTextColor': self.app.colorManager.getColorScheme('textColorGold').get('rgb'), 'rateToTextColor': self.app.colorManager.getColorScheme('textColorCredits').get('rgb')} vehicleData = {'isHaveElite': bool(values), 'vehicleList': values, 'tableHeader': self._getTableHeader(), 'xpForFree': self.__xpForFree, 'exchangeHeaderData': exchangeHeaderData} self.as_vehiclesDataChangedS(vehicleData) return