Exemplo n.º 1
0
 def construct(self):
     block = []
     isClanLock = self.vehicle.clanLock or None
     isDisabledInRoaming = self.vehicle.isDisabledInRoaming
     if isClanLock or isDisabledInRoaming:
         return block
     else:
         if self.configuration.node is not None:
             result = self.__getTechTreeVehicleStatus(self.configuration, self.vehicle)
         else:
             result = self.__getVehicleStatus(self.configuration.showCustomStates, self.vehicle)
         if result is not None:
             statusLevel = result['level']
             if statusLevel == Vehicle.VEHICLE_STATE_LEVEL.INFO:
                 headerFormatter = text_styles.statInfo
             elif statusLevel == Vehicle.VEHICLE_STATE_LEVEL.CRITICAL:
                 headerFormatter = text_styles.critical
             elif statusLevel == Vehicle.VEHICLE_STATE_LEVEL.WARNING:
                 headerFormatter = text_styles.warning
             elif statusLevel == Vehicle.VEHICLE_STATE_LEVEL.RENTED:
                 headerFormatter = text_styles.warning
             else:
                 LOG_ERROR('Unknown status type "' + statusLevel + '"!')
                 headerFormatter = text_styles.statInfo
             header = headerFormatter(result['header'])
             text = result['text']
             if text is not None and len(text) > 0:
                 block.append(formatters.packTextBlockData(text=header))
                 block.append(formatters.packTextBlockData(text=text_styles.standard(text)))
             else:
                 block.append(formatters.packAlignedTextBlockData(header, BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER))
         return block
Exemplo n.º 2
0
 def _makeLockBlock(self):
     clanLockTime = self.vehicle.clanLock
     if clanLockTime and clanLockTime <= time_utils.getCurrentTimestamp():
         LOG_DEBUG("clan lock time is less than current time: %s" % clanLockTime)
         clanLockTime = None
     isDisabledInRoaming = self.vehicle.isDisabledInRoaming
     if clanLockTime or isDisabledInRoaming:
         headerLock = text_styles.concatStylesToMultiLine(text_styles.warning(_ms(TOOLTIPS.TANKCARUSEL_LOCK_HEADER)))
         if isDisabledInRoaming:
             textLock = text_styles.main(_ms(TOOLTIPS.TANKCARUSEL_LOCK_ROAMING))
         else:
             time = time_utils.getDateTimeFormat(clanLockTime)
             timeStr = text_styles.main(text_styles.concatStylesWithSpace(_ms(TOOLTIPS.TANKCARUSEL_LOCK_TO), time))
             textLock = text_styles.concatStylesToMultiLine(
                 timeStr, text_styles.main(_ms(TOOLTIPS.TANKCARUSEL_LOCK_CLAN))
             )
         lockHeaderBlock = formatters.packTextBlockData(
             headerLock, padding=formatters.packPadding(left=77 + self.leftPadding, top=5)
         )
         lockTextBlock = formatters.packTextBlockData(
             textLock, padding=formatters.packPadding(left=77 + self.leftPadding)
         )
         return formatters.packBuildUpBlockData(
             [lockHeaderBlock, lockTextBlock],
             stretchBg=False,
             linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LOCK_BG_LINKAGE,
             padding=formatters.packPadding(left=-17, top=20, bottom=0),
         )
     else:
         return
         return
Exemplo n.º 3
0
 def _packAppliedToVehicles(self, data):
     subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle('#vehicle_customization:customization/tooltip/applied/title'))]
     allowedVehicles = data['allowedVehicles']
     notAllowedVehicles = data['notAllowedVehicles']
     allowedNations = data['allowedNations']
     notAllowedNations = data['notAllowedNations']
     allowedVehicles = map(lambda vId: g_itemsCache.items.getItemByCD(vId), allowedVehicles)
     notAllowedVehicles = map(lambda vId: g_itemsCache.items.getItemByCD(vId), notAllowedVehicles)
     allowedVehicles = filter(lambda vehicle: not vehicle.isSecret, allowedVehicles)
     notAllowedVehicles = filter(lambda vehicle: not vehicle.isSecret, notAllowedVehicles)
     if data['boundToCurrentVehicle']:
         description = _ms('#tooltips:customization/questAward/currentVehicle')
     elif allowedVehicles:
         description = self._getVehiclesNames(allowedVehicles)
     else:
         if allowedNations:
             if len(allowedNations) > len(notAllowedNations):
                 description = _ms('#vehicle_customization:customization/tooltip/applied/allNations')
                 description += _ms('#vehicle_customization:customization/tooltip/applied/elementsSeparator')
                 description += _ms('#vehicle_customization:customization/tooltip/applied/excludeNations', nations=self._getNationNames(notAllowedNations))
             else:
                 description = _ms('#vehicle_customization:customization/tooltip/applied/vehicleNation', nation=self._getNationNames(allowedNations))
         elif self._item.getNationID() == ANY_NATION:
             description = _ms('#vehicle_customization:customization/tooltip/applied/allNations')
         else:
             description = _ms('#vehicle_customization:customization/tooltip/applied/vehicleNation', nation=self._getNationNames([self._item.getNationID()]))
         if notAllowedVehicles:
             description += _ms('#vehicle_customization:customization/tooltip/applied/elementsSeparator')
             description += _ms('#vehicle_customization:customization/tooltip/applied/excludeVehicles', vehicles=self._getVehiclesNames(notAllowedVehicles))
     subBlocks.append(formatters.packTextBlockData(text_styles.main(description)))
     return formatters.packBuildUpBlockData(subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE)
Exemplo n.º 4
0
 def construct(self):
     isClanLock = self.vehicle.clanLock or None
     isDisabledInRoaming = self.vehicle.isDisabledInRoaming
     if isClanLock or isDisabledInRoaming:
         return
     else:
         if self.configuration.node is not None:
             result = self.__getTechTreeVehicleStatus(self.configuration, self.vehicle)
         else:
             result = self.__getVehicleStatus(self.configuration.showCustomStates, self.vehicle)
         if result is not None:
             statusLevel = result['level']
             if statusLevel == Vehicle.VEHICLE_STATE_LEVEL.INFO:
                 headerFormatter = text_styles.statInfo
             elif statusLevel == Vehicle.VEHICLE_STATE_LEVEL.CRITICAL:
                 headerFormatter = text_styles.critical
             elif statusLevel == Vehicle.VEHICLE_STATE_LEVEL.WARNING:
                 headerFormatter = text_styles.warning
             elif statusLevel == Vehicle.VEHICLE_STATE_LEVEL.RENTED:
                 headerFormatter = text_styles.warning
             else:
                 LOG_ERROR('Unknown status type "' + statusLevel + '"!')
                 headerFormatter = text_styles.statInfo
             header = headerFormatter(result['header'])
             text = result['text']
             if text is not None:
                 text = text_styles.standard(text)
                 padding = formatters.packPadding(left=self.leftPadding, right=self.leftPadding)
             else:
                 header = makeHtmlString('html_templates:lobby/textStyle', 'alignText', {'align': 'center',
                  'message': header})
                 padding = formatters.packPadding(left=0, right=0)
             return [formatters.packTextBlockData(header, padding=padding), formatters.packTextBlockData(text, padding=padding)]
         return
         return
