def __makeVO(self, style):
     styleParams = self.__makeParamsVO(style)
     styleName = style.userName
     styleInfoText = style.longDescriptionSpecial
     styleInfo = text_styles.mainBig(
         styleInfoText % {
             'insertion_open': _INSERTION_OPEN_TAG,
             'insertion_close': _INSERTION_CLOSE_TAG
         })
     styleInfoBig = text_styles.mainBig(
         styleInfoText % {
             'insertion_open': _INSERTION_OPEN_TAG_BIG,
             'insertion_close': _INSERTION_CLOSE_TAG
         })
     suitableText = getSuitableText(style, g_currentVehicle.item)
     if suitableText:
         suitableBlock = text_styles.mainBig(
             backport.text(
                 R.strings.vehicle_customization.styleInfo.suitable()))
         suitableBlock += suitableText
     else:
         suitableBlock = text_styles.mainBig(
             backport.text(
                 R.strings.vehicle_customization.styleInfo.suitableAll()))
     return StyleInfoVO(styleName=styleName,
                        styleInfo=styleInfo,
                        styleInfoBig=styleInfoBig,
                        suitableBlock=suitableBlock,
                        styleParams=styleParams)._asdict()
示例#2
0
def _getRestoreBannerStr(param):
    return text_styles.concatStylesToMultiLine(
        text_styles.mainBig(
            backport.text(R.strings.menu.research.restore.commmonInfo())),
        text_styles.mainBig(
            backport.text(R.strings.menu.research.restore.dueDate(),
                          date=param)))
示例#3
0
def buildDualGunPages(headerTitle):
    pages = []
    shootKey = getReadableKey(CommandMapping.CMD_CM_SHOOT)
    chargeKey = getReadableKey(CommandMapping.CMD_CM_CHARGE_SHOT)
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.dualGun.volley_fire.title()),
        text_styles.mainBig(
            backport.text(
                R.strings.ingame_help.detailsHelp.dualGun.volley_fire())),
        [chargeKey],
        backport.image(
            R.images.gui.maps.icons.battleHelp.dualGunHelp.volley_fire()))
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.dualGun.quick_fire.title()),
        text_styles.mainBig(
            backport.text(
                R.strings.ingame_help.detailsHelp.dualGun.quick_fire())),
        [shootKey],
        backport.image(
            R.images.gui.maps.icons.battleHelp.dualGunHelp.quick_fire()))
    return pages
 def packCouponData(self, itemsPack, price):
     labelWithDiscount = _ms(text_styles.mainBig(backport.text(R.strings.vehicle_preview.buyingPanel.frontlinePack.couponLabel())), value=moneyWithIcon(getCouponDiscountForItemPack(itemsPack, price)))
     return {'isSelected': True,
      'label': labelWithDiscount,
      'icon': backport.image(R.images.gui.maps.shop.rewards.c_48x48.frontline_coupon()),
      'tooltip': TOOLTIPS_CONSTANTS.FRONTLINE_COUPON,
      'tooltipBonusesData': getCouponBonusesForItemPack(itemsPack)}
示例#5
0
def _getActionBannerStr(paramDiscount, paramDate=''):
    discountStr = text_styles.grandTitle(''.join(
        ('-', str(paramDiscount), '%')))
    return discountStr if not paramDate else text_styles.concatStylesToMultiLine(
        text_styles.mainBig(
            backport.text(R.strings.menu.barracks.notRecruitedActivateBefore(),
                          date=paramDate)), discountStr)
示例#6
0
    def __formatFragmentsCost(self, intelligenceCost, intelligenceIcon,
                              nationalsCost):
        intelligenceCostText = text_styles.concatStylesWithSpace(
            self.__formatFragment(intelligenceCost, intelligenceIcon, 19),
            text_styles.mainBig(
                backport.text(R.strings.storage.blueprints.card.plus())),
            text_styles.main(
                backport.text(R.strings.storage.blueprints.card.additional())))
        nationalCostTexts = []
        lastPriceIdx = len(nationalsCost) - 1
        for index, (nId, cost) in enumerate(nationalsCost.iteritems()):
            nationName = nations.MAP[nId]
            nationalsCost = self.__gui.systemLocale.getNumberFormat(cost)
            nationalIcon = backport.image(
                R.images.gui.maps.icons.blueprints.fragment.special.dyn(
                    nationName)())
            nationalCostTexts.append({
                'costStr':
                self.__formatFragment(nationalsCost, nationalIcon),
                'delimeterOffset':
                -5,
                'hasDelimeter':
                index < lastPriceIdx
            })

        return (intelligenceCostText, nationalCostTexts)
