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 _populate(self):
     super(FalloutBattleSelectorWindow, self)._populate()
     self.addListener(
         events.HideWindowEvent.HIDE_BATTLE_SESSION_WINDOW,
         self.__handleFalloutWindowHide,
         scope=EVENT_BUS_SCOPE.LOBBY,
     )
     self.startGlobalListening()
     self.__falloutCtrl = getFalloutCtrl()
     self.__falloutCtrl.onSettingsChanged += self.__updateFalloutSettings
     self.as_setInitDataS(
         {
             "windowTitle": FALLOUT.BATTLESELECTORWINDOW_TITLE,
             "headerTitleStr": promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_HEADERTITLESTR),
             "headerDescStr": main(FALLOUT.BATTLESELECTORWINDOW_HEADERDESC),
             "dominationBattleTitleStr": promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_DOMINATION_TITLE),
             "dominationBattleDescStr": main(FALLOUT.BATTLESELECTORWINDOW_DOMINATION_DESCR),
             "dominationBattleBtnStr": FALLOUT.BATTLESELECTORWINDOW_DOMINATIONBATTLEBTNLBL,
             "multiteamTitleStr": promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_MULTITEAM_TITLE),
             "multiteamDescStr": main(FALLOUT.BATTLESELECTORWINDOW_MULTITEAM_DESCR),
             "multiteamBattleBtnStr": FALLOUT.BATTLESELECTORWINDOW_MULTITEAMBATTLEBTNLBL,
             "bgImg": RES_ICONS.MAPS_ICONS_LOBBY_FALLOUTBATTLESELECTORBG,
         }
     )
     if self.prbDispatcher.getFunctionalState().hasLockedState:
         self.as_setBtnStatesS(
             {"dominationBtnEnabled": False, "multiteamBtnEnabled": False, "closeBtnEnabled": False}
         )
Exemplo n.º 3
0
 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(CyberSportIntroView, self)._populate()
     self.addListener(CSVehicleSelectEvent.VEHICLE_SELECTED,
                      self.__updateSelectedVehicles)
     self.itemsCache.onSyncCompleted += self.__onCacheResync
     data = {
         'titleLblText':
         text_styles.promoTitle(CYBERSPORT.WINDOW_INTRO_TITLE),
         'descrLblText':
         text_styles.main(CYBERSPORT.WINDOW_INTRO_DESCRIPTION),
         'listRoomTitleLblText':
         text_styles.promoSubTitle(CYBERSPORT.WINDOW_INTRO_SEARCH_TITLE),
         'listRoomDescrLblText':
         text_styles.main(CYBERSPORT.WINDOW_INTRO_SEARCH_DESCRIPTION),
         'listRoomBtnLabel':
         _ms(CYBERSPORT.WINDOW_INTRO_SEARCH_BTN),
         'autoTitleLblText':
         text_styles.middleTitle(CYBERSPORT.WINDOW_INTRO_AUTO_TITLE),
         'autoDescrLblText':
         text_styles.main(CYBERSPORT.WINDOW_INTRO_AUTO_DESCRIPTION),
         'vehicleBtnTitleTfText':
         text_styles.standard(CYBERSPORT.BUTTON_CHOOSEVEHICLES_SELECTED),
         'rightBlockHeader':
         text_styles.promoSubTitle(CYBERSPORT.INTROVIEW_RIGHTBLOCK_HEADER),
         'rightBlockDescr':
         text_styles.main(CYBERSPORT.INTROVIEW_RIGHTBLOCK_DESCR),
         'rightBlockBtnLbl':
         _ms(CYBERSPORT.INTROVIEW_RIGHTBLOCK_BTNLABEL)
     }
     self.as_setTextsS(data)
     self.__checkSelectedVehicles()
     self.__updateAutoSearchVehicle(self.__getSelectedVehicles())
 def __getHeaderData(self):
     vehicle = g_currentPreviewVehicle.item
     return {
         'tankType':
         '{}_elite'.format(vehicle.type)
         if vehicle.isElite else vehicle.type,
         'tankInfo':
         text_styles.concatStylesToMultiLine(
             text_styles.promoSubTitle(vehicle.userName),
             text_styles.stats(MENU.levels_roman(vehicle.level))),
         'closeBtnLabel':
         VEHICLE_PREVIEW.HEADER_CLOSEBTN_LABEL,
         'backBtnLabel':
         VEHICLE_PREVIEW.HEADER_BACKBTN_LABEL,
         'backBtnDescrLabel':
         self.__getBackBtnLabel(),
         'titleText':
         text_styles.promoTitle(VEHICLE_PREVIEW.HERO_HEADER_TITLE)
         if self.__isHeroTank else text_styles.promoTitle(
             VEHICLE_PREVIEW.HEADER_TITLE),
         'isPremiumIGR':
         vehicle.isPremiumIGR,
         'showCloseBtn':
         self._showHeaderCloseBtn
     }
Exemplo n.º 6
0
 def _populate(self):
     super(HangarVehicleInfo, self)._populate()
     if self.__isFirstEnter:
         self.__showIntroPage()
         self.__isFirstEnter = False
     self.__battleRoyaleController.onUpdated += self.__onBattleRoyaleEnabledChanged
     self.startGlobalListening()
     self.as_setTabsDataS(_getTabData())
     self.as_setDataS({
         'btnInfoLabel':
         backport.text(R.strings.battle_royale.hangarVehicleInfo.infoBtn()),
         'btnCloseLabel':
         backport.text(
             R.strings.battle_royale.hangarVehicleInfo.closeBtn()),
         'infoIconSource':
         backport.image(R.images.gui.maps.icons.library.info()),
         'engineLabel':
         backport.text(
             R.strings.battle_royale.hangarVehicleInfo.weakZones.engine()),
         'ammunitionLabel':
         backport.text(R.strings.battle_royale.hangarVehicleInfo.weakZones.
                       ammunition()),
         'vehTitle':
         text_styles.promoSubTitle(self.__vehicle.shortUserName),
         'nationIcon':
         getVehicleNationIcon(self.__vehicle),
         'weakZones':
         _getVehicleWeakZonesImage(self.__vehicle)
     })
Exemplo n.º 7
0
def _getPositionText(ladderInfo):
    if ladderInfo.isInLadder():
        positionStr = _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_LADDER_PLACE,
                          place=ladderInfo.position)
        return text_styles.promoSubTitle(positionStr)
    else:
        return ''