Exemplo n.º 5
0
 def _packBlocks(self, *args, **kwargs):
     items = super(ResearchTreePacker, self)._packBlocks(*args, **kwargs)
     imgPdg = {'left': 12,
      'top': 30}
     txtGap = 2
     blocksGap = 12
     items.append(formatters.packBuildUpBlockData([formatters.packImageTextBlockData(title=text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TECHBLOCK_COMMONTECH_TITLE), desc=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TECHBLOCK_COMMONTECH_DESCRIPTION), img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_COMMONTANK, imgPadding=imgPdg, txtGap=txtGap, imgAtLeft=False), formatters.packImageTextBlockData(title=text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TECHBLOCK_PREMIUMTECH_TITLE), desc=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TECHBLOCK_PREMIUMTECH_DESCRIPTION), img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_PREMTANK, imgPadding=imgPdg, txtGap=txtGap, imgAtLeft=False)], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     imgPdg = {'left': 12,
      'top': 3}
     txtOffset = 34
     txtGap = 0
     blocksGap = 2
     items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TYPESBLOCK_TITLE)),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TYPESBLOCK_LIGHTTANK), img=RES_ICONS.MAPS_ICONS_VEHICLETYPES_LIGHTTANK, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TYPESBLOCK_MEDIUMTANK), img=RES_ICONS.MAPS_ICONS_VEHICLETYPES_MEDIUMTANK, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TYPESBLOCK_HEAVYTANK), img=RES_ICONS.MAPS_ICONS_VEHICLETYPES_HEAVYTANK, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TYPESBLOCK_AT_SPG), img=RES_ICONS.MAPS_ICONS_VEHICLETYPES_AT_SPG, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_TYPESBLOCK_SPG), img=RES_ICONS.MAPS_ICONS_VEHICLETYPES_SPG, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset)], blocksGap))
     imgPdg = {'left': 3,
      'top': 2}
     txtOffset = 82
     txtGap = 0
     blocksGap = 8
     items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_BUTTONSBLOCK_TITLE)),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_BUTTONSBLOCK_RESEARCH), img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_RESEARCHBUTTON, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_BUTTONSBLOCK_BUY), img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_BUYBUTTON, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_BUTTONSBLOCK_INHANGAR), img=RES_ICONS.MAPS_ICONS_LIBRARY_COMPLETEDINDICATOR, imgPadding={'left': 3,
       'top': -3}, txtGap=txtGap, txtOffset=txtOffset)], blocksGap))
     return items
Exemplo n.º 6
0
 def _packDurationBlock(self):
     subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle('#vehicle_customization:timeLeft/title'))]
     if self.__isPermanent:
         duration = _ms('#vehicle_customization:timeLeft/infinity')
     else:
         dimension = _ms('#vehicle_customization:timeLeft/temporal/days')
         duration = _ms('#vehicle_customization:timeLeft/temporal/used', time=self.__duration / 60 / 60 / 24, dimension=dimension)
     subBlocks.append(formatters.packTextBlockData(text_styles.main(duration)))
     return formatters.packBuildUpBlockData(subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE)
 def __packDescriptionBlock(self, intelRequired, nationRequired):
     items = [
         formatters.packTextBlockData(text=text_styles.middleTitle(
             TOOLTIPS.BLUEPRINT_BLUEPRINTEMPTYSLOT_GATHERHEADER)),
         formatters.packTextBlockData(text=text_styles.main(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_GATHERDESCRIPTION1)
                                      ),
         self._packConversionFormulaBlock(intelRequired, nationRequired,
                                          self.__vehicle.nationName,
                                          self.__vehicle.intCD)
     ]
     return formatters.packBuildUpBlockData(blocks=items, gap=4)
 def _packBlocks(self, *args, **kwargs):
     items = super(CrewBookTooltipDataBlock, self)._packBlocks()
     item = self.context.buildItem(*args, **kwargs)
     block = []
     block.append(
         formatters.packTextBlockData(
             text=text_styles.highTitle(item.userName)))
     block.append(
         formatters.packTextBlockData(
             text=text_styles.main(item.fullDescription)))
     items.append(formatters.packBuildUpBlockData(block))
     return items
Exemplo n.º 9
0
 def __packFrozenBlock(self):
     items = []
     items.append(
         formatters.packTextBlockData(text=text_styles.middleTitle(
             backport.text(R.strings.mapbox.questFlag.frozen.header()))))
     items.append(
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.mapbox.questFlag.frozen.text())),
                                      blockWidth=420))
     return formatters.packBuildUpBlockData(items,
                                            padding=formatters.packPadding(
                                                top=20, left=18))
Exemplo n.º 10
0
 def _getMainBlock(self):
     return formatters.packBuildUpBlockData(
         [
             formatters.packTextBlockData(
                 text_styles.middleTitle(
                     TOOLTIPS.PERSONALMISSIONS_FREESHEET_HOWTOGET_TITLE),
                 padding=formatters.packPadding(bottom=-2)),
             formatters.packTextBlockData(
                 text_styles.main(
                     TOOLTIPS.PERSONALMISSIONS_FREESHEET_HOWTOGET_DESCR))
         ],
         padding=formatters.packPadding(top=-4))
Exemplo n.º 11
0
 def __packNotReceivedDescBlock(self):
     return [
         formatters.packTextBlockData(text=text_styles.middleTitle(
             NY.COLLECTIONS_TOOLTIP_DECORATIONS_INFO_HOWTO_TITLE)),
         formatters.packTextBlockData(text=text_styles.main(
             NY.COLLECTIONS_TOOLTIP_DECORATIONS_INFO_HOWTO_TEXT)),
         formatters.packTextBlockData(
             text=text_styles.middleTitle(
                 NY.COLLECTIONS_TOOLTIP_DECORATIONS_INFO_BONUS_TITLE),
             padding=formatters.packPadding(top=20)),
         formatters.packTextBlockData(text=text_styles.main(
             NY.COLLECTIONS_TOOLTIP_DECORATIONS_INFO_BONUS_TEXT))
     ]
 def packBody(self):
     items = [
         formatters.packTextBlockData(
             text_styles.main(
                 backport.text(R.strings.tooltips.badgepage.ranked.
                               suffixItem.position())),
             padding=formatters.packPadding(bottom=4)),
         formatters.packTextBlockData(
             text_styles.main(
                 backport.text(R.strings.tooltips.badgepage.ranked.
                               suffixItem.confirmation())))
     ]
     return formatters.packBuildUpBlockData(items)