def getRatingVO(rating):
    resultVO = shared_vos.getRatingVO(rating)
    resultVO['label'] = text_styles.alignText(
        text_styles.mainBig(
            backport.text(R.strings.ranked_battles.rankedBattleMainView.stats.
                          rating.title())), 'center')
    return resultVO
def getEfficiencyVO(currentSeasonEfficiency, currentSeasonEfficiencyDiff):
    resultVO = shared_vos.getEfficiencyVO(currentSeasonEfficiency,
                                          currentSeasonEfficiencyDiff)
    resultVO['label'] = text_styles.alignText(
        text_styles.mainBig(
            backport.text(R.strings.ranked_battles.rankedBattleMainView.stats.
                          seasonEfficiency())), 'center')
    return resultVO
def getRatingVO(rating, isMastered):
    resultVO = shared_vos.getRatingVO(rating)
    label = backport.text(R.strings.ranked_battles.rankedBattleMainView.stats.rating.title())
    value = resultVO['value']
    if not isMastered:
        label = backport.text(R.strings.ranked_battles.rankedBattleMainView.seasonGap.stats.outOfRating())
        value = ' '
    resultVO['label'] = text_styles.alignText(text_styles.mainBig(label), 'center')
    resultVO['value'] = value
    return resultVO
示例#10
0
def buildTrackWithinTrackPages(headerTitle):
    pages = []
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.trackWithinTrack.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.trackWithinTrack.
                          description())), [],
        backport.image(
            R.images.gui.maps.icons.battleHelp.trackWithinTrack.roll_away()))
    return pages
def getYearRewardDataVO(points, awards, rewardingComplete, awardType, compensation, exchange):
    if rewardingComplete:
        title = backport.text(R.strings.ranked_battles.rewardsView.tabs.year.title.awarded(), points=points)
    else:
        title = backport.text(R.strings.ranked_battles.rewardsView.tabs.year.title.notAwarded(), points=points)
    tooltipBody = backport.text(R.strings.tooltips.rankedBattleView.rewardsView.tabs.year.scorePoint.body.mainText())
    if exchange > 0:
        exchangePart = backport.text(R.strings.tooltips.rankedBattleView.rewardsView.tabs.year.scorePoint.body.exchangeText(), points=text_styles.stats(str(STANDARD_POINTS_COUNT)), rankedImg=icons.makeImageTag(backport.image(R.images.gui.maps.icons.rankedBattles.ranked_point_16x16()), 16, 16, -3), crystal=text_styles.stats(exchange), crystalImg=icons.crystal())
        tooltipBody = text_styles.concatStylesToMultiLine(tooltipBody, exchangePart)
    compensationText = ''
    if rewardingComplete and compensation > 0 and exchange > 0:
        if awardType is not None:
            compensationText = text_styles.mainBig(backport.text(R.strings.ranked_battles.rewardsView.tabs.year.compensation.extraPoints(), points=text_styles.highlightText(compensation), rankedImg=icons.makeImageTag(backport.image(R.images.gui.maps.icons.rankedBattles.ranked_point_16x16()), 16, 16, -3), crystal=text_styles.highlightText(compensation * exchange), crystalImg=icons.crystal()))
        else:
            compensationText = text_styles.mainBig(backport.text(R.strings.ranked_battles.rewardsView.tabs.year.compensation.notEnough(), crystal=text_styles.highlightText(compensation * exchange), crystalImg=icons.crystal()))
    return {'title': title,
     'titleIcon': backport.image(R.images.gui.maps.icons.rankedBattles.ranked_point_28x28()),
     'titleTooltip': makeTooltip(header=backport.text(R.strings.tooltips.rankedBattleView.rewardsView.tabs.year.scorePoint.header()), body=tooltipBody),
     'compensation': compensationText,
     'points': points,
     'rewards': awards}
示例#12
0
def buildWheeledPages(headerTitle):
    pages = []
    _addPage(
        pages, headerTitle,
        backport.text(R.strings.ingame_help.detailsHelp.wheeledVeh.
                      stableChassis.title()),
        text_styles.mainBig(
            backport.text(
                R.strings.ingame_help.detailsHelp.wheeledVeh.stableChassis())),
        [],
        backport.image(
            R.images.gui.maps.icons.battleHelp.wheeledHelp.wheel_chassis()))
    _addPage(
        pages, headerTitle,
        backport.text(R.strings.ingame_help.detailsHelp.wheeledVeh.
                      aboutTechnique.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.wheeledVeh.
                          aboutTechnique())), [],
        backport.image(
            R.images.gui.maps.icons.battleHelp.wheeledHelp.wheel_details()))
    return pages