Exemplo n.º 8
0
 def update(self, *args):
     self._personalQuestID = None
     if self._currentVehicle.isPresent():
         vehicle = self._currentVehicle.item
         if self._questController.isNewbiePlayer():
             tutorialChapters = self._getTutorialChapters()
         else:
             tutorialChapters = None
         headerVO = {
             'tankType':
             '{}_elite'.format(vehicle.type)
             if vehicle.isElite else vehicle.type,
             'tankInfo':
             text_styles.concatStylesToMultiLine(
                 text_styles.promoSubTitle(vehicle.shortUserName),
                 text_styles.stats(MENU.levels_roman(vehicle.level))),
             'isPremIGR':
             vehicle.isPremiumIGR,
             'isVisible':
             True,
             'isBeginner':
             bool(tutorialChapters)
         }
         if tutorialChapters:
             headerVO.update(self.__getBeginnerQuestsVO(tutorialChapters))
         else:
             headerVO.update(self.__getBattleQuestsVO(vehicle))
             headerVO.update(self.__getPersonalQuestsVO(vehicle))
     else:
         headerVO = {'isVisible': False}
     self.as_setDataS(headerVO)
     return
Exemplo n.º 9
0
 def update(self, *args):
     self._personalQuestID = None
     if self._currentVehicle.isPresent():
         vehicle = self._currentVehicle.item
         from gui.shared.formatters import text_styles
         from gui.Scaleform.locale.MENU import MENU
         from bootcamp.Bootcamp import g_bootcamp
         headerVO = {
             'tankType':
             '{}_elite'.format(vehicle.type)
             if vehicle.isElite else vehicle.type,
             'tankInfo':
             text_styles.concatStylesToMultiLine(
                 text_styles.promoSubTitle(vehicle.shortUserName),
                 text_styles.stats(MENU.levels_roman(vehicle.level))),
             'isPremIGR':
             vehicle.isPremiumIGR,
             'isVisible':
             True
         }
         headerVO.update(self.getFakeQuestData())
         headerVO.update(self.getFakeQuestData())
     else:
         headerVO = {'isVisible': False}
     self.as_setDataS(headerVO)
     return
Exemplo n.º 10
0
 def _populate(self):
     super(QuestsPersonalWelcomeView, self)._populate()
     falloutEnabled = g_lobbyContext.getServerSettings(
     ).isFalloutQuestEnabled()
     if falloutEnabled:
         announcementIcon = ARENA_GUI_TYPE_LABEL.LABELS[
             ARENA_GUI_TYPE.FALLOUT_CLASSIC]
         announcementText = text_styles.promoSubTitle(
             QUESTS.QUESTSPERSONALWELCOMEVIEW_ANNOUNCEMENTTEXT)
         background = RES_ICONS.MAPS_ICONS_QUESTS_PROMOSCREEN_FALLOUT
     else:
         announcementIcon = None
         announcementText = None
         background = RES_ICONS.MAPS_ICONS_QUESTS_PROMOSCREEN
     self.as_setDataS({
         'buttonLbl':
         QUESTS.QUESTSPERSONALWELCOMEVIEW_BTNLABEL,
         'titleText':
         text_styles.promoTitle(
             i18n.makeString(
                 QUESTS.QUESTSPERSONALWELCOMEVIEW_MAINTITLE_TEXTLABEL)),
         'blockData':
         self.__makeBlocksData(),
         'showAnnouncement':
         falloutEnabled,
         'announcementIcon':
         announcementIcon,
         'announcementText':
         announcementText,
         'background':
         background
     })
     return
 def _populate(self):
     super(ClanProfileGlobalMapPromoView, self)._populate()
     self.as_setDataS({'header': text_styles.promoSubTitle(_ms(CLANS.GLOBALMAPVIEW_PROMO_HEADER)),
      'description': text_styles.main(_ms(CLANS.GLOBALMAPVIEW_PROMO_DESCRIPTION)),
      'infoLinkLabel': _ms(CLANS.GLOBALMAPVIEW_PROMO_INFOLINK),
      'mapLinkLabel': _ms(CLANS.GLOBALMAPVIEW_PROMO_MAPLINK),
      'background': RES_ICONS.MAPS_ICONS_CLANS_GLOBAL_MAP_PROMO})
 def __getCycleWithoutAchievements(self, cycle):
     if cycle.status == CYCLE_STATUS.PAST:
         text = _ms(RANKED_BATTLES.
                    RANKEDBATTLESCYCLESVIEW_NOACHIEVEMENTS_PAST_FOOTER,
                    points=text_styles.critical(0))
         isDateOff = True
         contentID = RANKEDBATTLES_ALIASES.PAST_MISSED
     else:
         dateFormatKey = RANKED_BATTLES.RANKEDBATTLEHEADER_TOOLTIP_DATE
         text = _ms(RANKED_BATTLES.
                    RANKEDBATTLESCYCLESVIEW_NOACHIEVEMENTS_FUTURE_FOOTER,
                    start=time_formatters.formatDate(
                        dateFormatKey, cycle.startDate),
                    end=time_formatters.formatDate(dateFormatKey,
                                                   cycle.endDate))
         isDateOff = False
         contentID = RANKEDBATTLES_ALIASES.FUTURE
     return {
         'contentID': contentID,
         'nextStage': {
             'header':
             text_styles.promoSubTitle(
                 _ms(RANKED_BATTLES.RANKEDBATTLEVIEW_NEXTSTAGEBLOCK_STAGE,
                     cycleNumber=cycle.ordinalNumber)),
             'calendarDay':
             time_formatters.formatDate('%d', cycle.startDate),
             'dateOff':
             isDateOff,
             'points':
             text_styles.main(text)
         },
         'awardsRibbon': None
     }
    def __makeBlocksData(self):
        result = []
        for blockName in ('block1', 'block2', 'block3'):
            result.append({'blockTitle': text_styles.promoSubTitle(i18n.makeString(QUESTS.questspersonalwelcomeview_textblock_header(blockName))),
             'blockBody': text_styles.main(i18n.makeString(QUESTS.questspersonalwelcomeview_textblock_body(blockName)))})

        return result
Exemplo n.º 14
0
 def makeStatusLabel(self):
     isWin = self._reusable.getPersonalTeam(
     ) == self._reusable.common.winnerTeam
     rankState = self.getRankChangeStatus()
     rankInfo = self._reusable.personal.getRankInfo()
     shieldState = rankInfo.shieldState
     resultLabel = backport.text(self._STATUS_LABEL_MAP[rankState])
     resultSubLabel = ''
     if rankState in (_RCS.LEAGUE_EARNED, _RCS.DIVISION_EARNED,
                      _RCS.QUAL_EARNED, _RCS.QUAL_UNBURN_EARNED):
         return ''
     if rankState == _RCS.NOTHING_CHANGED and isWin:
         resultLabel = backport.text(
             R.strings.ranked_battles.battleresult.status.stageNotEarned())
     if shieldState == RANKEDBATTLES_ALIASES.SHIELD_LOSE:
         resultLabel = backport.text(
             R.strings.ranked_battles.battleresult.status.shieldLose())
         resultSubLabel = backport.text(
             R.strings.ranked_battles.battleresult.status.shieldWarning())
     if shieldState == RANKEDBATTLES_ALIASES.SHIELD_LOSE_STEP:
         resultSubLabel = backport.text(
             R.strings.ranked_battles.battleresult.status.shieldCount(),
             count=text_styles.highTitle(rankInfo.shieldHP))
     if shieldState in RANKEDBATTLES_ALIASES.SHIELD_RENEW_STATES:
         resultSubLabel = backport.text(
             R.strings.ranked_battles.battleresult.status.shieldRenew())
     return text_styles.concatStylesToMultiLine(
         text_styles.heroTitle(resultLabel),
         text_styles.promoSubTitle(resultSubLabel))