Exemplo n.º 13
0
 def _packProgressBlock(self):
     blocks = []
     unlockedLevel = self._item.getLatestOpenedProgressionLevel(
         self.__vehicle)
     if self._showOnlyProgressBlock:
         level = self._progressionLevel
     else:
         level = unlockedLevel + 1
     if level > self._item.getMaxProgressionLevel():
         return None
     else:
         if level == 1:
             titleDesc = backport.text(
                 R.strings.vehicle_customization.customization.infotype.
                 progression.achievementConditionFirstItem())
         else:
             titleDesc = backport.text(
                 R.strings.vehicle_customization.customization.infotype.
                 progression.achievementCondition(),
                 level=int2roman(level))
         blocks.append(
             formatters.packTextBlockData(
                 text=text_styles.middleTitle(titleDesc)))
         conditions = self._item.progressionConditions.get(level, [])
         if not conditions:
             return None
         if unlockedLevel > 0:
             showCurrentProgress = level == unlockedLevel + 1
         else:
             showCurrentProgress = level == 1
         desc = text_styles.concatStylesToMultiLine(
             '',
             self.__packProgressDescriptionText(
                 conditions[0], showCurrentProgress=showCurrentProgress))
         if not self._showOnlyProgressBlock:
             blocks.append(
                 formatters.packImageTextBlockData(
                     padding=formatters.packPadding(top=10, bottom=-10),
                     img=self._item.iconByProgressionLevel(level),
                     desc=desc,
                     descPadding=formatters.packPadding(left=15),
                     linkage=BLOCKS_TOOLTIP_TYPES.
                     TOOLTIP_IMAGE_TEXT_BLOCK_PROGRESSIVE_LINKAGE))
         else:
             blocks.append(
                 formatters.packTextBlockData(
                     padding=formatters.packPadding(top=-19), text=desc))
         return formatters.packBuildUpBlockData(
             blocks,
             linkage=BLOCKS_TOOLTIP_TYPES.
             TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
 def __packGatherDescrBlock(self):
     titleBlock = formatters.packTextBlockData(text=text_styles.middleTitle(
         TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_GATHERHEADER))
     description1Block = formatters.packTextBlockData(text=text_styles.main(
         TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_GATHERDESCRIPTION1))
     intelRequired, nationRequired = self.context.getFragmentConvertData(
         self.__vehicle.level)
     return formatters.packBuildUpBlockData(blocks=[
         titleBlock, description1Block,
         self._packConversionFormulaBlock(intelRequired, nationRequired,
                                          self.__vehicle.nationName,
                                          self.__vehicle.intCD)
     ],
                                            gap=4)
Exemplo n.º 15
0
 def _packAdvancedBlocks(self, movie, header, description, descReady=False):
     if not descReady:
         descrTextR = R.strings.tooltips.advanced.dyn(description)
         if descrTextR and descrTextR.isValid():
             descrText = backport.text(descrTextR())
         else:
             descrText = '#tooltips:advanced/' + description
     else:
         descrText = description
     if movie is None:
         items = [formatters.packTextBlockData(text=text_styles.highTitle(header), padding=formatters.packPadding(left=20, top=20)), formatters.packTextBlockData(text=text_styles.main(descrText), padding=formatters.packPadding(left=20, top=10, bottom=20))]
     else:
         items = [formatters.packTextBlockData(text=text_styles.highTitle(header), padding=formatters.packPadding(left=20, top=20)), formatters.packImageBlockData(BaseAdvancedTooltip.getMovieAnimationPath(movie), BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT, padding=5, linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_ADVANCED_CLIP_BLOCK_LINKAGE), formatters.packTextBlockData(text=text_styles.main(descrText), padding=formatters.packPadding(left=20, top=10, bottom=20))]
     return items
Exemplo n.º 16
0
    def _packBlocks(self, chainID):
        personalMissions = dependency.instance(
            IEventsCache).getPersonalMissions()
        operation = first(
            personalMissions.getOperationsForBranch(
                PM_BRANCH.PERSONAL_MISSION_2).values())
        blocks = [
            formatters.packImageTextBlockData(
                title=text_styles.highTitle(operation.getChainName(chainID)),
                desc=text_styles.standard(
                    operation.getChainDescription(chainID)),
                img=RES_ICONS.getAlliance54x54Icon(chainID),
                imgPadding=formatters.packPadding(top=3, left=-5),
                txtOffset=78)
        ]
        nations = getNationsForChain(operation, chainID)
        nationBlocks = []
        separator = '   '
        for nation in GUI_NATIONS:
            if nation in nations:
                icon = icons.makeImageTag(getNationsFilterAssetPath(nation),
                                          26, 16, -4)
                nationName = text_styles.main(NATIONS.all(nation))
                nationBlocks.append(
                    formatters.packTextBlockData(
                        text_styles.concatStylesToSingleLine(
                            icon, separator, nationName)))

        blocks.append(
            formatters.packBuildUpBlockData(
                nationBlocks,
                linkage=BLOCKS_TOOLTIP_TYPES.
                TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
                padding=formatters.packPadding(left=40)))
        allianceID = operation.getAllianceID(chainID)
        blocks.append(
            formatters.packBuildUpBlockData([
                formatters.packTextBlockData(
                    text_styles.middleTitle(
                        PERSONAL_MISSIONS.CHAINTOOLTIPDATA_DESCRIPTION_TITLE),
                    padding=formatters.packPadding(bottom=4)),
                formatters.packTextBlockData(
                    text_styles.main(
                        PERSONAL_MISSIONS.getAllianceChainTooltipDescr(
                            allianceID)),
                    padding=formatters.packPadding(bottom=7))
            ],
                                            padding=formatters.packPadding(
                                                top=-7, bottom=-3)))
        return blocks
Exemplo n.º 17
0
 def _packBlocks(self, *args, **kwargs):
     items = super(MissionVehiclesTypeTooltipData, self)._packBlocks()
     blocks = [
         formatters.packTextBlockData(
             text_styles.highTitle(TOOLTIPS.QUESTS_VEHICLES_HEADER)),
         formatters.packTextBlockData(
             text_styles.main(TOOLTIPS.QUESTS_VEHICLES_DESCRIPTION))
     ]
     blocks.append(
         formatters.packMissionVehiclesTypeBlockData(
             args[0].list,
             padding=formatters.packPadding(top=20, bottom=-20)))
     items.append(formatters.packBuildUpBlockData(blocks))
     return items
Exemplo n.º 18
0
 def _packDescriptionBlock(self):
     if self._item.isHistorical():
         img = None
         title = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_DESCRIPTION_HISTORIC_TRUE
         desc = self._item.fullDescription
     else:
         img = RES_ICONS.MAPS_ICONS_CUSTOMIZATION_NON_HISTORICAL
         title = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_DESCRIPTION_HISTORIC_FALSE
         desc = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_DESCRIPTION_HISTORIC_FALSE_DESCRIPTION
     blocks = [formatters.packImageTextBlockData(title=text_styles.middleTitle(title), img=img, imgPadding={'left': -3,
       'top': -4}), formatters.packTextBlockData(text=text_styles.main(desc))]
     if not self._item.isHistorical() and self._item.fullDescription:
         blocks.insert(0, formatters.packTextBlockData(text=text_styles.main(self._item.fullDescription), padding={'bottom': 40}))
     return formatters.packBuildUpBlockData(blocks, gap=-6 if img is not None else 3, padding={'bottom': -5})
 def _packBlocks(self, item, **kwargs):
     items = super(RandomCrewBookTooltipDataBlock, self)._packBlocks()
     crewbook, _ = first(item.options.getItems())
     block = [
         formatters.packTextBlockData(text=text_styles.highTitle(
             backport.text(
                 R.strings.tooltips.randomCrewbook.dyn(
                     item.name).header()))),
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.tooltips.randomCrewbook.body(),
                           exp=crewbook.getXP())))
     ]
     items.append(formatters.packBuildUpBlockData(block))
     return items
 def _packBlocks(self, *args, **kwargs):
     items = super(BattleProgressionTooltipData,
                   self)._packBlocks(*args, **kwargs)
     titleStr = text_styles.highTitle(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.title()))
     titleDescrStr = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.titleDescr()))
     items.append(
         formatters.packItemTitleDescBlockData(title=titleStr,
                                               desc=titleDescrStr,
                                               txtGap=5))
     highlight1Str = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.noteHighlight1()))
     highlight2Str = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.noteHighlight2()))
     noteStr = text_styles.main(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.note(),
                       highlight1=highlight1Str,
                       highlight2=highlight2Str))
     noteBlock = formatters.packTextBlockData(text=noteStr)
     items.append(
         formatters.packBuildUpBlockData(
             blocks=[noteBlock],
             linkage=BLOCKS_TOOLTIP_TYPES.
             TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     tutorialHighlightStr = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.tutorialHighlight()))
     treeKey = text_styles.alert(
         getHotKeyString(CommandMapping.CMD_UPGRADE_PANEL_SHOW))
     leftModuleKey = text_styles.alert(
         getHotKeyString(CommandMapping.CMD_CM_VEHICLE_UPGRADE_PANEL_LEFT))
     rightModuleKey = text_styles.alert(
         getHotKeyString(CommandMapping.CMD_CM_VEHICLE_UPGRADE_PANEL_RIGHT))
     tutorialStr = text_styles.main(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.tutorial(),
                       treeKey=treeKey,
                       leftModuleKey=leftModuleKey,
                       rightModuleKey=rightModuleKey))
     tutorialStr = text_styles.concatStylesWithSpace(
         tutorialHighlightStr, tutorialStr)
     items.append(formatters.packTextBlockData(text=tutorialStr))
     return items
 def __packStatusBlock(self):
     result = []
     if self.item.isAcquired():
         status = text_styles.statInfo(backport.text(R.strings.tooltips.battleTypes.ranked.rank.status.received()))
     elif self.item.isLost():
         status = text_styles.statusAlert(backport.text(R.strings.tooltips.battleTypes.ranked.rank.status.lost()))
     else:
         status = text_styles.warning(backport.text(R.strings.tooltips.battleTypes.ranked.rank.status.notearned()))
     result.append(formatters.packAlignedTextBlockData(status, BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT, padding=formatters.packPadding(top=-4)))
     division = self.item.getDivision()
     if not division.isCurrent() and not division.isCompleted():
         result.append(formatters.packTextBlockData(text_styles.main(backport.text(R.strings.tooltips.battleTypes.ranked.rank.anotherDivision(), division=division.getUserName()))))
     if not self.item.isAcquired():
         result.append(formatters.packTextBlockData(self.__packStepsBlock()))
     return result
 def _packBlocks(self, vehicleCD):
     items = super(ConvertInfoBlueprintTooltipData,
                   self)._packBlocks(vehicleCD)
     self.__vehicle, self.__blueprintData, self.__convertibleCount = self.context.getVehicleBlueprintData(
         vehicleCD)
     titleBlock = formatters.packTextBlockData(text=text_styles.highTitle(
         TOOLTIPS.TECHTREEPAGE_BLUEPRINTCONVERTTOOLTIP_HEADER))
     description1Block = formatters.packTextBlockData(text=text_styles.main(
         i18n.makeString(TOOLTIPS.TECHTREEPAGE_BLUEPRINTCONVERTTOOLTIP_BODY,
                         fragCount=text_styles.stats(
                             str(self.__convertibleCount)))))
     items.append(
         formatters.packBuildUpBlockData(
             blocks=[titleBlock, description1Block], gap=5))
     return self._items
 def __packVehicleFragmentBlocks(self):
     vehicle, blueprintData, _ = self.context.getVehicleBlueprintData(
         self._fragmentCD)
     if blueprintData is None:
         return
     else:
         items = self._items
         self._setNationFlagCornerBg(vehicle.nationName)
         items.append(
             formatters.packImageTextBlockData(
                 title=text_styles.highTitle(
                     TOOLTIPS.
                     BLUEPRINT_BLUEPRINTFRAGMENTTOOLTIP_FRAGMENTHEADER),
                 desc=self._getVehicleDescrStr(vehicle),
                 img=RES_ICONS.getBlueprintFragment('medium', 'vehicle'),
                 imgPadding=formatters.packPadding(top=3),
                 txtPadding=formatters.packPadding(left=21)))
         self._items = [formatters.packBuildUpBlockData(blocks=items)]
         items = self._items
         percentDiscount, xpDiscount = self.context.getFragmentDiscounts(
             vehicle)
         items.append(
             formatters.packBuildUpBlockData(
                 blocks=[
                     self._getUnlockDiscountBlock(
                         percentDiscount, xpDiscount, TOOLTIPS.
                         BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_RESEARCHDISCOUNT,
                         True)
                 ],
                 linkage=BLOCKS_TOOLTIP_TYPES.
                 TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
                 padding=formatters.packPadding(left=67)))
         gatheredInfoStr = text_styles.concatStylesWithSpace(
             text_styles.stats(int(blueprintData.filledCount)),
             text_styles.main(' '.join(
                 ('/', str(blueprintData.totalCount)))),
             text_styles.main(
                 TOOLTIPS.
                 BLUEPRINT_BLUEPRINTFRAGMENTTOOLTIP_FRAGMENTGATHERED))
         items.append(
             formatters.packTextBlockData(
                 text=gatheredInfoStr,
                 padding=formatters.packPadding(left=67)))
         items.append(
             formatters.packTextBlockData(text=text_styles.main(
                 TOOLTIPS.
                 BLUEPRINT_BLUEPRINTFRAGMENTTOOLTIP_FRAGMENTDESCRIPTION)))
         return