示例#13
0
def buildTurboshaftEnginePages(headerTitle):
    pages = []
    siegeKeyName = getReadableKey(
        CommandMapping.CMD_CM_VEHICLE_SWITCH_AUTOROTATION)
    _addPage(
        pages, headerTitle,
        backport.text(R.strings.ingame_help.detailsHelp.engineMode.
                      engineModePage1.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.engineMode.
                          engineModePage1())), [siegeKeyName],
        backport.image(R.images.gui.maps.icons.battleHelp.turboshaftEngineHelp.
                       engine_mode_page_1()))
    _addPage(
        pages, headerTitle,
        backport.text(R.strings.ingame_help.detailsHelp.engineMode.
                      engineModePage2.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.engineMode.
                          engineModePage2())), [],
        backport.image(R.images.gui.maps.icons.battleHelp.turboshaftEngineHelp.
                       engine_mode_page_2()))
    return pages
示例#14
0
def buildBattleRoyalePages(headerTitle, mapGeometryName):
    pages = []
    mapResourceName = 'c_' + replaceHyphenToUnderscore(mapGeometryName)
    imagePath = R.images.gui.maps.icons.battleHelp.battleRoyale.dyn(
        mapResourceName)
    if not imagePath.isValid():
        raise SoftException(
            'No icons found for map {}'.format(mapGeometryName))
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.battleRoyale.radar.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.radar.
                          description())), [],
        backport.image(imagePath.br_radar()))
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.battleRoyale.zone.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.zone.
                          description())), [],
        backport.image(imagePath.br_zone()))
    _addPage(
        pages, headerTitle,
        backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.
                      sectorVision.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.
                          sectorVision.description())), [],
        backport.image(imagePath.br_sector()))
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.battleRoyale.airDrop.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.
                          airDrop.description())), [],
        backport.image(imagePath.br_airdrop()))
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.battleRoyale.upgrade.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.
                          upgrade.description())), [],
        backport.image(imagePath.br_tree()))
    _addPage(
        pages, headerTitle,
        backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.
                      uniqueAbilities.title()),
        text_styles.mainBig(
            backport.text(R.strings.ingame_help.detailsHelp.battleRoyale.
                          uniqueAbilities.description())), [],
        backport.image(imagePath.br_unique_abilities()))
    return pages
示例#15
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)}}
示例#16
0
def buildSiegeModePages(headerTitle):
    pages = []
    siegeKeyName = getReadableKey(
        CommandMapping.CMD_CM_VEHICLE_SWITCH_AUTOROTATION)
    keyName = siegeKeyName if siegeKeyName else backport.text(
        R.strings.ingame_help.detailsHelp.noKey())
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.wheeledVeh.twoModes.title()),
        text_styles.mainBig(
            backport.text(
                R.strings.ingame_help.detailsHelp.wheeledVeh.twoModes(),
                key1=keyName)), [siegeKeyName],
        backport.image(
            R.images.gui.maps.icons.battleHelp.wheeledHelp.wheel_two_mode()))
    return pages
def buildFunRandomPages(headerTitle):
    pages = []
    numPages = R.images.gui.maps.icons.battleHelp.funRandom.length()
    for i in xrange(numPages):
        dynKey = 'mode%s' % (i + 1)
        _addPage(
            pages, headerTitle,
            backport.text(
                R.strings.ingame_help.detailsHelp.funRandom.dyn(
                    dynKey).title()),
            text_styles.mainBig(
                backport.text(
                    R.strings.ingame_help.detailsHelp.funRandom.dyn(
                        dynKey).description())), [], [],
            backport.image(
                R.images.gui.maps.icons.battleHelp.funRandom.dyn(dynKey)()))

    return pages