Exemplo n.º 15
0
 def update(self, *args):
     self._personalQuestID = None
     key = getBootcampInternalHideElementName(self.__componentKey)
     visibleSettings = self.bootcampCtrl.getLobbySettings()
     headerVisible = key in visibleSettings and not visibleSettings[key]
     if headerVisible and self._currentVehicle.isPresent():
         vehicle = self._currentVehicle.item
         headerVO = {
             'tankType':
             '{}_elite'.format(vehicle.type)
             if vehicle.isElite else vehicle.type,
             'tankInfo':
             text_styles.concatStylesToMultiLine(
                 text_styles.promoSubTitle(vehicle.shortUserName),
                 text_styles.stats(MENU.levels_roman(vehicle.level))),
             'isPremIGR':
             vehicle.isPremiumIGR,
             'isVisible':
             headerVisible,
             'isVehicle':
             True
         }
         headerVO.update(self.getFakeQuestData())
         headerVO.update(self.getFakeQuestData())
     else:
         headerVO = {'isVisible': False}
     headerVO.update({
         'isNYEnabled': False,
         'isNyActive': False,
         'isVisible': True
     })
     self.as_setDataS(headerVO)
     return
Exemplo n.º 16
0
 def _populate(self):
     super(CyberSportIntroView, self)._populate()
     self.addListener(CSVehicleSelectEvent.VEHICLE_SELECTED,
                      self.__updateSelectedVehicles)
     self.as_setTextsS({
         'titleLblText':
         text_styles.promoTitle(CYBERSPORT.WINDOW_INTRO_TITLE),
         'descrLblText':
         text_styles.main(CYBERSPORT.WINDOW_INTRO_DESCRIPTION),
         'listRoomTitleLblText':
         text_styles.promoSubTitle(CYBERSPORT.WINDOW_INTRO_SEARCH_TITLE),
         'listRoomDescrLblText':
         text_styles.main(CYBERSPORT.WINDOW_INTRO_SEARCH_DESCRIPTION),
         'listRoomBtnLabel':
         _ms(CYBERSPORT.WINDOW_INTRO_SEARCH_BTN),
         'autoTitleLblText':
         text_styles.middleTitle(CYBERSPORT.WINDOW_INTRO_AUTO_TITLE),
         'autoDescrLblText':
         text_styles.main(CYBERSPORT.WINDOW_INTRO_AUTO_DESCRIPTION),
         'vehicleBtnTitleTfText':
         text_styles.standard(CYBERSPORT.BUTTON_CHOOSEVEHICLES_SELECTED),
         'regulationsInfoText':
         '{0}{1}'.format(
             icons.info(),
             text_styles.main(CYBERSPORT.LADDERREGULATIONS_INFO)),
         'regulationsInfoTooltip':
         TOOLTIPS_CONSTANTS.LADDER_REGULATIONS
     })
     self.__updateClubData()
     self.__updateAutoSearchVehicle(self.__getSelectedVehicles())
     self.startMyClubListening()
     self.clubsCtrl.getAvailabilityCtrl(
     ).onStatusChanged += self.onStatusChanged
 def _init(self):
     super(VehicleCompareConfiguratorView, self)._init()
     currentVehicle = self._container.getCurrentVehicle()
     enableCamo = bool(cmp_helpers.getSuitableCamouflage(currentVehicle))
     topModulesFromStock = self._container.isTopModulesFromStock()
     enableTopModules = not (currentVehicle.isPremium or topModulesFromStock)
     isInInventory = self._container.getBasketVehCmpData().isInInventory()
     if isInInventory:
         self.__currentCrewMonitor = _CurrentCrewMonitor(self._container)
     self.as_setInitDataS({'title': text_styles.promoSubTitle(_ms(VEH_COMPARE.VEHCONF_HEADER, vehName=currentVehicle.userName)),
      'resetBtnLabel': VEH_COMPARE.VEHCONF_RESETBTNLABEL,
      'cancelBtnLabel': VEH_COMPARE.VEHCONF_CANCELBTNLABEL,
      'applyBtnLabel': VEH_COMPARE.VEHCONF_APPLYBTNLABEL,
      'resetBtnTooltip': VEH_COMPARE.VEHCONF_RESETBTNLABEL_TOOLTIP,
      'cancelBtnTooltip': VEH_COMPARE.VEHCONF_CANCELBTNLABEL_TOOLTIP,
      'applyBtnTooltip': VEH_COMPARE.VEHCONF_COMPAREBTNLABEL_TOOLTIP,
      'crewLevels': self.__getCrewLevels(isInInventory),
      'enableTopModules': enableTopModules,
      'enableCamo': enableCamo})
     self.__updateCrewLvl()
     self.__updateShellSlots()
     self.as_setSelectedAmmoIndexS(self._container.getCurrentShellIndex())
     self.as_setCamoS(self._container.isCamouflageSet())
     if currentVehicle.descriptor.type.hasCustomDefaultCamouflage:
         self.as_disableCamoS()
     self.__updateControlBtns()
     topModulesSelected = topModulesFromStock or self._container.isTopModulesSelected()
     self.as_setTopModulesSelectedS(topModulesSelected)
     self.__updateCrewAttentionIcon()
     self.__updateSkillsData()
     self.__updateSlotsData(VEHICLE_FITTING_SLOTS)
     initialVehicle, _ = self._container.getInitialVehicleData()
     self.__parametersView.init(currentVehicle, initialVehicle)
Exemplo n.º 18
0
 def __getHeaderData(self):
     key = _BACK_BTN_LABELS.get(self.__backAlias, 'hangar')
     backBtnDescrLabel = '#veh_compare:header/backBtn/descrLabel/{}'.format(key)
     return {'closeBtnLabel': VEH_COMPARE.HEADER_CLOSEBTN_LABEL,
      'backBtnLabel': VEH_COMPARE.HEADER_BACKBTN_LABEL,
      'backBtnDescrLabel': backBtnDescrLabel,
      'titleText': text_styles.promoSubTitle(VEH_COMPARE.VEHICLECOMPAREVIEW_HEADER)}