Exemplo n.º 24
0
    def __packGiftNameBlocks(cls, shortName, giftsNames, isOfferEnabled):
        rOffer = R.strings.tooltips.battlePassOffer
        blocks = [
            formatters.packTextBlockData(text=text_styles.highTitle(
                backport.text(rOffer.title.dyn(shortName)())))
        ]
        if isOfferEnabled:
            if shortName in ('brochure_gift', 'guide_gift', 'blueprint_gift'):
                blocks.append(
                    formatters.packTextBlockData(text=text_styles.gold(
                        backport.text(rOffer.allNations()))))
                if shortName == 'blueprint_gift':
                    information = backport.text(rOffer.blueprintInfo())
                else:
                    experience = first(giftsNames)
                    experienceText = text_styles.expText(
                        backport.getIntegralFormat(experience))
                    information = backport.text(rOffer.crewBookInfo(),
                                                exp=experienceText)
                blocks.append(
                    formatters.packTextBlockData(
                        text=text_styles.main(information)))
            else:
                insertEtc = False
                if len(giftsNames) > cls._MAX_GIFTS_COUNT:
                    giftsNames = giftsNames[:cls._MAX_GIFTS_COUNT - 1]
                    insertEtc = True
                for gift in giftsNames:
                    giftName = backport.text(rOffer.point(), item=gift)
                    blocks.append(
                        formatters.packTextBlockData(
                            text=text_styles.main(giftName)))

                if insertEtc:
                    blocks.append(
                        formatters.packTextBlockData(text=text_styles.stats(
                            backport.text(rOffer.etc()))))
        else:
            blocks.append(
                formatters.packImageTextBlockData(
                    title=text_styles.main(backport.text(rOffer.error())),
                    img=backport.image(
                        R.images.gui.maps.icons.library.alertIcon1())))
        return formatters.packBuildUpBlockData(
            blocks,
            padding=formatters.packPadding(left=-1),
            linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE
        )
Exemplo n.º 25
0
 def construct(self):
     block = []
     paddingTop = 8
     block.append(formatters.packImageTextBlockData(title=text_styles.alert(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_BODY), img=RES_ICONS.MAPS_ICONS_TOOLTIP_COMPLEX_EQUIPMENT, imgPadding=formatters.packPadding(left=2, top=3), txtOffset=20))
     block.append(formatters.packTextBlockData(text=text_styles.main(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_NOTE), padding=formatters.packPadding(top=paddingTop)))
     block.append(formatters.packTextParameterWithIconBlockData(name=text_styles.main(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_DISMANTLING_PRICE), value=text_styles.gold(g_itemsCache.items.shop.paidRemovalCost), icon=ICON_TEXT_FRAMES.GOLD, valueWidth=60, padding=formatters.packPadding(left=43, top=paddingTop)))
     return block
Exemplo n.º 26
0
 def construct(self):
     block = []
     shell = self.shell
     configuration = self.configuration
     buyPrice = configuration.buyPrice
     sellPrice = configuration.sellPrice
     if buyPrice and sellPrice:
         LOG_ERROR('You are not allowed to use buyPrice and sellPrice at the same time')
         return
     else:
         creditsNeeded, goldNeeded = (0, 0)
         if buyPrice:
             credits, gold = g_itemsCache.items.stats.money
             price = shell.altPrice
             creditsNeeded = price[0] - credits if price[0] else 0
             goldNeeded = price[1] - gold if price[1] else 0
             need = (max(0, creditsNeeded), max(0, goldNeeded))
             defPrice = shell.defaultAltPrice or shell.defaultPrice
             block.append(self._makePriceBlock(price[0], 'buyCreditsPrice', need[0] if need[0] > 0 else None, defPrice[0] if defPrice[0] > 0 else None, percent=shell.actionPrc))
             if price[1] > 0:
                 block.append(formatters.packTextBlockData(text=text_styles.standard(TOOLTIPS.VEHICLE_TEXTDELIMITER_OR), padding=formatters.packPadding(left=81 + self.leftPadding)))
                 block.append(self._makePriceBlock(price[1], 'buyGoldPrice', need[1] if need[1] > 0 else None, defPrice[1] if defPrice[1] > 0 else None, percent=shell.actionPrc))
         if sellPrice:
             block.append(self._makePriceBlock(shell.sellPrice[0], 'sellPrice', oldPrice=shell.defaultSellPrice[0], percent=shell.sellActionPrc))
         inventoryCount = shell.inventoryCount
         if inventoryCount:
             block.append(formatters.packTextParameterBlockData(name=text_styles.main(TOOLTIPS.VEHICLE_INVENTORYCOUNT), value=text_styles.stats(inventoryCount), valueWidth=self._valueWidth, padding=formatters.packPadding(left=-5)))
         notEnoughMoney = creditsNeeded > 0 or goldNeeded > 0
         hasAction = shell.actionPrc > 0 or shell.sellActionPrc > 0
         return (block, notEnoughMoney or hasAction)