示例#18
0
def buildBurnoutPages(headerTitle):
    pages = []
    breakeKeyName = getReadableKey(CommandMapping.CMD_BLOCK_TRACKS)
    forwardKeyName = getReadableKey(CommandMapping.CMD_MOVE_FORWARD)
    keyName1 = breakeKeyName if breakeKeyName else backport.text(
        R.strings.ingame_help.detailsHelp.noKey())
    keyName2 = forwardKeyName if forwardKeyName else backport.text(
        R.strings.ingame_help.detailsHelp.noKey())
    _addPage(
        pages, headerTitle,
        backport.text(
            R.strings.ingame_help.detailsHelp.wheeledVeh.burnout.title()),
        text_styles.mainBig(
            backport.text(
                R.strings.ingame_help.detailsHelp.wheeledVeh.burnout(),
                key1=keyName1,
                key2=keyName2)), [forwardKeyName, breakeKeyName],
        backport.image(
            R.images.gui.maps.icons.battleHelp.wheeledHelp.wheel_burnout()))
    return pages
示例#19
0
def buildRoleTypePages(headerTitle, roleType):
    roleActions = []
    rolesToActions = getRolesActions()
    for action in rolesToActions[roleType]:
        actionLabel = ACTION_TYPE_TO_LABEL[action]
        roleActions.append({
            'image':
            backport.image(
                R.images.gui.maps.icons.roleExp.actions.c_128x128.dyn(
                    actionLabel)()),
            'description':
            backport.text(R.strings.menu.roleExp.action.dyn(actionLabel)())
        })

    roleTypeLabel = ROLE_TYPE_TO_LABEL[roleType]
    pages = []
    _addPage(
        pages,
        headerTitle,
        text_styles.superPromoTitle(
            backport.text(R.strings.menu.roleExp.roleName.dyn(roleTypeLabel)(),
                          groupName=makeHtmlString(
                              'html_templates:vehicleRoles', 'roleTitle', {
                                  'message':
                                  backport.text(
                                      R.strings.menu.roleExp.roleGroupName.dyn(
                                          roleTypeLabel)())
                              }))),
        text_styles.mainBig(
            backport.text(
                R.strings.ingame_help.detailsHelp.role.description())), [],
        backport.image(
            R.images.gui.maps.icons.battleHelp.rolesHelp.dyn(roleTypeLabel)()),
        roleImage=backport.image(
            R.images.gui.maps.icons.roleExp.roles.c_100x100.dyn(roleTypeLabel)
            ()),
        roleActions=roleActions)
    return pages
示例#20
0
def _getUnlockedBannerStr(param):
    return text_styles.concatStylesToMultiLine(
        text_styles.mainBig(
            backport.text(
                R.strings.blueprints.blueprintScreen.researchSale.label())),
        text_styles.grandTitle(''.join(('-', str(param), '%'))))
示例#21
0
    def __makeVO(self):
        vehIdList = self.itemsCache.items.sessionStats.getStatsVehList(
            ARENA_BONUS_TYPE.REGULAR)
        vehiclesDict = self.itemsCache.items.getVehicles(
            REQ_CRITERIA.IN_CD_LIST(vehIdList))
        vehiclesData = []
        vehiclesSortData = []
        if vehiclesDict:
            for intCD, vehicle in vehiclesDict.iteritems():
                data = self.itemsCache.items.sessionStats.getVehiclesStats(
                    ARENA_BONUS_TYPE.REGULAR, intCD)
                vehiclesSortData.append((intCD, (data.battleCnt, vehicle.level,
                                                 data.averageDamage.value)))
                vehiclesData.append({
                    'intCD':
                    intCD,
                    'icon':
                    vehicle.iconSmall,
                    'label':
                    text_styles.main(vehicle.shortUserName),
                    'level':
                    vehicle.level,
                    'nationIcon':
                    getNationIcon(vehicle.nationID, width=155, height=31),
                    'type':
                    vehicle.type,
                    'total':
                    text_styles.stats(toNiceNumber(data.battleCnt)),
                    'damage':
                    text_styles.stats(toIntegral(data.averageDamage.value)),
                    'wtr':
                    text_styles.stats(toNiceNumber(data.wtr.value)),
                    'delta':
                    getDeltaAsData(data.wtr.delta)
                })

        else:
            vehiclesData.append({
                'intCD':
                None,
                'icon':
                backport.image(R.images.gui.maps.icons.library.empty_veh()),
                'total':
                text_styles.stats(toNiceNumber(None)),
                'damage':
                text_styles.stats(toIntegral(None)),
                'wtr':
                text_styles.stats(toNiceNumber(None))
            })
        if vehiclesSortData:
            vehiclesData = self._sortedVehiclesData(vehiclesSortData,
                                                    vehiclesData)
        vehiclesData = vehiclesData[0:_VEH_LIST_LEN]
        return {
            'headerName':
            text_styles.mainBig(
                backport.text(R.strings.menu.inventory.menu.vehicle.name())),
            'headerTotalIcon':
            backport.image(R.images.gui.maps.icons.statistic.battles24()),
            'headerTotalTooltip':
            backport.text(
                R.strings.session_stats.tooltip.header.battleCount()),
            'headerDamageIcon':
            backport.image(R.images.gui.maps.icons.statistic.avgDamage24()),
            'headerDamageTooltip':
            backport.text(R.strings.session_stats.tooltip.header.avgDamage()),
            'headerWtrIcon':
            backport.image(R.images.gui.maps.icons.library.wtrIcon_24()),
            'headerWtrTooltip':
            backport.text(R.strings.session_stats.tooltip.header.wtr()),
            'vehicles':
            vehiclesData
        }