Exemplo n.º 19
0
 def __updateFormationData(self, club):
     profile = self.clubsCtrl.getProfile()
     link = makeHtmlString('html_templates:lobby/clubs', 'link', {'text': i18n.makeString(CYBERSPORT.STATICFORMATIONPROFILEWINDOW_HYPERLINK_TEXT),
      'linkType': 'clubSettings'})
     canChange = self.clubsState.getLimits().canChangeWebSettings(profile, club).success
     self.as_updateFormationInfoS({'isShowLink': canChange,
      'editLinkText': text_styles.main(link),
      'formationNameText': text_styles.promoSubTitle(club.getUserName())})
Exemplo n.º 20
0
 def __getHeaderData(self):
     vehicle = g_currentPreviewVehicle.item
     return {'tankType': '{}_elite'.format(vehicle.type) if vehicle.isElite else vehicle.type,
      'tankInfo': text_styles.concatStylesToMultiLine(text_styles.promoSubTitle(vehicle.shortUserName), text_styles.stats(MENU.levels_roman(vehicle.level))),
      'closeBtnLabel': VEHICLE_PREVIEW.HEADER_CLOSEBTN_LABEL,
      'backBtnLabel': VEHICLE_PREVIEW.HEADER_BACKBTN_LABEL,
      'backBtnDescrLabel': self.__getBackBtnLabel(),
      'titleText': text_styles.promoTitle(VEHICLE_PREVIEW.HEADER_TITLE),
      'isPremiumIGR': vehicle.isPremiumIGR}