Exemplo n.º 27
0
    def _packBlocks(self, role):
        blocks = []
        bodyStr = '%s/%s' % (TOOLTIPS.VEHICLEPREVIEW_CREW, role)
        crewParams = [
            text_styles.neutral(param) for param in _CREW_TOOLTIP_PARAMS[role]
        ]
        blocks.append(
            formatters.packTitleDescBlock(
                text_styles.highTitle(ITEM_TYPES.tankman_roles(role)),
                text_styles.main(_ms(bodyStr, *crewParams))))
        vehicle = self.context.getVehicle()
        for idx, tankman in vehicle.crew:
            if tankman.role == role:
                otherRoles = list(vehicle.descriptor.type.crewRoles[idx])
                otherRoles.remove(tankman.role)
                if otherRoles:
                    rolesStr = ', '.join([
                        text_styles.stats(_ms(ITEM_TYPES.tankman_roles(r)))
                        for r in otherRoles
                    ])
                    blocks.append(
                        formatters.packTextBlockData(
                            text_styles.main(
                                _ms(TOOLTIPS.
                                    VEHICLEPREVIEW_CREW_ADDITIONALROLES,
                                    roles=rolesStr))))

        return blocks
 def __packInfoBlock(self, bonuses):
     return [
         formatters.packTextBlockData(
             text=text_styles.titleFont(
                 backport.text(_R_TOOLTIPS_TEXT.bonuses())),
             padding=formatters.packPadding(bottom=20))
     ] + [self.__getBonus(_BONUS_PRESETS[bonusId]) for bonusId in bonuses]
Exemplo n.º 29
0
 def _packBlocks(self, *args, **kwargs):
     self._items = super(BattlePassPointsTooltipData,
                         self)._packBlocks(*args, **kwargs)
     titleBlock = formatters.packTitleDescBlock(title=text_styles.highTitle(
         backport.text(
             R.strings.battle_pass.tooltips.battlePassPoints.title())))
     imageBlock = formatters.packImageBlockData(img=backport.image(
         R.images.gui.maps.icons.battlePass.tooltips.battlePassPoints()),
                                                align=BLOCKS_TOOLTIP_TYPES.
                                                ALIGN_CENTER)
     titleImageBlock = formatters.packBuildUpBlockData(
         [titleBlock, imageBlock])
     self._items.append(titleImageBlock)
     descriptionBlock = text_styles.main(
         backport.text(
             R.strings.battle_pass.tooltips.battlePassPoints.description()))
     self._items.append(formatters.packTextBlockData(descriptionBlock))
     state = self.__battlePassController.getState()
     if state == BattlePassState.COMPLETED:
         self._items.append(
             formatters.packBuildUpBlockData(
                 [
                     formatters.packImageTextBlockData(
                         title=text_styles.success(
                             backport.text(R.strings.battle_pass.tooltips.
                                           battlePassPoints.completed())),
                         img=backport.image(
                             R.images.gui.maps.icons.library.check()),
                         imgPadding=formatters.packPadding(top=-2))
                 ],
                 linkage=BLOCKS_TOOLTIP_TYPES.
                 TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
                 padding=formatters.packPadding(bottom=-10)))
     return self._items
Exemplo n.º 30
0
 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 _getMissionsBlock(cls, operation):
        items = []
        completedQuests = operation.getCompletedQuests()
        completedQuestsIDs = set(completedQuests.keys())
        totalCount = operation.getQuestsCount()
        items.append(
            formatters.packTextBlockData(
                text=text_styles.concatStylesWithSpace(
                    text_styles.middleTitle(
                        TOOLTIPS.PERSONALMISSIONS_OPERATION_MISSIONS_TITLE),
                    _formatCompleteCount(len(completedQuests), totalCount),
                    text_styles.standard('/ %s' % totalCount)),
                padding=formatters.packPadding(top=8, left=17)))
        for vehicleType in VEHICLE_TYPES_ORDER:
            _, quests = operation.getChainByVehicleType(vehicleType)
            completedCount = len(completedQuestsIDs.intersection(
                quests.keys()))
            chainSize = operation.getChainSize()
            items.append(
                formatters.packTitleDescParameterWithIconBlockData(
                    title=text_styles.concatStylesWithSpace(
                        _formatCompleteCount(completedCount, chainSize),
                        text_styles.standard('/ %s' % chainSize)),
                    value=text_styles.main(MENU.classesShort(vehicleType)),
                    icon=getTypeSmallIconPath(vehicleType),
                    iconPadding=formatters.packPadding(top=3, left=10),
                    titlePadding=formatters.packPadding(left=10),
                    padding=formatters.packPadding(left=156, bottom=-9)))

        return formatters.packBuildUpBlockData(blocks=items,
                                               padding=formatters.packPadding(
                                                   top=-14, bottom=30),
                                               gap=10)