示例#22
0
    def __update(self, _=None):
        headerData = {
            'title':
            backport.text(R.strings.ranked_battles.rankedBattle.title()),
            'leftSideText':
            backport.text(R.strings.ranked_battles.introPage.description()),
            'rightSideText':
            None,
            'tooltip':
            None
        }
        blocksData = []
        for index in range(BLOCKS_COUNT):
            index += 1
            imgSource = backport.image(
                R.images.gui.maps.icons.rankedBattles.intro.dyn(
                    'block{}'.format(index))())
            title = text_styles.promoSubTitle(
                backport.text(
                    R.strings.ranked_battles.introPage.blocks.dyn(
                        'block{}'.format(index)).title()))
            descr = text_styles.mainBig(
                backport.text(
                    R.strings.ranked_battles.introPage.blocks.dyn(
                        'block{}'.format(index)).description()))
            blocksData.append({
                'imgSource': imgSource,
                'title': title,
                'description': descr
            })

        if not self.__rankedController.isYearRewardEnabled():
            blocksData[-1]['imgSource'] = backport.image(
                R.images.gui.maps.icons.rankedBattles.intro.yearRewardDisabled(
                ))
            blocksData[-1]['description'] = text_styles.mainBig(
                backport.text(R.strings.ranked_battles.introPage.blocks.
                              yearRewardDisabled()))
        url = getRankedBattlesIntroPageUrl()
        self.__state = RANKEDBATTLES_CONSTS.INTRO_STATE_NORMAL
        if self.__rankedController.isFrozen():
            self.__state = RANKEDBATTLES_CONSTS.INTRO_STATE_DISABLED
            if not self.__rankedController.getSeasonPassed(
            ) and not self.__rankedController.getCurrentSeason():
                self.__state = RANKEDBATTLES_CONSTS.INTRO_STATE_BEFORE_SEASON
        if self.__state == RANKEDBATTLES_CONSTS.INTRO_STATE_DISABLED:
            self.as_setAlertMessageBlockDataS({
                'alertIcon':
                backport.image(R.images.gui.maps.icons.library.alertBigIcon()),
                'statusText':
                text_styles.vehicleStatusCriticalText(
                    backport.text(
                        R.strings.ranked_battles.introPage.alert.disabled())),
                'buttonVisible':
                False
            })
        elif self.__state == RANKEDBATTLES_CONSTS.INTRO_STATE_BEFORE_SEASON:
            self.__updateTimer()
        if self.__state != RANKEDBATTLES_CONSTS.INTRO_STATE_NORMAL and self.__rankedController.getRankedWelcomeCallback(
        ) is None:
            self.__rankedController.setRankedWelcomeCallback(lambda: None)
        self.as_setDataS({
            'state': self.__state,
            'hasURL': bool(url),
            'headerData': headerData,
            'blocksData': blocksData
        })
        return
def getEfficiencyVO(currentSeasonEfficiency):
    return {'icon': 'efficiency',
     'label': text_styles.alignText(text_styles.mainBig(backport.text(R.strings.ranked_battles.rankedBattleMainView.seasonGap.stats.efficiency())), 'center'),
     'value': ranked_formatters.getFloatPercentStrStat(currentSeasonEfficiency)}
示例#24
0
def _getRentBannerStr(param):
    return text_styles.concatStylesToMultiLine(
        text_styles.mainBig(
            backport.text(R.strings.menu.research.premium.discount())),
        text_styles.grandTitle(''.join(('-', str(param), '%'))))
示例#25
0
def _updateSeparator(separator):
    space = ' '
    return ''.join((space, text_styles.mainBig(separator), space))