Exemplo n.º 21
0
 def __setHeaderInitData(self):
     isElite = g_currentVehicle.item.isElite
     vTypeId = g_currentVehicle.item.type
     vTypeId = '{0}_elite'.format(vTypeId) if isElite else vTypeId
     self.as_setHeaderDataS({'titleText': text_styles.promoTitle(VEHICLE_CUSTOMIZATION.CUSTOMIZATIONHEADER_TITLE),
      'tankName': text_styles.promoSubTitle(g_currentVehicle.item.userName),
      'tankType': vTypeId,
      'isElite': isElite,
      'closeBtnTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_HEADERCLOSEBTN_HEADER, TOOLTIPS.CUSTOMIZATION_HEADERCLOSEBTN_BODY)})
Exemplo n.º 22
0
 def __setHeaderInitData(self):
     isElite = g_currentVehicle.item.isElite
     vTypeId = g_currentVehicle.item.type
     vTypeId = '{0}_elite'.format(vTypeId) if isElite else vTypeId
     self.as_setHeaderDataS({'titleText': text_styles.promoTitle(VEHICLE_CUSTOMIZATION.CUSTOMIZATIONHEADER_TITLE),
      'tankName': text_styles.promoSubTitle(g_currentVehicle.item.userName),
      'tankType': vTypeId,
      'isElite': isElite,
      'closeBtnTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_HEADERCLOSEBTN_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_HEADERCLOSEBTN_BODY)})
Exemplo n.º 23
0
 def _populate(self):
     super(QuestsPersonalWelcomeView, self)._populate()
     self.as_setDataS({'buttonLbl': QUESTS.QUESTSPERSONALWELCOMEVIEW_BTNLABEL,
      'titleText': text_styles.promoTitle(i18n.makeString(QUESTS.QUESTSPERSONALWELCOMEVIEW_MAINTITLE_TEXTLABEL)),
      'blockData': self.__makeBlocksData(),
      'showAnnouncement': True,
      'announcementIcon': ARENA_GUI_TYPE_LABEL.LABELS[ARENA_GUI_TYPE.EVENT_BATTLES],
      'announcementText': text_styles.promoSubTitle(QUESTS.QUESTSPERSONALWELCOMEVIEW_ANNOUNCEMENTTEXT),
      'background': RES_ICONS.MAPS_ICONS_QUESTS_PROMOSCREEN})
Exemplo n.º 24
0
 def _populate(self):
     super(FalloutBattleSelectorWindow, self)._populate()
     self.addListener(events.HideWindowEvent.HIDE_BATTLE_SESSION_WINDOW, self.__handleFalloutWindowHide, scope=EVENT_BUS_SCOPE.LOBBY)
     self.startGlobalListening()
     self.as_setInitDataS({'windowTitle': FALLOUT.BATTLESELECTORWINDOW_TITLE,
      'headerTitleStr': promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_HEADERTITLESTR),
      'headerDescStr': main(FALLOUT.BATTLESELECTORWINDOW_HEADERDESC),
      'dominationBattleTitleStr': promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_DOMINATION_TITLE),
      'dominationBattleDescStr': main(FALLOUT.BATTLESELECTORWINDOW_DOMINATION_DESCR),
      'dominationBattleBtnStr': FALLOUT.BATTLESELECTORWINDOW_DOMINATIONBATTLEBTNLBL,
      'multiteamTitleStr': promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_MULTITEAM_TITLE),
      'multiteamDescStr': main(FALLOUT.BATTLESELECTORWINDOW_MULTITEAM_DESCR),
      'multiteamBattleBtnStr': FALLOUT.BATTLESELECTORWINDOW_MULTITEAMBATTLEBTNLBL,
      'bgImg': RES_ICONS.MAPS_ICONS_LOBBY_FALLOUTBATTLESELECTORBG})
     if self.prbDispatcher.getFunctionalState().hasLockedState:
         self.as_setBtnStatesS({'dominationBtnEnabled': False,
          'multiteamBtnEnabled': False,
          'closeBtnEnabled': False})
Exemplo n.º 25
0
 def getTitleBlock(self):
     tankInfo = ''
     tankType = ''
     if g_currentVehicle.isPresent():
         item = g_currentVehicle.item
         tankInfo = text_styles.concatStylesToMultiLine(text_styles.promoSubTitle(item.userName), text_styles.stats(MENU.levels_roman(item.level)))
         tankType = '../maps/icons/vehicleTypes/big/%s.png' % item.type
     return {'title': self.getTitle(),
      'tankType': tankType,
      'tankInfo': tankInfo}
Exemplo n.º 26
0
 def requestMissionData(self, index):
     isObtained = not self._bootcamp.needAwarding()
     vehicleSelector = self.getComponent(QUESTS_ALIASES.MISSIONS_VEHICLE_SELECTOR_ALIAS)
     if vehicleSelector is not None:
         criteria = REQ_CRITERIA.VEHICLE.LEVELS([self._TANK_LEVEL]) | REQ_CRITERIA.IN_OWNERSHIP
         vehicleSelector.setCriteria(criteria, [])
     bTypesData = formatters.packMissionBonusTypeElements([ARENA_BONUS_TYPE.REGULAR])
     bTypes = self._COMMA.join([ iconData.iconLabel for iconData in bTypesData ])
     tooltipBody = makeString(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE_BODY, battleBonusTypes=bTypes)
     missionData = {'title': text_styles.promoSubTitle(backport.text(R.strings.bootcamp.quest.title())),
      'battleConditions': [{'rendererLinkage': MISSIONS_ALIASES.BATTLE_CONDITION,
                            'linkageBig': MISSIONS_ALIASES.ANG_GROUP_BIG_LINKAGE,
                            'isDetailed': True,
                            'data': [{'title': text_styles.promoSubTitle(backport.text(R.strings.bootcamp.quest.name())),
                                      'description': text_styles.highlightText(backport.text(R.strings.bootcamp.quest.condition())),
                                      'state': MISSIONS_ALIASES.NONE,
                                      'icon': backport.image(R.images.gui.maps.icons.quests.battleCondition.c_128.icon_battle_condition_battles_128x128()),
                                      'maxDescLines': self._LINES_IN_DESCR}],
                            'linkage': MISSIONS_ALIASES.ANG_GROUP_DETAILED_LINKAGE}],
      'statusLabel': text_styles.concatStylesWithSpace(icons.inProgress(), text_styles.standard(backport.text(R.strings.quests.missionDetails.missionsComplete(), count=text_styles.stats(self._MISSIONS_DONE), total=text_styles.standard(self._MISSIONS_COUNT)))),
      'awards': [{'label': text_styles.gold(backport.text(R.strings.menu.premium.packet.days3())),
                  'padding': self._AWARD_LABEL_PADDING,
                  'imgSource': backport.image(R.images.gui.maps.icons.quests.bonuses.big.premium_3()),
                  'align': LABEL_ALIGN.RIGHT,
                  'tooltip': TOOLTIPS.AWARDITEM_PREMIUM,
                  'obtainedImage': backport.image(R.images.gui.maps.icons.library.awardObtained()),
                  'isObtained': isObtained,
                  'obtainedImageOffset': self._OBTAINED_IMAGE_OFFSET}, {'label': text_styles.gold(self._GOLD_LABEL),
                  'padding': self._AWARD_LABEL_PADDING,
                  'imgSource': backport.image(R.images.gui.maps.icons.quests.bonuses.big.gold()),
                  'align': LABEL_ALIGN.RIGHT,
                  'tooltip': TOOLTIPS.AWARDITEM_GOLD,
                  'obtainedImage': backport.image(R.images.gui.maps.icons.library.awardObtained()),
                  'isObtained': isObtained,
                  'obtainedImageOffset': self._OBTAINED_IMAGE_OFFSET}],
      'background': 'default',
      'prebattleConditions': [formatters.packMissionPrebattleCondition(text_styles.main(bTypesData[0].iconLabel), ''.join([ iconData.icon for iconData in bTypesData ]), makeTooltip(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE, tooltipBody))],
      'uiDecoration': backport.image(R.images.gui.maps.icons.quests.decorations.default_750x264()),
      'statusTooltipData': {}}
     self.as_setMissionDataS(missionData)
     return
Exemplo n.º 27
0
 def _makeHeaderVO(self):
     if self.app.tutorialManager.hangarHeaderEnabled and self._currentVehicle.isPresent():
         vehicle = self._currentVehicle.item
         headerVO = {'tankType': '{}_elite'.format(vehicle.type) if vehicle.isElite else vehicle.type,
          'tankInfo': text_styles.concatStylesToMultiLine(text_styles.promoSubTitle(vehicle.shortUserName), text_styles.stats(MENU.levels_roman(vehicle.level))),
          'isPremIGR': vehicle.isPremiumIGR,
          'isVisible': True,
          'isBeginner': False}
         self._addQuestsToHeaderVO(headerVO, vehicle)
     else:
         headerVO = {'isVisible': False}
     return headerVO
Exemplo n.º 28
0
 def __updateFalloutSettings(self):
     if not self.__falloutCtrl.isEnabled():
         return self.onWindowClose()
     self.as_setInitDataS({'windowTitle': FALLOUT.BATTLESELECTORWINDOW_TITLE,
      'headerTitleStr': promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_HEADERTITLESTR),
      'headerDescStr': main(FALLOUT.BATTLESELECTORWINDOW_HEADERDESC),
      'dominationBattleTitleStr': promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_DOMINATION_TITLE),
      'dominationBattleDescStr': main(FALLOUT.BATTLESELECTORWINDOW_DOMINATION_DESCR),
      'dominationBattleBtnStr': FALLOUT.BATTLESELECTORWINDOW_DOMINATIONBATTLEBTNLBL,
      'multiteamTitleStr': promoSubTitle(FALLOUT.BATTLESELECTORWINDOW_MULTITEAM_TITLE),
      'multiteamDescStr': main(FALLOUT.BATTLESELECTORWINDOW_MULTITEAM_DESCR),
      'multiteamBattleBtnStr': FALLOUT.BATTLESELECTORWINDOW_MULTITEAMBATTLEBTNLBL,
      'bgImg': RES_ICONS.MAPS_ICONS_LOBBY_FALLOUTBATTLESELECTORBG,
      'multiteamAutoSquadEnabled': self.__falloutCtrl.isAutomatch(),
      'multiteamAutoSquadLabel': FALLOUT.FALLOUTBATTLESELECTORWINDOW_AUTOSQUAD_LABEL,
      'tooltipData': self._getTooltipData()})
     if self.prbDispatcher.getFunctionalState().hasLockedState or not self.__falloutCtrl.canChangeBattleType():
         self.as_setBtnStatesS(self.__getBtnsStateData(False))
     else:
         self.as_setBtnStatesS(self.__getBtnsStateData(True))
     self._onBtnsDisableStateChanged()