Exemplo n.º 32
0
 def construct(self):
     block = []
     shell = self.shell
     configuration = self.configuration
     buyPrice = configuration.buyPrice
     sellPrice = configuration.sellPrice
     if buyPrice and sellPrice:
         LOG_ERROR('You are not allowed to use buyPrice and sellPrice at the same time')
         return
     else:
         need = ZERO_MONEY
         if buyPrice:
             money = g_itemsCache.items.stats.money
             price = shell.altPrice
             need = price - money
             need = need.toNonNegative()
             defPrice = shell.defaultAltPrice or shell.defaultPrice
             block.append(makePriceBlock(price.credits, CURRENCY_SETTINGS.BUY_CREDITS_PRICE, need.credits if need.credits > 0 else None, defPrice.credits if defPrice.credits > 0 else None, percent=shell.actionPrc, valueWidth=self._valueWidth))
             if price.gold > 0:
                 block.append(formatters.packTextBlockData(text=text_styles.standard(TOOLTIPS.VEHICLE_TEXTDELIMITER_OR), padding=formatters.packPadding(left=81 + self.leftPadding)))
                 block.append(makePriceBlock(price.gold, CURRENCY_SETTINGS.BUY_GOLD_PRICE, need.gold if need.gold > 0 else None, defPrice.gold if defPrice.gold > 0 else None, percent=shell.actionPrc, valueWidth=self._valueWidth))
         if sellPrice:
             block.append(makePriceBlock(shell.sellPrice.credits, CURRENCY_SETTINGS.SELL_PRICE, oldPrice=shell.defaultSellPrice.credits, percent=shell.sellActionPrc, valueWidth=self._valueWidth))
         inventoryCount = shell.inventoryCount
         if inventoryCount:
             block.append(formatters.packTextParameterBlockData(name=text_styles.main(TOOLTIPS.VEHICLE_INVENTORYCOUNT), value=text_styles.stats(inventoryCount), valueWidth=self._valueWidth, padding=formatters.packPadding(left=-5)))
         notEnoughMoney = need > ZERO_MONEY
         hasAction = shell.actionPrc > 0 or shell.sellActionPrc > 0
         return (block, notEnoughMoney or hasAction)
 def _getTitleBlock(self, padding=None):
     padding = padding or {}
     padding['top'] = 10
     padding['left'] = 17
     return formatters.packTextBlockData(text=text_styles.highTitle(
         self.quest.getUserName()),
                                         padding=padding)
 def _packBlocks(self, *args, **kwargs):
     blocks = super(UniqueCamouflageTooltip,
                    self)._packBlocks(*args, **kwargs)
     blocks.append(
         formatters.packTextBlockData(
             text_styles.main('UniqueCamouflageTooltip')))
     return blocks
    def _getOrConditionBlock(cls, conditions):
        items = []
        conditionsCount = len(conditions)
        for idx, c in enumerate(conditions, start=1):
            items.append(
                formatters.packImageTextBlockData(
                    title=c.title,
                    img=c.icon,
                    txtPadding=formatters.packPadding(left=-21),
                    imgPadding=formatters.packPadding(top=-34),
                    padding=formatters.packPadding(left=30),
                    ignoreImageSize=True))
            if idx < conditionsCount:
                items.append(
                    formatters.packTextBlockData(
                        text=text_styles.neutral(
                            TOOLTIPS.VEHICLE_TEXTDELIMITER_OR),
                        padding=formatters.packPadding(top=-7,
                                                       bottom=-11,
                                                       left=99)))

        return formatters.packBuildUpBlockData(
            blocks=items,
            linkage=BLOCKS_TOOLTIP_TYPES.
            TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
            padding=formatters.packPadding(top=-6, bottom=15),
            gap=13)
 def _getAwardsBlock(cls, quest):
     items = []
     linkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WIDE_AWARD_BIG_BG_LINKAGE
     textPadding = formatters.packPadding(top=-8, left=16, bottom=20)
     if quest.isDone():
         titleKey = TOOLTIPS.PERSONALMISSIONS_MAPREGION_AWARDS_TITLE_ALLRECEIVED
         linkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WIDE_AWARD_SMALL_BG_LINKAGE
         textPadding['bottom'] = 10
     elif not quest.isMainCompleted():
         titleKey = TOOLTIPS.PERSONALMISSIONS_MAPREGION_AWARDS_TITLE_DONE
     else:
         titleKey = TOOLTIPS.PERSONALMISSIONS_MAPREGION_AWARDS_TITLE_EXCELLENTDONE
     items.append(
         formatters.packTextBlockData(
             text=text_styles.middleTitle(titleKey), padding=textPadding))
     if not quest.isDone():
         bonuses = missions_helper.getPersonalMissionAwardsFormatter(
         ).getFormattedBonuses(
             quest.getBonuses(isMain=not quest.isMainCompleted()),
             size=AWARDS_SIZES.BIG)
         items.append(
             formatters.packAwardsExBlockData(
                 bonuses,
                 columnWidth=90,
                 rowHeight=80,
                 horizontalGap=10,
                 renderersAlign=formatters.RENDERERS_ALIGN_CENTER,
                 padding=formatters.packPadding(bottom=20, left=10)))
     return formatters.packBuildUpBlockData(blocks=items,
                                            stretchBg=False,
                                            linkage=linkage)
 def _packBlocks(self, operationID, vehicleType):
     pmController = dependency.instance(IEventsCache).personalMissions
     operation = pmController.getOperations()[operationID]
     chainID, _ = operation.getChainByVehicleType(vehicleType)
     finalQuest = operation.getFinalQuests()[chainID]
     bonus = findFirst(lambda q: q.getName() == 'completionTokens',
                       finalQuest.getBonuses('tokens'))
     formattedBonus = first(CompletionTokensBonusFormatter().format(bonus))
     operationTitle = str(operation.getVehicleBonus().userName).replace(
         ' ', '&nbsp;')
     if finalQuest.isCompleted():
         statusText = self.__getObtainedStatus()
     elif pmController.mayPawnQuest(finalQuest):
         statusText = self.__getAvailableStatus(finalQuest.getPawnCost())
     else:
         statusText = self.__getNotObtainedStatus()
     vehIcon = RES_ICONS.vehicleTypeInactiveOutline(vehicleType)
     blocks = [
         formatters.packImageTextBlockData(
             title=text_styles.highTitle(formattedBonus.userName),
             desc=text_styles.standard(
                 _ms(PERSONAL_MISSIONS.OPERATIONTITLE_TITLE,
                     title=operationTitle)),
             img=formattedBonus.getImage(AWARDS_SIZES.BIG),
             imgPadding=formatters.packPadding(right=20),
             txtPadding=formatters.packPadding(top=10)),
         formatters.packBuildUpBlockData(
             [
                 formatters.packImageTextBlockData(
                     title=text_styles.main(
                         _ms(PERSONAL_MISSIONS.TANKMODULETOOLTIPDATA_INFO,
                             vehName=text_styles.neutral(operationTitle))),
                     img=RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED,
                     imgPadding=formatters.packPadding(
                         left=8, right=10, top=2))
             ],
             linkage=BLOCKS_TOOLTIP_TYPES.
             TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
             padding=formatters.packPadding(top=-7, bottom=-3))
     ]
     if not finalQuest.isCompleted():
         blocks.append(
             formatters.packBuildUpBlockData([
                 formatters.packTextBlockData(text_styles.middleTitle(
                     PERSONAL_MISSIONS.TANKMODULETOOLTIPDATA_HELP_TITLE),
                                              padding=formatters.
                                              packPadding(bottom=4)),
                 formatters.packImageTextBlockData(title=text_styles.main(
                     _ms(PERSONAL_MISSIONS.TANKMODULETOOLTIPDATA_HELP_BODY,
                         vehType=_ms(
                             PERSONAL_MISSIONS.chainNameByVehicleType(
                                 vehicleType)))),
                                                   img=vehIcon,
                                                   imgPadding=formatters.
                                                   packPadding(right=2))
             ]))
     blocks.append(
         formatters.packAlignedTextBlockData(
             text=statusText, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER))
     return blocks
Exemplo n.º 38
0
    def construct(self):
        paramsDict = dict(params_helper.getParameters(self.vehicle))
        block = []
        comparator = params_helper.idealCrewComparator(self.vehicle)
        if self.configuration.params and not self.configuration.simplifiedOnly:
            for paramName in self.PARAMS.get(self.vehicle.type, 'default'):
                if paramName in paramsDict:
                    paramInfo = comparator.getExtendedData(paramName)
                    fmtValue = param_formatter.colorizedFormatParameter(
                        paramInfo, param_formatter.BASE_FORMATTERS)
                    if fmtValue is not None:
                        block.append(
                            formatters.packTextParameterBlockData(
                                name=param_formatter.formatVehicleParamName(
                                    paramName),
                                value=fmtValue,
                                valueWidth=self._valueWidth,
                                padding=formatters.packPadding(left=-1)))

        if len(block) > 0:
            title = text_styles.middleTitle(
                TOOLTIPS.VEHICLEPARAMS_COMMON_TITLE)
            block.insert(
                0,
                formatters.packTextBlockData(
                    title, padding=formatters.packPadding(bottom=8)))
        return block
Exemplo n.º 39
0
 def _packTerms(self, data):
     text = makeHtmlText('tooltip_terms_label', ms(self._termsAlias))
     arenaType = data.get('arenaType', 0)
     if arenaType == ARENA_GUI_TYPE.FALLOUT_MULTITEAM:
         text += '\n' + makeHtmlText('tooltip_terms_label',
                                     ms(self._termsAlias + '/gasAttack'))
     return [formatters.packTextBlockData(text)]
Exemplo n.º 40
0
 def pack(self, data):
     items = super(KillItemPacker, self).pack(data)
     reason = data.get('killReason', None)
     if reason is not None and reason >= 0:
         alias = '#battle_results:common/tooltip/kill{0}/description'.format(reason)
         text = makeHtmlText('tooltip_add_info_label', ms(alias))
         items.append(formatters.packTextBlockData(text))
     return items
Exemplo n.º 41
0
 def _packBlocks(self, *args, **kwargs):
     blocks = super(FemaleTankmanAwardTooltipData, self)._packBlocks(*args, **kwargs)
     _ms = i18n.makeString
     blocks.append(
         formatters.packBuildUpBlockData(
             [
                 formatters.packTextBlockData(
                     text_styles.main(_ms(TOOLTIPS.QUESTS_SEASONAWARD_FEMALETANKMAN_DESCRIPTION_PART1))
                 ),
                 formatters.packTextBlockData(
                     text_styles.standard(_ms(TOOLTIPS.QUESTS_SEASONAWARD_FEMALETANKMAN_DESCRIPTION_PART2))
                 ),
             ],
             gap=11,
         )
     )
     return blocks