Exemplo n.º 29
0
def getPrestigeProgressVO(allQuests, metaLevel, pPrestigeLevel,
                          isMaxMetaLevel):
    maxRewardTokens = metaLevel.get('maxRewardTokens', 0)
    prestigeAwards = _getPrestigeLevelUpAwards(allQuests, maxRewardTokens)
    epicMetaGameCtrl = dependency.instance(IEpicBattleMetaGameController)
    _, maxRewardClaimed, _ = epicMetaGameCtrl.getSeasonData()
    blocksVO = []
    for index, prestigeAward in enumerate(prestigeAwards):
        isSpecialReward = prestigeAward is not None
        isVehicleReward = isSpecialReward and prestigeAward > 0
        isNextBlockFinalReward = index + 1 == maxRewardTokens
        isCurrentOrNextToCurrentBlock = index == pPrestigeLevel or pPrestigeLevel > 0 and index == pPrestigeLevel - 1
        icon = _getPrestigeBlockIconPath(index, pPrestigeLevel, isMaxMetaLevel,
                                         isSpecialReward)
        lineStyle = _getLineSeparatorLinkageForPrestigeLevel(
            index, pPrestigeLevel,
            isMaxMetaLevel) if not isNextBlockFinalReward else ''
        tankText = ''
        levelText = int2roman(index + 1)
        if isVehicleReward:
            itemsCache = dependency.instance(IItemsCache)
            vehicle = itemsCache.items.getItemByCD(prestigeAward)
            icon = _getTankIconPath(vehicle)
            tankText = _formatVehicleNameWithTypeIcon(vehicle)
            levelText = '' if not maxRewardClaimed else _rewardClaimedText()
            lineStyle = ''
        blocksVO.append({
            'prestigeLevel':
            index + 1,
            'levelText':
            levelText,
            'descText':
            tankText,
            'canClaimVehicleReward':
            pPrestigeLevel == maxRewardTokens - 1 and isMaxMetaLevel
            and not maxRewardClaimed,
            'blockStyle':
            _getBlockStyle(index, pPrestigeLevel, isVehicleReward),
            'useShortSeparatorLine':
            isCurrentOrNextToCurrentBlock,
            'lineSeparatorStyle':
            lineStyle,
            'iconPath':
            icon
        })

    return {
        'titleHtmlText':
        text_styles.promoSubTitle(EPIC_BATTLE.PRESTIGEPROGRESS_HEADERTITLE),
        'progressBlocks':
        blocksVO
    }
    def __getCustomOfferData(data):
        for price in data.itemPrice:
            actions = price.get('action')
            if not actions:
                return None
            for action in actions:
                actionType, actionValue = action
                if actionValue == _CUSTOM_OFFER_ACTION_PERCENT:
                    label = backport.text(R.strings.vehicle_preview.buyingPanel.customOffer.buy() if actionType in Currency.ALL else R.strings.vehicle_preview.buyingPanel.customOffer.research())
                    value = ' {}'.format(backport.text(R.strings.quests.action.discount.percent(), value=backport.getIntegralFormat(actionValue)))
                    return text_styles.promoSubTitle(''.join((label, value)))

        return None
 def __packPersistentCount(self, persistentCount):
     persistenName = backport.text(R.strings.tooltips.battleTypes.ranked.
                                   bonusBattle.persistent.title())
     return formatters.packBuildUpBlockData(
         [
             formatters.packTitleDescParameterWithIconBlockData(
                 title=text_styles.middleTitle(persistenName),
                 value=text_styles.promoSubTitle(persistentCount),
                 padding=formatters.packPadding(top=-8, left=48, bottom=-3),
                 titlePadding=formatters.packPadding(top=9, left=34))
         ],
         linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE
     )
 def _packInfoViewVO(self):
     pPrestigeLevel, pMetaLevel, _ = self.epicMetaGameCtrl.getPlayerLevelInfo(
     )
     _, maxRewardClaimed, _ = self.epicMetaGameCtrl.getSeasonData()
     maxRewardTokens = self.lobbyCtx.getServerSettings(
     ).epicMetaGame.metaLevel.get('maxRewardTokens', 0)
     maxMetaLevel = self.lobbyCtx.getServerSettings(
     ).epicMetaGame.metaLevel.get('maxLevel', 0)
     prestigeAllowed = (maxRewardTokens < 0 or pPrestigeLevel !=
                        maxRewardTokens) and pMetaLevel == maxMetaLevel
     currentSeason = self.epicMetaGameCtrl.getCurrentSeason()
     cycleTimes = getActiveCycleTimeFrameStrings(currentSeason)
     if cycleTimes.startDay is not None:
         cycleDescText = '%s %s - %s' % (
             cycleTimes.startMonth, cycleTimes.startDay, cycleTimes.endDay)
     else:
         cycleDescText = ''
     return {
         'backgroundImageSrc':
         RES_ICONS.MAPS_ICONS_EPICBATTLES_BACKGROUNDS_META_BG,
         'smallPageTitleHtmlText':
         text_styles.heroTitle(
             i18n.makeString(
                 EPIC_BATTLE.EPICBATTLESINFOVIEW_BATTLEMODETITLE)),
         'bigPageTitleHtmlText':
         text_styles.epicTitle(
             i18n.makeString(
                 EPIC_BATTLE.EPICBATTLESINFOVIEW_BATTLEMODETITLE)),
         'pageDescriptionHtmlText':
         text_styles.promoSubTitle(cycleDescText),
         'aboutButtonLabel':
         i18n.makeString(
             EPIC_BATTLE.INFOVIEW_ABOUTBUTTON_ABOUTFRONTLINE).upper(),
         'canClaimFinalReward':
         self.__canClaimFinalReward(),
         'epicMetaLevelIconData':
         getProgressionIconVODict(pPrestigeLevel, pMetaLevel),
         'epicRewardRibbonData':
         self._packRewardRibbonData(pPrestigeLevel + 1,
                                    self.eventsCache.getAllQuests(),
                                    maxRewardTokens),
         'epicCombatReservesData':
         self._packCombatReservesVO(self.epicMetaGameCtrl.getSkillPoints()),
         'epicMetaProgressData':
         self._packMetaProgressVO(prestigeAllowed, maxRewardClaimed),
         'epicPrestigeProgressData':
         getPrestigeProgressVO(
             self.eventsCache.getAllQuests(),
             self.lobbyCtx.getServerSettings().epicMetaGame.metaLevel,
             pPrestigeLevel, prestigeAllowed)
     }
Exemplo n.º 33
0
 def _populate(self):
     super(CyberSportIntroView, self)._populate()
     self.addListener(CSVehicleSelectEvent.VEHICLE_SELECTED, self.__updateSelectedVehicles)
     self.as_setTextsS({'titleLblText': text_styles.promoTitle(CYBERSPORT.WINDOW_INTRO_TITLE),
      'descrLblText': text_styles.main(CYBERSPORT.WINDOW_INTRO_DESCRIPTION),
      'listRoomTitleLblText': text_styles.promoSubTitle(CYBERSPORT.WINDOW_INTRO_SEARCH_TITLE),
      'listRoomDescrLblText': text_styles.main(CYBERSPORT.WINDOW_INTRO_SEARCH_DESCRIPTION),
      'listRoomBtnLabel': _ms(CYBERSPORT.WINDOW_INTRO_SEARCH_BTN),
      'autoTitleLblText': text_styles.middleTitle(CYBERSPORT.WINDOW_INTRO_AUTO_TITLE),
      'autoDescrLblText': text_styles.main(CYBERSPORT.WINDOW_INTRO_AUTO_DESCRIPTION),
      'vehicleBtnTitleTfText': text_styles.standard(CYBERSPORT.BUTTON_CHOOSEVEHICLES_SELECTED)})
     self.__updateClubData()
     self.__updateAutoSearchVehicle(self.__getSelectedVehicles())
     self.startMyClubListening()
Exemplo n.º 34
0
 def update(self, *args):
     self._personalQuestID = None
     if self._currentVehicle.isPresent():
         vehicle = self._currentVehicle.item
         headerVO = {'tankType': '{}_elite'.format(vehicle.type) if vehicle.isElite else vehicle.type,
          'tankInfo': text_styles.concatStylesToMultiLine(text_styles.promoSubTitle(vehicle.shortUserName), text_styles.stats(MENU.levels_roman(vehicle.level))),
          'isPremIGR': vehicle.isPremiumIGR,
          'isVisible': True}
         headerVO.update(self.__getBattleQuestsVO(vehicle))
         headerVO.update(self.__getPersonalQuestsVO(vehicle))
     else:
         headerVO = {'isVisible': False}
     self.as_setDataS(headerVO)
     return
Exemplo n.º 35
0
 def __setNoQuestsDescription(self):
     settings = self.lobbyContext.getServerSettings()
     questProgress = self.sessionProvider.shared.questProgress
     if questProgress.areQuestsEnabledForArena():
         if not settings.isPMBattleProgressEnabled():
             self.as_questProgressPerformS({
                 'hasQuestToPerform':
                 False,
                 'noQuestTitle':
                 text_styles.promoSubTitle(
                     INGAME_GUI.STATISTICS_TAB_QUESTS_SWITCHOFF_TITLE),
                 'noQuestDescr':
                 ''
             })
         else:
             self.as_questProgressPerformS({
                 'hasQuestToPerform':
                 questProgress.hasQuestsToPerform(),
                 'noQuestTitle':
                 text_styles.promoSubTitle(
                     INGAME_GUI.STATISTICS_TAB_QUESTS_NOTHINGTOPERFORM_TITLE
                 ),
                 'noQuestDescr':
                 text_styles.highlightText(
                     INGAME_GUI.STATISTICS_TAB_QUESTS_NOTHINGTOPERFORM_DESCR
                 )
             })
     else:
         self.as_questProgressPerformS({
             'hasQuestToPerform':
             False,
             'noQuestTitle':
             text_styles.promoSubTitle(
                 INGAME_GUI.STATISTICS_TAB_QUESTS_NOTAVAILABLE_TITLE),
             'noQuestDescr':
             ''
         })
Exemplo n.º 36
0
    def __makeDetailsData(self, clientIdx):
        result = self._searchDP.getUnitVO(clientIdx)
        cache = self.fortCtrl.getFortBattlesCache()
        maxVehicleLevel = FORT_BATTLE_DIVISIONS.ABSOLUTE.maxVehicleLevel
        if cache is not None:
            item, battleItem = cache.getItem(cache.getSelectedID())
            if battleItem is not None:
                maxVehicleLevel = battleItem.additionalData.division
            isCreated = bool(result)
            isInBattle = False
            isBegin = False
            if battleItem:
                startTimeLeft = battleItem.getRoundStartTimeLeft()
            else:
                startTimeLeft = item.getStartTimeLeft()
            if time_utils.QUARTER_HOUR > startTimeLeft > 0 or item.isHot():
                isBegin = True
            elif startTimeLeft == 0 or item.isInProgress():
                isInBattle = True
            isCreationAvailable = not isCreated and isBegin
            result['titleText'] = text_styles.promoSubTitle(
                i18n.makeString(
                    FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_CREATIONTITLE))
            result['buttonLbl'] = FORTIFICATIONS.SORTIE_LISTVIEW_CREATE
            result['isCreationAvailable'] = not isCreated
            _, clanAbbrev, _ = item.getOpponentClanInfo()
            isDefence = item.getType() == BATTLE_ITEM_TYPE.DEFENCE
            localeStr = FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_TITLE if isDefence else FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_ATTACK_TITLE
            result['detailsTitle'] = text_styles.highTitle(
                i18n.makeString(localeStr, clanName='[%s]' % clanAbbrev))
            result['description'] = text_styles.main(
                i18n.makeString(
                    FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_DESCRIPTION,
                    directionName=i18n.makeString(
                        '#fortifications:General/directionName%d' %
                        item.getDirection())))
            result['isEnableBtn'] = isCreationAvailable
            if isCreationAvailable:
                descrText = FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_CREATIONDESCR
            else:
                descrText = FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_CREATIONDESCR_DISABLE
            result['descrText'] = text_styles.main(i18n.makeString(descrText))
            if isCreated and isInBattle:
                for slot in result['slots']:
                    slot['canBeTaken'] = False

        self.as_setDetailsS(result)
        self._updateVehiclesLabel(int2roman(1), int2roman(maxVehicleLevel))
        return
 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
     }
Exemplo n.º 38
0
def packTotalPropData(sessionStats, propId):
    value = _ECONOMIC_DATA[propId]['value'](sessionStats)
    detailsData = _ECONOMIC_DATA[propId]['detail'](sessionStats)
    params = []
    for paramName in detailsData._fields:
        param = getattr(detailsData, paramName)
        if param:
            params.append({'label': text_styles.standard(backport.text(getattr(R.strings.session_stats.propertyInfo.total.label, paramName)())),
             'value': _PROP_ID_TO_POSITIVE_VALUE_STYLE_MAP[propId](toIntegral(param)) if param > 0 else text_styles.error(toIntegral(param))})

    return {'title': text_styles.promoSubTitle(backport.text(getattr(R.strings.session_stats.propertyInfo.total.label, propId)())),
     'description': text_styles.main(backport.text(R.strings.session_stats.propertyInfo.total.descr())),
     'params': params,
     'icon': getSessionStatsPropImage(propId),
     'total': {'label': text_styles.mainBig(backport.text(R.strings.session_stats.propertyInfo.total.total())),
               'value': text_styles.highlightText(value)}}