Exemplo n.º 42
0
    def _packBonusBlock(self, customizationTypeData, title):
        subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle(_ms(title)), padding={'bottom': 2})]
        for bonus in customizationTypeData:
            bonusPartDescription = text_styles.main(bonus['title'])
            if bonus['isTemporarily']:
                bonusPartDescription += '\n' + text_styles.standard('*' + bonus['description'])
            subBlocks.append(formatters.packTextParameterBlockData(name=bonusPartDescription, value=bonus['power'], padding={'bottom': 8}, valueWidth=45))

        return formatters.packBuildUpBlockData(subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE, {'left': 3})
Exemplo n.º 43
0
 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)
Exemplo n.º 44
0
 def _packBlocks(self, *args, **kwargs):
     items = super(ResearchModulesPackerEx, self)._packBlocks(*args, **kwargs)
     blocksGap = 3
     imgPdg = {'top': 3}
     txtOffset = 75
     items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_ACTIONBUTTONSTITLE)),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_RESEARCHBUTTONDESCRIPTION), img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_RESEARCHBUTTON, imgPadding=imgPdg, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_BUYBUTTONDESCRIPTION), img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_BUYBUTTON, imgPadding=imgPdg, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_INHANGARDESCRIPTION), img=RES_ICONS.MAPS_ICONS_LIBRARY_COMPLETEDINDICATOR, imgPadding={'top': -3}, txtOffset=txtOffset)], blocksGap))
     return items
Exemplo n.º 45
0
 def _packBlocks(self, compensationValue):
     title = TOOLTIPS.FORTIFICATION_POPOVER_DEFRESPROGRESS_HEADER
     items = super(FortPopoverDefResTooltipData, self)._packBlocks()
     items.append(formatters.packTitleDescBlock(text_styles.highTitle(title), desc=text_styles.main(self._descr)))
     if compensationValue is not None:
         blocksGap = 12
         compensationHeader = text_styles.main(TOOLTIPS.FORTIFICATION_POPOVER_DEFRESPROGRESS_COMPENSATION_HEADER) + text_styles.alert('+' + compensationValue) + icons.nut()
         compensationBody = text_styles.standard(TOOLTIPS.FORTIFICATION_POPOVER_DEFRESPROGRESS_COMPENSATION_BODY)
         items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.concatStylesToMultiLine(compensationHeader, compensationBody))], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     return items
Exemplo n.º 46
0
    def _packAlreadyHaveBlock(self, data):
        subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle(_ms('#vehicle_customization:customization/tooltip/alreadyHave/title')), padding={'bottom': 6})]
        padding = {'left': 10}
        for buyItem in data['buyItems']:
            buyItemDesc = text_styles.main(buyItem['desc'])
            if buyItem['type'] == BUY_ITEM_TYPE.ALREADY_HAVE_IGR:
                subBlocks.append(formatters.packTextParameterBlockData(name=buyItemDesc, value=icons.premiumIgrSmall(), padding=padding))
            else:
                subBlocks.append(formatters.packTextParameterBlockData(name=buyItemDesc, value='', padding=padding))

        return formatters.packBuildUpBlockData(subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE, {'left': 3})
Exemplo n.º 47
0
    def _packAlreadyHaveBlock(self, item):
        subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_ALREADYHAVE_TITLE)), padding={'bottom': 6})]
        padding = {'left': 10}
        for buyItem in item['buyItems']:
            buyItemDesc = text_styles.main(buyItem['desc'])
            if buyItem['type'] == BUY_ITEM_TYPE.ALREADY_HAVE_IGR:
                subBlocks.append(formatters.packTextParameterBlockData(name=buyItemDesc, value=icons.premiumIgrSmall(), padding=padding))
            else:
                subBlocks.append(formatters.packTextParameterBlockData(name=buyItemDesc, value='', padding=padding))

        return formatters.packBuildUpBlockData(subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE, {'left': 3})
Exemplo n.º 48
0
    def _packWayToBuyBlock(self, item):
        subBlocks = [
            formatters.packTextBlockData(
                text=text_styles.middleTitle(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_WAYTOBUY_TITLE)),
                padding={"bottom": 6},
            )
        ]
        padding = {"left": 0}
        for buyItem in item["buyItems"]:
            buyItemDesc = text_styles.main(buyItem["desc"])
            if buyItem["type"] == BUY_ITEM_TYPE.WAYS_TO_BUY_FOREVER:
                if buyItem["isSale"]:
                    subBlocks.append(
                        formatters.packSaleTextParameterBlockData(
                            name=buyItemDesc, saleData={"newPrice": (0, buyItem["value"])}, padding=padding
                        )
                    )
                else:
                    price = text_styles.concatStylesWithSpace(
                        text_styles.gold(BigWorld.wg_getIntegralFormat(long(buyItem["value"]))), icons.gold()
                    )
                    subBlocks.append(
                        formatters.packTextParameterBlockData(name=buyItemDesc, value=price, valueWidth=70)
                    )
            elif buyItem["type"] == BUY_ITEM_TYPE.WAYS_TO_BUY_TEMP:
                if buyItem["isSale"]:
                    subBlocks.append(
                        formatters.packSaleTextParameterBlockData(
                            name=buyItemDesc, saleData={"newPrice": (buyItem["value"], 0)}, padding=padding
                        )
                    )
                else:
                    price = text_styles.concatStylesWithSpace(
                        text_styles.credits(BigWorld.wg_getIntegralFormat(long(buyItem["value"]))), icons.credits()
                    )
                    subBlocks.append(
                        formatters.packTextParameterBlockData(name=buyItemDesc, value=price, valueWidth=70)
                    )
            elif buyItem["type"] == BUY_ITEM_TYPE.WAYS_TO_BUY_IGR:
                subBlocks.append(
                    formatters.packTextParameterBlockData(
                        name=buyItemDesc, value=icons.premiumIgrSmall(), padding=padding
                    )
                )
            elif buyItem["type"] == BUY_ITEM_TYPE.WAYS_TO_BUY_MISSION:
                subBlocks.append(
                    formatters.packTextParameterBlockData(name=buyItemDesc, value=icons.quest(), padding=padding)
                )

        return formatters.packBuildUpBlockData(
            subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE, {"left": 3}
        )
Exemplo n.º 49
0
 def _packBlocks(self, *args, **kwargs):
     blocks = super(SeasonAwardTooltipData, self)._packBlocks(*args, **kwargs)
     blocks.append(
         formatters.packBuildUpBlockData(
             [
                 formatters.packTextBlockData(self.__title),
                 formatters.packImageBlockData(
                     self.__image, BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=self.__imgPadding
                 ),
             ]
         )
     )
     return blocks
Exemplo n.º 50
0
 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
Exemplo n.º 51
0
 def _packBlocks(self, *args, **kwargs):
     items = super(ResearchModulesPacker, self)._packBlocks(*args, **kwargs)
     blocksGap = 5
     imgPdg = {'left': 15,
      'right': 20}
     txtGap = -4
     items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_TYPESTITLE)),
      formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_GUNTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_GUNDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_MODULES_GUN, imgPdg, txtGap=txtGap),
      formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_TURRETTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_TURRETDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_MODULES_TOWER, imgPdg, txtGap=txtGap),
      formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_ENGINETITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_ENGINEDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_MODULES_ENGINE, imgPdg, txtGap=txtGap),
      formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_CHASSISTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_CHASSISDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_MODULES_CHASSIS, imgPdg, txtGap=txtGap),
      formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_RADIOSETTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_MODULES_RADIOSETDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_MODULES_RADIO, imgPdg, txtGap=txtGap)], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     return items
Exemplo n.º 52
0
 def _packStatusBlock(self, item):
     status = ''
     if item['status'] == STATUS.ON_BOARD:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ONBOARD))
     elif item['status'] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ALREADYHAVE))
     elif item['status'] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_AVAILABLEFORBUY))
     elif item['status'] == STATUS.DO_MISSION:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_DOMISSION))
     elif item['status'] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(text=makeHtmlString('html_templates:lobby/textStyle', 'alignText', {'align': 'center',
      'message': status}), padding={'bottom': -4,
      'top': -4})