Exemplo n.º 39
0
 def _populate(self):
     super(QuestsTileChainsView, self)._populate()
     g_eventsCache.potapov.onProgressUpdated += self._onProgressUpdated
     vehTypeFilter, qStateFilter = self.__getCurrentFilters()
     self.as_setHeaderDataS({'noTasksText': _ms(QUESTS.TILECHAINSVIEW_NOTASKSLABEL_TEXT),
      'header': {'tileID': self.__tile.getID(),
                 'titleText': text_styles.promoSubTitle(_ms(QUESTS.TILECHAINSVIEW_TITLE, name=self.__tile.getUserName() + ' ' + icons.info())),
                 'backBtnText': _ms(QUESTS.TILECHAINSVIEW_BUTTONBACK_TEXT),
                 'backBtnTooltip': TOOLTIPS.PRIVATEQUESTS_BACKBUTTON,
                 'backgroundImagePath': self._HEADER_ICON_PATH % self.__tile.getIconID()},
      'filters': {'filtersLabel': _ms(QUESTS.TILECHAINSVIEW_FILTERSLABEL_TEXT),
                  'vehicleTypeFilterData': formatters._packVehicleTypesFilter(_QuestsFilter.VEH_TYPE_DEFAULT),
                  'taskTypeFilterData': self.__packQuestStatesFilter(),
                  'defVehicleType': vehTypeFilter,
                  'defTaskType': qStateFilter}})
     self._populateTileData()
Exemplo n.º 40
0
 def _populate(self):
     super(CyberSportIntroView, self)._populate()
     self.addListener(CSVehicleSelectEvent.VEHICLE_SELECTED, self.__updateSelectedVehicles)
     self.as_setTextsS({'titleLblText': text_styles.promoTitle(CYBERSPORT.WINDOW_INTRO_TITLE),
      'descrLblText': text_styles.main(CYBERSPORT.WINDOW_INTRO_DESCRIPTION),
      'listRoomTitleLblText': text_styles.promoSubTitle(CYBERSPORT.WINDOW_INTRO_SEARCH_TITLE),
      'listRoomDescrLblText': text_styles.main(CYBERSPORT.WINDOW_INTRO_SEARCH_DESCRIPTION),
      'listRoomBtnLabel': _ms(CYBERSPORT.WINDOW_INTRO_SEARCH_BTN),
      'autoTitleLblText': text_styles.middleTitle(CYBERSPORT.WINDOW_INTRO_AUTO_TITLE),
      'autoDescrLblText': text_styles.main(CYBERSPORT.WINDOW_INTRO_AUTO_DESCRIPTION),
      'vehicleBtnTitleTfText': text_styles.standard(CYBERSPORT.BUTTON_CHOOSEVEHICLES_SELECTED),
      'regulationsInfoText': '{0}{1}'.format(icons.info(), text_styles.main(CYBERSPORT.LADDERREGULATIONS_INFO)),
      'regulationsInfoTooltip': TOOLTIPS_CONSTANTS.LADDER_REGULATIONS})
     self.__updateClubData()
     self.__updateAutoSearchVehicle(self.__getSelectedVehicles())
     self.startMyClubListening()
     self.clubsCtrl.getAvailabilityCtrl().onStatusChanged += self.onStatusChanged
 def _populate(self):
     super(QuestsPersonalWelcomeView, self)._populate()
     falloutEnabled = g_lobbyContext.getServerSettings().isFalloutQuestEnabled()
     if falloutEnabled:
         announcementIcon = ARENA_GUI_TYPE_LABEL.LABELS[ARENA_GUI_TYPE.FALLOUT_CLASSIC]
         announcementText = text_styles.promoSubTitle(QUESTS.QUESTSPERSONALWELCOMEVIEW_ANNOUNCEMENTTEXT)
         background = RES_ICONS.MAPS_ICONS_QUESTS_PROMOSCREEN_FALLOUT
     else:
         announcementIcon = None
         announcementText = None
         background = RES_ICONS.MAPS_ICONS_QUESTS_PROMOSCREEN
     self.as_setDataS({'buttonLbl': QUESTS.QUESTSPERSONALWELCOMEVIEW_BTNLABEL,
      'titleText': text_styles.promoTitle(i18n.makeString(QUESTS.QUESTSPERSONALWELCOMEVIEW_MAINTITLE_TEXTLABEL)),
      'blockData': self.__makeBlocksData(),
      'showAnnouncement': falloutEnabled,
      'announcementIcon': announcementIcon,
      'announcementText': announcementText,
      'background': background})
     return
Exemplo n.º 42
0
    def __makeDetailsData(self, clientIdx):
        result = self._searchDP.getUnitVO(clientIdx)
        cache = self.fortCtrl.getFortBattlesCache()
        maxVehicleLevel = FORT_BATTLE_DIVISIONS.ABSOLUTE.maxVehicleLevel
        if cache is not None:
            item, battleItem = cache.getItem(cache.getSelectedID())
            if battleItem is not None:
                maxVehicleLevel = battleItem.additionalData.division
            isCreated = bool(result)
            isInBattle = False
            isBegin = False
            if battleItem:
                startTimeLeft = battleItem.getRoundStartTimeLeft()
            else:
                startTimeLeft = item.getStartTimeLeft()
            if time_utils.QUARTER_HOUR > startTimeLeft > 0 or item.isHot():
                isBegin = True
            elif startTimeLeft == 0 or item.isInProgress():
                isInBattle = True
            isCreationAvailable = not isCreated and isBegin
            result['titleText'] = text_styles.promoSubTitle(i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_CREATIONTITLE))
            result['buttonLbl'] = FORTIFICATIONS.SORTIE_LISTVIEW_CREATE
            result['isCreationAvailable'] = not isCreated
            _, clanAbbrev, _ = item.getOpponentClanInfo()
            isDefence = item.getType() == BATTLE_ITEM_TYPE.DEFENCE
            localeStr = FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_TITLE if isDefence else FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_ATTACK_TITLE
            result['detailsTitle'] = text_styles.highTitle(i18n.makeString(localeStr, clanName='[%s]' % clanAbbrev))
            result['description'] = text_styles.main(i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_DESCRIPTION, directionName=i18n.makeString('#fortifications:General/directionName%d' % item.getDirection())))
            result['isEnableBtn'] = isCreationAvailable
            if isCreationAvailable:
                descrText = FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_CREATIONDESCR
            else:
                descrText = FORTIFICATIONS.FORTCLANBATTLELIST_DETAILS_CREATIONDESCR_DISABLE
            result['descrText'] = text_styles.main(i18n.makeString(descrText))
            if isCreated and isInBattle:
                for slot in result['slots']:
                    slot['canBeTaken'] = False

        self.as_setDetailsS(result)
        self._updateVehiclesLabel(int2roman(1), int2roman(maxVehicleLevel))
        return
Exemplo n.º 43
0
 def setClubLabel(self, label):
     self.__data['teamHeaderText'] = text_styles.promoSubTitle(label)
Exemplo n.º 44
0
def _getPositionText(ladderInfo):
    if ladderInfo.isInLadder():
        positionStr = _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_LADDER_PLACE, place=ladderInfo.position)
        return text_styles.promoSubTitle(positionStr)
    else:
        return ''