Exemplo n.º 53
0
 def _packStatusBlock(self, data):
     status = ''
     if data['status'] == STATUS.ON_BOARD:
         status = text_styles.statInfo(_ms('#vehicle_customization:customization/tooltip/status/onBoard'))
     elif data['status'] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(_ms('#vehicle_customization:customization/tooltip/status/alreadyHave'))
     elif data['status'] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(_ms('#vehicle_customization:customization/tooltip/status/availableForBuy'))
     elif data['status'] == STATUS.DO_MISSION:
         status = text_styles.warning(_ms('#vehicle_customization:customization/tooltip/status/doMission'))
     elif data['status'] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(text=makeHtmlString('html_templates:lobby/textStyle', 'alignText', {'align': 'center',
      'message': status}), padding={'bottom': -4,
      'top': -4})
Exemplo n.º 54
0
    def _packBonusBlock(self, customizationTypeData, title):
        subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle(_ms(title)), padding={"bottom": 2})]
        for bonus in customizationTypeData:
            bonusPartDescription = text_styles.main(bonus["title"])
            if bonus["isTemporarily"]:
                bonusPartDescription += "\n" + text_styles.standard("*" + bonus["description"])
            subBlocks.append(
                formatters.packTextParameterBlockData(
                    name=bonusPartDescription, value=bonus["power"], padding={"bottom": 8}, valueWidth=45
                )
            )

        return formatters.packBuildUpBlockData(
            subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE, {"left": 3}
        )
Exemplo n.º 55
0
 def pack(self, data):
     items = super(CritsItemPacker, self).pack(data)
     critDamage = data.get('critDamage', None)
     critWound = data.get('critWound', None)
     critDestruction = data.get('critDestruction', None)
     if critDamage is not None and len(critDamage) > 0:
         self.__addResultBlock(items, BATTLE_RESULTS.COMMON_TOOLTIP_CRITS_CRITDAMAGE, critDamage)
     if critDestruction is not None and len(critDestruction) > 0:
         self.__addResultBlock(items, BATTLE_RESULTS.COMMON_TOOLTIP_CRITS_CRITDESTRUCTION, critDestruction)
     if critWound is not None and len(critWound) > 0:
         self.__addResultBlock(items, BATTLE_RESULTS.COMMON_TOOLTIP_CRITS_CRITWOUND, critWound)
     if data['isGarage']:
         text = makeHtmlText('tooltip_add_info_label', ms(BATTLE_RESULTS.FALLOUT_UNIQUEDAMAGE))
         items.append(formatters.packTextBlockData(text))
     return items
Exemplo n.º 56
0
    def _packBlocks(self, role):
        blocks = []
        bodyStr = '%s/%s' % (TOOLTIPS.VEHICLEPREVIEW_CREW, role)
        crewParams = [ text_styles.neutral(param) for param in _CREW_TOOLTIP_PARAMS[role] ]
        blocks.append(formatters.packTitleDescBlock(text_styles.highTitle(ITEM_TYPES.tankman_roles(role)), text_styles.main(_ms(bodyStr, *crewParams))))
        vehicle = self.context.getVehicle()
        for idx, tankman in vehicle.crew:
            if tankman.role == role:
                otherRoles = list(vehicle.descriptor.type.crewRoles[idx])
                otherRoles.remove(tankman.role)
                if otherRoles:
                    rolesStr = ', '.join([ text_styles.stats(_ms(ITEM_TYPES.tankman_roles(r))) for r in otherRoles ])
                    blocks.append(formatters.packTextBlockData(text_styles.main(_ms(TOOLTIPS.VEHICLEPREVIEW_CREW_ADDITIONALROLES, roles=rolesStr))))

        return blocks
Exemplo n.º 57
0
    def construct(self):
        paramsDict = dict(params_helper.getParameters(self.vehicle))
        block = []
        comparator = params_helper.idealCrewComparator(self.vehicle)
        if self.configuration.params:
            for paramName in self.PARAMS.get(self.vehicle.type, 'default'):
                if paramName in paramsDict:
                    paramInfo = comparator.getExtendedData(paramName)
                    fmtValue = param_formatter.colorizedFormatParameter(paramInfo, param_formatter.BASE_FORMATTERS)
                    if fmtValue is not None:
                        block.append(formatters.packTextParameterBlockData(name=param_formatter.formatVehicleParamName(paramName), value=fmtValue, valueWidth=self._valueWidth, padding=formatters.packPadding(left=-1)))

        if len(block) > 0:
            title = text_styles.middleTitle(TOOLTIPS.VEHICLEPARAMS_COMMON_TITLE)
            block.insert(0, formatters.packTextBlockData(title, padding=formatters.packPadding(bottom=8)))
        return block
Exemplo n.º 58
0
 def _packStatusBlock(self, item):
     status = ""
     if item["status"] == STATUS.ON_BOARD:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ONBOARD))
     elif item["status"] == STATUS.ALREADY_HAVE:
         status = text_styles.statInfo(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_ALREADYHAVE))
     elif item["status"] == STATUS.AVAILABLE_FOR_BUY:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_AVAILABLEFORBUY))
     elif item["status"] == STATUS.DO_MISSION:
         status = text_styles.warning(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_STATUS_DOMISSION))
     elif item["status"] == STATUS.DO_IGR:
         status = icons.premiumIgrBig()
     return formatters.packTextBlockData(
         text=makeHtmlString("html_templates:lobby/textStyle", "alignText", {"align": "center", "message": status}),
         padding={"bottom": -4, "top": -4},
     )
Exemplo n.º 59
0
    def construct(self):
        block = []
        comparator = params_helper.idealCrewComparator(self.vehicle)
        stockParams = params_helper.getParameters(g_itemsCache.items.getStockVehicle(self.vehicle.intCD))
        for paramName in RELATIVE_PARAMS:
            paramInfo = comparator.getExtendedData(paramName)
            fmtValue = param_formatter.simlifiedVehicleParameter(paramInfo)
            if fmtValue is not None:
                block.append(formatters.packStatusDeltaBlockData(title=param_formatter.formatVehicleParamName(paramName), valueStr=fmtValue, statusBarData={'value': paramInfo.value,
                 'delta': 0,
                 'minValue': 0,
                 'markerValue': stockParams[paramName],
                 'maxValue': MAX_RELATIVE_VALUE,
                 'useAnim': False}, showDecreaseArrow=any((penalty[1] != 0 for penalty in paramInfo.penalties)), padding=formatters.packPadding(left=74, top=8)))

        if len(block) > 0:
            block.insert(0, formatters.packTextBlockData(text_styles.middleTitle(_ms(TOOLTIPS.VEHICLEPARAMS_SIMPLIFIED_TITLE)), padding=formatters.packPadding(top=-4)))
        return block
Exemplo n.º 60
0
 def __getBoosterPrice(self, booster):
     block = []
     money = g_itemsCache.items.stats.money
     if booster.buyPrice:
         price = booster.buyPrice
         defPrice = booster.defaultPrice
         need = price - money
         need = need.toNonNegative()
         leftPadding = 92
         if price.credits > 0:
             creditsActionPercent = getActionPrc(price.credits, defPrice.credits)
             block.append(makePriceBlock(price.credits, CURRENCY_SETTINGS.BUY_CREDITS_PRICE, need.credits if need.credits > 0 else None, defPrice.credits if defPrice.credits > 0 else None, creditsActionPercent, leftPadding=leftPadding))
         if price.gold > 0:
             goldActionPercent = getActionPrc(price.gold, defPrice.gold)
             if price.credits > 0:
                 block.append(formatters.packTextBlockData(text=text_styles.standard(TOOLTIPS.VEHICLE_TEXTDELIMITER_OR), padding=formatters.packPadding(left=(101 if goldActionPercent > 0 else 81) + self.leftPadding)))
             block.append(makePriceBlock(price.gold, CURRENCY_SETTINGS.BUY_GOLD_PRICE, need.gold if need.gold > 0 else None, defPrice.gold if defPrice.gold > 0 else None, goldActionPercent, leftPadding=leftPadding))
     return block