Esempio n. 1
0
 def _packReceivedBlock(self, winEarnedCount, loseEarnedCount):
     block = []
     block.append(
         self._getConditionHeaderBlock(
             strValue=RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS_HEADER))
     if winEarnedCount > 0:
         winIcon = RES_ICONS.getRankedTooltipTopIcon(winEarnedCount)
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     _ms(RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS,
                         battlesNum=winEarnedCount,
                         team=text_styles.statInfo(
                             RANKED_BATTLES.TOOLTIP_STEP_WINNERS))),
                 img=winIcon,
                 txtPadding=formatters.packPadding(left=17)))
     if winEarnedCount > 0 and loseEarnedCount > 0:
         block.append(
             self._getOrBlock(
                 padding=formatters.packPadding(left=70, bottom=10)))
     if loseEarnedCount > 0:
         loseIcon = RES_ICONS.getRankedTooltipLoseIcon(loseEarnedCount)
         block.append(
             formatters.packImageTextBlockData(
                 desc=text_styles.main(
                     _ms(RANKED_BATTLES.TOOLTIP_STEP_CONDITIONS,
                         battlesNum=loseEarnedCount,
                         team=text_styles.critical(
                             RANKED_BATTLES.TOOLTIP_STEP_LOSERS))),
                 img=loseIcon,
                 txtPadding=formatters.packPadding(left=17)))
     return formatters.packBuildUpBlockData(
         block, 0,
         BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
 def __packDescBlock():
     blocks = [
         formatters.packImageTextBlockData(title=text_styles.middleTitle(
             VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESCHEADER)),
         formatters.packImageTextBlockData(title=text_styles.main(
             _ms(VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC1,
                 influence=text_styles.alert(
                     VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC1_INFLUENCE))),
                                           img=RES_ICONS.
                                           MAPS_ICONS_LIBRARY_COUNTER_1,
                                           imgPadding={'top': 3},
                                           txtOffset=35),
         formatters.packImageTextBlockData(
             title=text_styles.main(
                 _ms(VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC2,
                     perc=text_styles.alert(
                         VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC2_PERC))),
             img=RES_ICONS.MAPS_ICONS_LIBRARY_COUNTER_2,
             imgPadding={'top': 3},
             txtOffset=35)
     ]
     return formatters.packBuildUpBlockData(
         blocks,
         linkage=BLOCKS_TOOLTIP_TYPES.
         TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
         gap=15)
Esempio n. 3
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),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_BUTTONSBLOCK_ADDTOCOMPARE), img=RES_ICONS.MAPS_ICONS_LIBRARY_ADD_TO_COMPARE, imgPadding={'left': 11,
       'top': -22}, txtGap=txtGap, txtOffset=txtOffset, txtPadding={'top': -10})], blocksGap))
     return items
Esempio n. 4
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),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCHTREE_BUTTONSBLOCK_ADDTOCOMPARE), img=RES_ICONS.MAPS_ICONS_LIBRARY_ADD_TO_COMPARE, imgPadding={'left': 11,
       'top': -22}, txtGap=txtGap, txtOffset=txtOffset, txtPadding={'top': -10})], blocksGap))
     return items
Esempio n. 5
0
 def _packMainBlock(self, serverName, timeLimits):
     blocksGap = 20
     blocksList = [formatters.packImageTextBlockData(title=text_styles.main(_ms(TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_SERVERLIMIT, server=text_styles.error(serverName))))]
     if timeLimits:
         blocksList.append(formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_SERVERLIMITTIMEDESCR)))
     mainBlock = [formatters.packBuildUpBlockData(blocksList, blocksGap)]
     return mainBlock
Esempio n. 6
0
 def construct(self):
     module = self.module
     block = []
     title = module.userName
     imgPaddingLeft = 27
     desc = ''
     if module.itemTypeName in VEHICLE_COMPONENT_TYPE_NAMES:
         desc = text_styles.stats(_ms(TOOLTIPS.level(str(
             module.level)))) + ' ' + _ms(TOOLTIPS.VEHICLE_LEVEL)
         imgPaddingLeft = 22
     block.append(
         formatters.packImageTextBlockData(
             title=text_styles.highTitle(title),
             desc=text_styles.standard(desc),
             img=module.icon,
             imgPadding=formatters.packPadding(left=imgPaddingLeft),
             txtGap=-3,
             txtOffset=130 - self.leftPadding,
             padding=formatters.packPadding(top=-6)))
     if module.itemTypeID == GUI_ITEM_TYPE.GUN:
         vehicle = self.configuration.vehicle
         vDescr = vehicle.descriptor if vehicle is not None else None
         if module.isClipGun(vDescr):
             block.append(
                 formatters.packImageTextBlockData(
                     title=text_styles.standard(
                         MENU.MODULEINFO_CLIPGUNLABEL),
                     desc='',
                     img=RES_ICONS.MAPS_ICONS_MODULES_MAGAZINEGUNICON,
                     imgPadding=formatters.packPadding(top=3),
                     padding=formatters.packPadding(left=108, top=9)))
     return block
Esempio n. 7
0
 def construct(self):
     module = self.module
     block = []
     title = module.userName
     imgPaddingLeft = 27
     imgPaddingTop = 0
     txtOffset = 130 - self.leftPadding
     desc = ''
     if module.itemTypeName in VEHICLE_COMPONENT_TYPE_NAMES:
         desc = text_styles.concatStylesWithSpace(text_styles.stats(_ms(TOOLTIPS.level(str(module.level)))), text_styles.standard(_ms(TOOLTIPS.VEHICLE_LEVEL)))
         imgPaddingLeft = 22
     elif module.itemTypeID in GUI_ITEM_TYPE.ARTEFACTS:
         imgPaddingLeft = 7
         imgPaddingTop = 5
         txtOffset = 90 - self.leftPadding
         moduleParams = params_helper.getParameters(module)
         weightUnits = text_styles.standard(TOOLTIPS.PARAMETER_WEIGHTUNITS)
         paramName = ModuleTooltipBlockConstructor.WEIGHT_MODULE_PARAM
         paramValue = params_formatters.formatParameter(paramName, moduleParams[paramName]) if paramName in moduleParams else None
         if paramValue is not None:
             desc = text_styles.main(TOOLTIPS.PARAMETER_WEIGHT) + text_styles.credits(paramValue) + weightUnits
     else:
         desc = text_styles.standard(desc)
     overlayPath, overlayPadding, blockPadding = self.__getOverlayData()
     block.append(formatters.packItemTitleDescBlockData(title=text_styles.highTitle(title), desc=desc, img=module.icon, imgPadding=formatters.packPadding(left=imgPaddingLeft, top=imgPaddingTop), txtGap=-3, txtOffset=txtOffset, padding=blockPadding, overlayPath=overlayPath, overlayPadding=overlayPadding))
     if module.itemTypeID == GUI_ITEM_TYPE.GUN:
         vehicle = self.configuration.vehicle
         vDescr = vehicle.descriptor if vehicle is not None else None
         if module.isClipGun(vDescr):
             block.append(formatters.packImageTextBlockData(title=text_styles.standard(MENU.MODULEINFO_CLIPGUNLABEL), desc='', img=RES_ICONS.MAPS_ICONS_MODULES_MAGAZINEGUNICON, imgPadding=formatters.packPadding(top=3), padding=formatters.packPadding(left=108, top=9)))
     elif module.itemTypeID == GUI_ITEM_TYPE.CHASSIS:
         if module.isHydraulicChassis():
             block.append(formatters.packImageTextBlockData(title=text_styles.standard(MENU.MODULEINFO_HYDRAULICCHASSISLABEL), desc='', img=RES_ICONS.MAPS_ICONS_MODULES_HYDRAULICCHASSISICON, imgPadding=formatters.packPadding(top=3), padding=formatters.packPadding(left=108, top=9)))
     return block
Esempio n. 8
0
 def _packMainBlock(self, serverName, timeLimits):
     blocksGap = 20
     blocksList = [formatters.packImageTextBlockData(title=text_styles.main(i18n.makeString(TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_SERVERLIMIT, server=text_styles.error(serverName))))]
     if timeLimits:
         blocksList.append(formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_SERVERLIMITTIMEDESCR)))
     mainBlock = [formatters.packBuildUpBlockData(blocksList, blocksGap)]
     return mainBlock
 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(
         ' ', ' ')
     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
 def construct(self):
     block = []
     module = self.module
     vehicle = self.configuration.vehicle
     header = formatters.packTextBlockData(
         text=text_styles.middleTitle(
             backport.text(
                 R.strings.tooltips.battleBooster.installationEffects())),
         padding=formatters.packPadding(bottom=5))
     block.append(header)
     if module.isCrewBooster():
         skillLearnt = module.isAffectedSkillLearnt(vehicle)
         skillName = backport.text(
             R.strings.item_types.tankman.skills.dyn(
                 module.getAffectedSkillName())())
         replaceText = module.getCrewBoosterAction(True)
         boostText = module.getCrewBoosterAction(False)
         skillNotLearntText = text_styles.standard(
             backport.text(
                 R.strings.tooltips.battleBooster.skill.not_learnt()))
         skillLearntText = text_styles.standard(
             backport.text(R.strings.tooltips.battleBooster.skill.learnt()))
         applyStyles = vehicle is not None
         replaceText, boostText = self.__getSkillTexts(
             skillLearnt, replaceText, boostText, applyStyles)
         block.append(
             formatters.packImageTextBlockData(
                 title=replaceText,
                 img=backport.image(
                     R.images.gui.maps.icons.buttons.checkmark())
                 if not skillLearnt and applyStyles else None,
                 imgPadding=formatters.packPadding(left=2, top=3),
                 txtOffset=20))
         block.append(
             formatters.packImageTextBlockData(title=skillNotLearntText %
                                               skillName,
                                               txtOffset=20))
         block.append(
             formatters.packImageTextBlockData(
                 title=boostText,
                 img=backport.image(
                     R.images.gui.maps.icons.buttons.checkmark())
                 if skillLearnt and applyStyles else None,
                 imgPadding=formatters.packPadding(left=2, top=3),
                 txtOffset=20,
                 padding=formatters.packPadding(top=15)))
         block.append(
             formatters.packImageTextBlockData(title=skillLearntText %
                                               skillName,
                                               txtOffset=20))
     else:
         block.append(
             formatters.packTextParameterBlockData(
                 text_styles.main(
                     module.shortDescription.replace('%s ', '', 1)),
                 text_styles.bonusAppliedText(
                     module.getOptDeviceBoosterGainValue(vehicle=vehicle)),
                 valueWidth=110,
                 gap=15))
     return block
Esempio n. 11
0
 def _packBlocks(self, *args, **kwargs):
     items = super(ComplexTooltip, self)._packBlocks(*args, **kwargs)
     strs = args[0].split('<br/>')
     items.append(formatters.packImageTextBlockData(title=strs[0], desc=strs[1]))
     block = formatters.packImageTextBlockData(img=RES_ICONS.MAPS_ICONS_LOBBY_ICONBTNALT, txtOffset=40, padding=formatters.packPadding(bottom=-7, top=-5, left=20 - self._getContentMargin()['left']), desc=text_styles.main(TOOLTIPS.ADVANCED_INFO), linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_ADVANCED_KEY_BLOCK_LINKAGE)
     block['data']['animated'] = not self._disableAnim
     items.append(block)
     return items
Esempio n. 12
0
 def _packBlocks(self, *args, **kwargs):
     items = super(ResearchVehicleInfoPacker,
                   self)._packBlocks(*args, **kwargs)
     imgPdg = {'left': 2, 'top': 3}
     txtOffset = 25
     blocksGap = 7
     txtGap = -4
     items.append(
         formatters.packBuildUpBlockData([
             formatters.packTitleDescBlockSmallTitle(
                 text_styles.middleTitle(
                     TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_EXPTITLE),
                 text_styles.main(
                     TOOLTIPS.
                     HANGARTUTORIAL_RESEARCH_VEHICLEINFO_EXPDESCRIPTION)),
             formatters.packBuildUpBlockData([
                 formatters.packImageTextBlockData(
                     text_styles.main(
                         TOOLTIPS.
                         HANGARTUTORIAL_RESEARCH_VEHICLEINFO_BATTLEEXPTITLE
                     ),
                     text_styles.standard(
                         TOOLTIPS.
                         HANGARTUTORIAL_RESEARCH_VEHICLEINFO_BATTLEEXPDESCRIPTION
                     ),
                     RES_ICONS.MAPS_ICONS_LIBRARY_NORMALXPICON,
                     imgPdg,
                     txtOffset=txtOffset,
                     txtGap=txtGap),
                 formatters.packImageTextBlockData(
                     text_styles.main(
                         TOOLTIPS.
                         HANGARTUTORIAL_RESEARCH_VEHICLEINFO_FREEEXPTITLE),
                     text_styles.standard(
                         TOOLTIPS.
                         HANGARTUTORIAL_RESEARCH_VEHICLEINFO_FREEEXPDESCRIPTION
                     ),
                     RES_ICONS.MAPS_ICONS_LIBRARY_FREEXPICON_2, {
                         'left': 1,
                         'top': 3
                     },
                     txtOffset=txtOffset,
                     txtGap=txtGap),
                 formatters.packImageTextBlockData(
                     text_styles.main(
                         TOOLTIPS.
                         HANGARTUTORIAL_RESEARCH_VEHICLEINFO_TOTALEXPTITLE),
                     '',
                     RES_ICONS.MAPS_ICONS_LIBRARY_POWERLEVELICON_1,
                     imgPdg,
                     txtOffset=txtOffset,
                     txtGap=txtGap)
             ],
                                             gap=12)
         ], blocksGap, BLOCKS_TOOLTIP_TYPES.
                                         TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE
                                         ))
     return items
 def _packConversionFormulaBlock(self, intelRequired, nationRequired,
                                 nationName, vehicleCD):
     if intelRequired > self.context.getUniversalCount():
         intelText = text_styles.errCurrencyTextBig(str(intelRequired))
     else:
         intelText = text_styles.expTextBig(str(intelRequired))
     if nationRequired > self.context.getUniversalCount(vehicleCD):
         nationText = text_styles.errCurrencyTextBig(str(nationRequired))
     else:
         nationText = text_styles.expTextBig(str(nationRequired))
     countBlockInt = formatters.packImageTextBlockData(
         title=None,
         desc=intelText,
         img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_FRAGMENT_MEDIUM_INTELLIGENCE,
         imgAtLeft=False,
         imgPadding=formatters.packPadding(top=0, right=5),
         txtPadding=formatters.packPadding(top=8, left=5),
         padding=formatters.packPadding(top=0))
     countBlockNation = formatters.packImageTextBlockData(
         title=None,
         desc=nationText,
         img=RES_ICONS.getBlueprintFragment('medium', nationName),
         imgAtLeft=False,
         imgPadding=formatters.packPadding(top=0, right=5),
         txtPadding=formatters.packPadding(top=8, left=5),
         padding=formatters.packPadding(top=0))
     countPlus = formatters.packImageBlockData(
         img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_BLUEPRINTSCREEN_ICPLUS,
         align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
         padding=formatters.packPadding(left=10, right=0, top=12))
     countEqual = formatters.packImageBlockData(
         img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_BLUEPRINTSCREEN_ICEQUAL,
         align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
         padding=formatters.packPadding(left=8, right=8, top=12))
     countPrint = formatters.packImageTextBlockData(
         title=None,
         desc=text_styles.main(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_GATHERDESCRIPTION2),
         img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_FRAGMENT_MEDIUM_VEHICLE,
         imgPadding=formatters.packPadding(top=0, right=5),
         txtPadding=formatters.packPadding(top=4, left=5),
         padding=formatters.packPadding(top=0))
     imageHowBlock = formatters.packBuildUpBlockData(
         blocks=[
             countBlockInt, countPlus, countBlockNation, countEqual,
             countPrint
         ],
         gap=5,
         layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL,
         padding=formatters.packPadding(top=8))
     textOrBlock = formatters.packTextBetweenLineBlockData(
         text=text_styles.main(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_OR))
     return formatters.packBuildUpBlockData(
         blocks=[textOrBlock, imageHowBlock],
         align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER,
         gap=5,
         padding=formatters.packPadding(bottom=-20))
Esempio n. 14
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
Esempio n. 15
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
Esempio n. 16
0
 def _packBlocks(self, *args, **kwargs):
     items = super(CrewSkinSoundTooltipDataBlock, self)._packBlocks()
     tankman = self.context.buildItem(*args, **kwargs).tankman
     topBlock = []
     topBlock.append(
         formatters.packTextBlockData(text=text_styles.middleTitle(
             backport.text(R.strings.tooltips.crewSkins.sound()))))
     topBlock.append(
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.tooltips.crewSkins.soundHeader()))))
     if tankman.role != Tankman.ROLES.COMMANDER:
         topBlock.append(
             formatters.packImageTextBlockData(
                 img=RES_ICONS.MAPS_ICONS_LIBRARY_ALERTBIGICON,
                 imgPadding={
                     'left': -3,
                     'top': -2
                 },
                 txtOffset=20,
                 padding=formatters.packPadding(bottom=0, top=8, left=0),
                 desc=text_styles.alert(
                     backport.text(R.strings.tooltips.crewSkins.
                                   soundWarningDescr2()))))
     elif not SoundGroups.g_instance.soundModes.currentNationalPreset[1]:
         topBlock.append(
             formatters.packImageTextBlockData(
                 img=RES_ICONS.MAPS_ICONS_LIBRARY_ALERTBIGICON,
                 imgPadding={
                     'left': -3,
                     'top': -2
                 },
                 txtOffset=20,
                 padding=formatters.packPadding(bottom=0, top=8, left=0),
                 desc=text_styles.alert(
                     backport.text(R.strings.tooltips.crewSkins.
                                   soundWarningDescr1()))))
     items.append(formatters.packBuildUpBlockData(topBlock))
     infoBlock = []
     infoBlock.append(
         formatters.packImageTextBlockData(
             img=RES_ICONS.MAPS_ICONS_LIBRARY_INFO,
             imgPadding={
                 'left': -3,
                 'top': -2
             },
             txtOffset=20,
             desc=text_styles.stats(
                 backport.text(R.strings.tooltips.crewSkins.soundInfo()))))
     infoBlock.append(
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.tooltips.crewSkins.soundInfoDescr())),
                                      padding=formatters.packPadding(
                                          left=20)))
     items.append(formatters.packBuildUpBlockData(infoBlock))
     return items
Esempio n. 17
0
 def __packNationalFragmentBlocks(self):
     items = self._items
     self._setNationFlagCornerBg(self.__nationName)
     items.append(formatters.packImageTextBlockData(title=text_styles.highTitle(TOOLTIPS.BLUEPRINT_BLUEPRINTFRAGMENTTOOLTIP_NATIONALFRAGMENT), img=RES_ICONS.getBlueprintFragment('small', self.__nationName), imgPadding=formatters.packPadding(top=5), txtPadding=formatters.packPadding(top=5, left=19), padding=formatters.packPadding(bottom=-8)))
     self._items = [formatters.packBuildUpBlockData(blocks=items)]
     items = self._items
     nation = i18n.makeString(NATIONS.genetiveCase(self.__nationName))
     descriptionBlock = formatters.packImageTextBlockData(desc=text_styles.main(i18n.makeString(TOOLTIPS.BLUEPRINT_BLUEPRINTFRAGMENTTOOLTIP_NATIONALDESCRIPTION, nation=nation)), img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_PLUS, imgPadding=formatters.packPadding(top=0, right=5), padding=formatters.packPadding(left=40))
     items.append(formatters.packBuildUpBlockData(blocks=[descriptionBlock, self.__packAdditionalInfoBlock()], gap=3, linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE, padding=formatters.packPadding(bottom=-4)))
     fragmentsCount = self.context.getUniversalCount(self._fragmentCD)
     items.append(self.__packInStorageBlock(fragmentsCount))
Esempio n. 18
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
Esempio n. 19
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
Esempio n. 20
0
    def _getPrimeTimes(self, primeTimes):
        def getPrimeTimeBlock(pt):
            periphery = int(pt.getServer())
            name = str(self._lobbyContext.getPeripheryName(periphery, False))
            name += ':'
            return '{0} {1}'.format(
                text_styles.main(name),
                text_styles.standard('{} - {}'.format(pt.getStartLocalTime(),
                                                      pt.getEndLocalTime())))

        def getSortedPrimeTimes(primeTimes):
            primeTimes = sorted(primeTimes, key=lambda p: int(p.getServer()))
            times = [getPrimeTimeBlock(pt) for pt in primeTimes]
            return times

        primeTimesData = primeTimes.getPrimeTimes()
        validTimes = set((pt for pt in primeTimesData if pt.isActive()))
        invalidTimes = set(primeTimesData) - validTimes
        blocks = []
        if validTimes:
            result = ''
            bottomPadding = 20 if invalidTimes else 18
            for primeTime in getSortedPrimeTimes(validTimes):
                result += primeTime + '\n'

            blocks.append(
                formatters.packImageTextBlockData(
                    title=text_styles.middleTitle(
                        TOOLTIPS.HANGAR_ELEN_PRIMETIME_VALID),
                    desc=result,
                    padding=formatters.packPadding(left=20,
                                                   top=3,
                                                   bottom=bottomPadding)))
        if invalidTimes:
            topPadding = -8 if validTimes else 3
            result = ''
            for primeTime in getSortedPrimeTimes(invalidTimes):
                result += primeTime + '\n'

            blocks.append(
                formatters.packImageTextBlockData(
                    title=text_styles.middleTitle(
                        TOOLTIPS.HANGAR_ELEN_PRIMETIME_INVALID),
                    desc=result,
                    padding=formatters.packPadding(left=20,
                                                   top=topPadding,
                                                   bottom=18)))
        return formatters.packBuildUpBlockData(
            blocks,
            linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE
        )
Esempio n. 21
0
 def construct(self):
     block = []
     module = self.module
     vehicle = self.configuration.vehicle
     if module.isCrewBooster():
         skillLearnt = module.isAffectedSkillLearnt(vehicle)
         skillName = _ms(
             ITEM_TYPES.tankman_skills(module.getAffectedSkillName()))
         replaceText = module.getCrewBoosterAction(True)
         boostText = module.getCrewBoosterAction(False)
         skillNotLearntText = text_styles.standard(
             TOOLTIPS.BATTLEBOOSTER_SKILL_NOT_LEARNT)
         skillLearntText = text_styles.standard(
             TOOLTIPS.BATTLEBOOSTER_SKILL_LEARNT)
         applyStyles = vehicle is not None
         replaceText, boostText = self.__getSkillTexts(
             skillLearnt, replaceText, boostText, applyStyles)
         block.append(
             formatters.packImageTextBlockData(
                 title=replaceText,
                 img=RES_ICONS.MAPS_ICONS_BUTTONS_CHECKMARK
                 if not skillLearnt and applyStyles else None,
                 imgPadding=formatters.packPadding(left=2, top=3),
                 txtOffset=20))
         block.append(
             formatters.packImageTextBlockData(title=skillNotLearntText %
                                               skillName,
                                               txtOffset=20))
         block.append(
             formatters.packImageTextBlockData(
                 title=boostText,
                 img=RES_ICONS.MAPS_ICONS_BUTTONS_CHECKMARK
                 if skillLearnt and applyStyles else None,
                 imgPadding=formatters.packPadding(left=2, top=3),
                 txtOffset=20,
                 padding=formatters.packPadding(top=15)))
         block.append(
             formatters.packImageTextBlockData(title=skillLearntText %
                                               skillName,
                                               txtOffset=20))
     else:
         desc = text_styles.bonusAppliedText(
             module.getOptDeviceBoosterDescription(vehicle))
         block.append(
             formatters.packTitleDescBlock(
                 title='',
                 desc=desc,
                 padding=formatters.packPadding(top=-8)))
     return block
 def __packBlueprintDescrBlock():
     fragmentInfo = formatters.packImageTextBlockData(
         desc=text_styles.main(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_DESCRIPTIONFIRST),
         img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_FRAGMENT_MEDIUM_VEHICLE,
         txtPadding=formatters.packPadding(top=2, left=21))
     discountInfo = formatters.packImageTextBlockData(
         desc=text_styles.main(
             TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_DESCRIPTIONSECOND),
         img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_TOOLTIP_DISCOUNT,
         txtPadding=formatters.packPadding(top=4, left=21))
     return formatters.packBuildUpBlockData(
         blocks=[fragmentInfo, discountInfo],
         gap=5,
         padding=formatters.packPadding(top=8))
Esempio n. 23
0
 def construct(self):
     module = self.module
     block = []
     title = module.userName
     imgPaddingLeft = 27
     desc = ''
     if module.itemTypeName in VEHICLE_COMPONENT_TYPE_NAMES:
         desc = text_styles.stats(_ms(TOOLTIPS.level(str(module.level)))) + ' ' + _ms(TOOLTIPS.VEHICLE_LEVEL)
         imgPaddingLeft = 22
     block.append(formatters.packImageTextBlockData(title=text_styles.highTitle(title), desc=text_styles.standard(desc), img=module.icon, imgPadding=formatters.packPadding(left=imgPaddingLeft), txtGap=-3, txtOffset=130 - self.leftPadding, padding=formatters.packPadding(top=-6, right=self.rightPadding)))
     if module.itemTypeID == GUI_ITEM_TYPE.GUN:
         vehicle = self.configuration.vehicle
         vDescr = vehicle.descriptor if vehicle is not None else None
         if module.isClipGun(vDescr):
             block.append(formatters.packImageTextBlockData(title=text_styles.standard(MENU.MODULEINFO_CLIPGUNLABEL), desc='', img=RES_ICONS.MAPS_ICONS_MODULES_MAGAZINEGUNICON, imgPadding=formatters.packPadding(top=3), padding=formatters.packPadding(left=108, top=9)))
     return block
Esempio n. 24
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
Esempio n. 25
0
 def _getHeader(self, _):
     icon, text = self._marathonEvent.getTooltipHeader()
     if icon:
         formattedText = '{}{}'.format(icons.makeImageTag(icon, width=32, height=32, vSpace=-10, hSpace=-10), text_styles.main(text))
     else:
         formattedText = '{}'.format(text_styles.main(text))
     return formatters.packImageTextBlockData(title=text_styles.highTitle(backport.text(self.__tooltipData.header)), img=self.__iconsData.tooltipHeader, imgPadding=formatters.packPadding(top=-1, left=1), txtPadding=formatters.packPadding(top=25), txtOffset=20, txtGap=-8, desc=formattedText, descPadding=formatters.packPadding(top=25, left=-8))
 def _packHeaderBlock(self):
     return formatters.packImageTextBlockData(
         title=text_styles.middleTitle(
             RANKED_BATTLES.CALENDARSTEPSTOOLTIP_TITLE),
         img=RES_ICONS.MAPS_ICONS_BUTTONS_CALENDAR,
         imgPadding=formatters.packPadding(top=5),
         txtPadding=formatters.packPadding(left=10))
Esempio n. 27
0
 def _packBlocks(self, paramName):
     extendedData = self.context.getComparator().getExtendedData(paramName)
     self.__paramName = extendedData.name
     title = text_styles.highTitle(MENU.tank_params(paramName))
     if param_formatter.isRelativeParameter(paramName):
         value = param_formatter.colorizedFormatParameter(extendedData, self.context.formatters)
         title += ' ' + text_styles.warning(_ms(TOOLTIPS.VEHICLEPARAMS_TITLE_VALUETEMPLATE, value=value))
     else:
         title += ' ' + text_styles.middleTitle(MEASURE_UNITS.get(paramName, ''))
     desc = _ms(TOOLTIPS.tank_params_desc(paramName))
     possibleBonuses = sorted(extendedData.possibleBonuses, _bonusCmp)
     if possibleBonuses is not None and len(possibleBonuses) > 0:
         desc += ' ' + _ms(TOOLTIPS.VEHICLEPARAMS_POSSIBLEBONUSES_DESC)
         desc += '\n' + self.__createBonusesStr(possibleBonuses)
     blocks = [formatters.packTitleDescBlock(title, text_styles.main(desc))]
     bonuses = sorted(extendedData.bonuses, _bonusCmp)
     if bonuses is not None and len(bonuses) > 0:
         blocks.append(formatters.packTitleDescBlock(text_styles.middleTitle(TOOLTIPS.VEHICLEPARAMS_BONUSES_TITLE), text_styles.main(self.__createBonusesStr(bonuses))))
     penalties = extendedData.penalties
     actualPenalties, nullPenaltyTypes = self.__getNumNotNullPenaltyTankman(penalties)
     penaltiesLen = len(penalties)
     numNotNullPenaltyTankman = len(actualPenalties)
     if numNotNullPenaltyTankman > 0:
         blocks.append(formatters.packTitleDescBlock(text_styles.critical(TOOLTIPS.VEHICLEPARAMS_PENALTIES_TITLE), text_styles.main(self.__createPenaltiesStr(actualPenalties))))
     if penaltiesLen > numNotNullPenaltyTankman:
         blocks.append(formatters.packImageTextBlockData(self.__createTankmanIsOutStr(nullPenaltyTypes), img=RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, imgPadding=formatters.packPadding(top=2, left=3, right=6)))
     return blocks
    def _packBlocks(self):
        items = super(RankedCalendarStepsTooltip, self)._packBlocks()
        blocks = [self._packHeaderBlock()]
        key = RANKED_BATTLES.RANKEDBATTLEVIEW_STATUSBLOCK_CALENDARPOPOVER_CYCLEITEM
        cycles = self.rankedController.getCurrentSeason().getAllCycles()
        for cycle in sorted(cycles.values()):
            currentCycle = False
            if cycle.status == CYCLE_STATUS.CURRENT:
                formatter = text_styles.main
                currentCycle = True
            else:
                formatter = text_styles.standard
            startDate = time_utils.getTimeStructInLocal(cycle.startDate)
            endDate = time_utils.getTimeStructInLocal(cycle.endDate)
            item = formatter(
                i18n.makeString(key,
                                cycleNumber=cycle.ordinalNumber,
                                day0='{:02d}'.format(startDate.tm_mday),
                                month0='{:02d}'.format(startDate.tm_mon),
                                day1='{:02d}'.format(endDate.tm_mday),
                                month1='{:02d}'.format(endDate.tm_mon)))
            if currentCycle:
                blocks.append(
                    formatters.packImageTextBlockData(
                        title=item,
                        img=RES_ICONS.MAPS_ICONS_LIBRARY_INPROGRESSICON,
                        imgPadding=formatters.packPadding(top=5),
                        txtPadding=formatters.packPadding(left=5)))
            else:
                blocks.append(
                    formatters.packTextBlockData(
                        text=item, padding=formatters.packPadding(left=20)))

        items.append(formatters.packBuildUpBlockData(blocks, 13))
        return items
    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 __getBonus(preset):
     return formatters.packImageTextBlockData(
         img=backport.image(preset.imageRPath()),
         imgPadding=formatters.packPadding(preset.top, preset.left,
                                           preset.bottom, preset.right),
         title=text_styles.main(backport.text(preset.textRPath())),
         padding=formatters.packPadding(bottom=20))
Esempio n. 31
0
 def _packBlocks(self, *args, **kwargs):
     items = super(NotRecruitedTooltipData, self)._packBlocks()
     item = self.context.buildItem(*args)
     self.item = item
     blocks = list()
     blocks.append(
         formatters.packImageTextBlockData(
             title=text_styles.highTitle(item.getFullUserName()),
             desc=text_styles.main(item.getLabel())))
     blocks.append(
         formatters.packImageBlockData(
             img=item.getBigIcon(),
             align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER))
     blocks.append(formatters.packSeparatorBlockData())
     blocks.append(
         formatters.packTextBlockData(
             text_styles.main(item.getDescription()),
             useHtml=True,
             padding=formatters.packPadding(top=20, bottom=7)))
     if item.getLearntSkills():
         blocks.append(
             formatters.packTextBlockData(text_styles.middleTitle(
                 TOOLTIPS.NOTRECRUITEDTANKMAN_SKILLSTITLE),
                                          useHtml=True,
                                          padding=formatters.packPadding(
                                              top=10, bottom=10)))
         skills = item.getLearntSkills()
         blocks.append(
             formatters.packImageListParameterBlockData(
                 listIconSrc=[
                     Tankman.getSkillIconPath(skillName=skillName,
                                              size='big')
                     for skillName in skills
                 ],
                 columnWidth=52,
                 rowHeight=52,
                 verticalGap=10,
                 horizontalGap=10,
                 padding=formatters.packPadding(bottom=10)))
     expiryTime = item.getExpiryTime()
     if expiryTime:
         blocks.append(
             formatters.packTextBlockData(text_styles.middleTitle(
                 TOOLTIPS.NOTRECRUITEDTANKMAN_EXPIRETITLE),
                                          useHtml=True,
                                          padding=formatters.packPadding(
                                              top=10, bottom=2)))
         expireDateStr = makeString(TOOLTIPS.NOTRECRUITEDTANKMAN_USEBEFORE,
                                    date=expiryTime)
         blocks.append(
             formatters.packTextParameterWithIconBlockData(
                 name=text_styles.premiumVehicleName(expireDateStr),
                 value='',
                 icon=ICON_TEXT_FRAMES.RENTALS,
                 padding=formatters.packPadding(left=-60, bottom=-18),
                 iconYOffset=3))
     items.append(
         formatters.packBuildUpBlockData(
             blocks, padding=formatters.packPadding(bottom=-10)))
     return items
Esempio n. 32
0
 def _getStatusBlock(division, isLocked, isCompleted):
     statusTitle = text_styles.warning(
         backport.text(
             R.strings.ranked_battles.division.tooltip.status.current()))
     statusText = None
     if division.isQualification():
         statusTitle = text_styles.warning(
             backport.text(R.strings.ranked_battles.division.tooltip.status.
                           currentQual()))
     if isLocked:
         statusTitle = text_styles.critical(
             backport.text(
                 R.strings.ranked_battles.division.tooltip.status.locked()))
         statusText = text_styles.standard(
             backport.text(R.strings.ranked_battles.division.tooltip.status.
                           locked.desc()))
         if division.isPostQualification():
             statusText = text_styles.standard(
                 backport.text(R.strings.ranked_battles.division.tooltip.
                               status.locked.descQual()))
     if isCompleted:
         statusTitle = text_styles.statInfo(
             backport.text(R.strings.ranked_battles.division.tooltip.status.
                           completed()))
         if division.isQualification():
             statusTitle = text_styles.statInfo(
                 backport.text(R.strings.ranked_battles.division.tooltip.
                               status.completedQual()))
     return formatters.packImageTextBlockData(
         title=statusTitle,
         desc=statusText,
         txtPadding=formatters.packPadding(left=10))
Esempio n. 33
0
 def _packLockedBlock(self):
     titleString = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_INFOTYPE_LOCKED_TITLE
     seasonString = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_INFOTYPE_LOCKED_SUMMER
     return formatters.packImageTextBlockData(
         title=text_styles.middleTitleLocked(_ms(titleString)),
         desc=text_styles.locked(_ms(seasonString)),
         img=RES_ICONS.MAPS_ICONS_LIBRARY_INFOTYPE_LOCKED)
Esempio n. 34
0
 def construct(self):
     block = []
     vehicle = self.configuration.vehicle
     if vehicle.equipment.battleBoosterConsumables[0] is not None:
         replaceBoosterText = text_styles.main(TOOLTIPS.BATTLEBOOSTER_REPLACE)
         block.append(formatters.packImageTextBlockData(title=replaceBoosterText.format(boosterName=vehicle.equipment.battleBoosterConsumables[0].userName), txtOffset=20))
     return block
Esempio n. 35
0
 def construct(self):
     item = self.item
     block = []
     title = item.userName
     desc = item.getUserType()
     block.append(formatters.packImageTextBlockData(title=text_styles.highTitle(title), desc=text_styles.main(desc), img=item.icon, imgPadding=formatters.packPadding(left=12), txtGap=-4, txtOffset=100 - self.leftPadding))
     return block
Esempio n. 36
0
 def construct(self):
     shell = self.shell
     block = []
     title = shell.userName
     desc = '#item_types:shell/kinds/' + shell.type
     block.append(formatters.packImageTextBlockData(title=text_styles.highTitle(title), desc=text_styles.standard(desc), img=shell.icon, imgPadding=formatters.packPadding(left=7), txtGap=-4, txtOffset=100 - self.leftPadding))
     return block
Esempio n. 37
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
Esempio n. 38
0
 def _getDescriptionBlock(self, division, isLocked, isCompleted):
     descTitle = text_styles.middleTitle(
         backport.text(
             R.strings.ranked_battles.division.tooltip.desc.title()))
     descKey = 'current'
     if isLocked:
         descKey = 'locked'
     elif isCompleted:
         descKey = 'completed'
     if division.isQualification():
         descKey += 'Qual'
     elif division.isFinal():
         descKey += 'Final'
     qualBattles = sorted(
         self.rankedController.getQualificationQuests().keys())
     qualBattles.append(
         self.rankedController.getTotalQualificationBattles())
     descText = text_styles.standard(
         backport.text(R.strings.ranked_battles.division.tooltip.desc.dyn(
             descKey).text(),
                       battles=', '.join([str(x) for x in qualBattles])))
     return formatters.packImageTextBlockData(
         title=descTitle,
         desc=descText,
         txtPadding=formatters.packPadding(left=10))
Esempio n. 39
0
 def _packConditionsBlock(self, item):
     return formatters.packImageTextBlockData(
         title=text_styles.middleTitle(
             _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_DESCRIPTION_CONDITIONS_TITLE)
         ),
         desc=text_styles.standard("*{0}".format(item["conditional"])),
         txtGap=8,
     )
Esempio n. 40
0
 def construct(self):
     block = []
     headerBlocks = []
     if self.vehicle.isElite:
         vehicleType = TOOLTIPS.tankcaruseltooltip_vehicletype_elite(self.vehicle.type)
         bgLinkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_ELITE_VEHICLE_BG_LINKAGE
     else:
         vehicleType = TOOLTIPS.tankcaruseltooltip_vehicletype_normal(self.vehicle.type)
         bgLinkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_NORMAL_VEHICLE_BG_LINKAGE
     nameStr = text_styles.highTitle(self.vehicle.userName)
     typeStr = text_styles.main(vehicleType)
     levelStr = text_styles.concatStylesWithSpace(text_styles.stats(int2roman(self.vehicle.level)), text_styles.standard(_ms(TOOLTIPS.VEHICLE_LEVEL)))
     icon = '../maps/icons/vehicleTypes/big/' + self.vehicle.type + ('_elite.png' if self.vehicle.isElite else '.png')
     headerBlocks.append(formatters.packImageTextBlockData(title=nameStr, desc=text_styles.concatStylesToMultiLine(levelStr + ' ' + typeStr, ''), img=icon, imgPadding=formatters.packPadding(left=10, top=-15), txtGap=-2, txtOffset=99, padding=formatters.packPadding(top=15, bottom=-15 if self.vehicle.isFavorite else -21)))
     if self.vehicle.isFavorite:
         headerBlocks.append(formatters.packImageTextBlockData(title=text_styles.neutral(TOOLTIPS.VEHICLE_FAVORITE), img=RES_ICONS.MAPS_ICONS_TOOLTIP_MAIN_TYPE, imgPadding=formatters.packPadding(top=-15), imgAtLeft=False, txtPadding=formatters.packPadding(left=10), txtAlign=BLOCKS_TOOLTIP_TYPES.ALIGN_RIGHT, padding=formatters.packPadding(top=-28, bottom=-27)))
     block.append(formatters.packBuildUpBlockData(headerBlocks, stretchBg=False, linkage=bgLinkage, padding=formatters.packPadding(left=-self.leftPadding)))
     return block
Esempio n. 41
0
 def _packBlocks(self, *args, **kwargs):
     items = super(PersonalCasePerksPacker, self)._packBlocks(*args, **kwargs)
     blocksGap = 2
     imgPdg = {'left': 0,
      'right': 10,
      'top': 4}
     txtGap = 0
     items.append(formatters.packBuildUpBlockData([formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_PERSONALCASE_PERKS_NEWPERKTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_PERSONALCASE_PERKS_NEWPERKDESCRIPTION), RES_COMMON.MAPS_ICONS_TANKMEN_SKILLS_BIG_NEW_SKILL, imgPdg, txtGap=txtGap)], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     return items
Esempio n. 42
0
    def _packBlocks(self, *args, **kwargs):
        items = super(NationsPacker, self)._packBlocks(*args, **kwargs)
        nationItems = []
        for nation in GUI_NATIONS:
            nationItems.append(formatters.packImageTextBlockData(desc=text_styles.main('#tooltips:hangarTutorial/nations/%s' % nation), img='../maps/icons/filters/nations/%s.png' % nation, imgPadding={'left': 4,
             'top': 4}, txtGap=1, txtOffset=36))

        items.append(formatters.packBuildUpBlockData(nationItems, 2))
        return items
Esempio n. 43
0
 def _packBlocks(self, *args, **kwargs):
     items = super(ResearchVehicleInfoPacker, self)._packBlocks(*args, **kwargs)
     imgPdg = {'left': 2,
      'top': 3}
     txtOffset = 25
     blocksGap = 7
     txtGap = -4
     items.append(formatters.packBuildUpBlockData([formatters.packTitleDescBlockSmallTitle(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_EXPTITLE), text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_EXPDESCRIPTION)), formatters.packBuildUpBlockData([formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_BATTLEEXPTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_BATTLEEXPDESCRIPTION), RES_ICONS.MAPS_ICONS_LIBRARY_NORMALXPICON, imgPdg, txtOffset=txtOffset, txtGap=txtGap), formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_FREEEXPTITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_FREEEXPDESCRIPTION), RES_ICONS.MAPS_ICONS_LIBRARY_FREEXPICON_2, {'left': 1,
        'top': 3}, txtOffset=txtOffset, txtGap=txtGap), formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_RESEARCH_VEHICLEINFO_TOTALEXPTITLE), '', RES_ICONS.MAPS_ICONS_LIBRARY_POWERLEVELICON_1, imgPdg, txtOffset=txtOffset, txtGap=txtGap)], gap=12)], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     return items
Esempio n. 44
0
 def _packBlocks(self, *args, **kwargs):
     items = super(AmmunitionPacker, self)._packBlocks(*args, **kwargs)
     imgPdg = {'left': 0,
      'top': 4}
     txtOffset = 56
     txtGap = -5
     blocksGap = 10
     items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_TITLE)),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_PIERCING_TITLE), desc=text_styles.standard(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_PIERCING_DESCRIPTION), img=RES_ICONS.MAPS_ICONS_AMMOPANEL_AMMO_ARMOR_PIERCING, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_HIGH_EXPLOSIVE_TITLE), desc=text_styles.standard(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_HIGH_EXPLOSIVE_DESCRIPTION), img=RES_ICONS.MAPS_ICONS_AMMOPANEL_AMMO_HIGH_EXPLOSIVE, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_SUBCALIBER_TITLE), desc=text_styles.standard(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_SUBCALIBER_DESCRIPTION), img=RES_ICONS.MAPS_ICONS_AMMOPANEL_AMMO_ARMOR_PIERCING_CR, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset),
      formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_CUMULATIVE_TITLE), desc=text_styles.standard(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_TYPE_CUMULATIVE_DESCRIPTION), img=RES_ICONS.MAPS_ICONS_AMMOPANEL_AMMO_HOLLOW_CHARGE, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset)], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     imgPdg = {'left': 0,
      'top': 0}
     txtOffset = 0
     txtGap = 0
     blocksGap = 0
     items.append(formatters.packBuildUpBlockData([formatters.packTitleDescBlockSmallTitle(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_AMMOSET_TITLE), text_styles.main(TOOLTIPS.HANGARTUTORIAL_AMMUNITION_AMMOSET_DESCRIPTION)), formatters.packImageTextBlockData(img=RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_AMMOSLIDER, imgPadding=imgPdg, txtGap=txtGap, txtOffset=txtOffset)], blocksGap))
     return items
Esempio n. 45
0
 def _packDescriptionBlock(self, customizationType):
     return formatters.packBuildUpBlockData(
         [
             formatters.packImageTextBlockData(
                 img=customizationType["img"], desc=customizationType["description"], imgPadding={"right": 10}
             )
         ],
         0,
         BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
     )
Esempio n. 46
0
 def construct(self):
     tier = self.item.name.split('tier')
     if len(tier) > 1:
         _, level = tier
         desc = _ms('#fortifications:orderType/battleConsumable', level=int2roman(int(level)))
     else:
         desc = _ms('#fortifications:orderType/battleConsumable_no_level')
     block = []
     title = self.item.userName
     block.append(formatters.packImageTextBlockData(title=text_styles.highTitle(title), desc=text_styles.main(desc), img=self.item.icon, imgPadding=formatters.packPadding(left=12), txtGap=-4, txtOffset=100 - self.leftPadding))
     return block
Esempio n. 47
0
 def _packTitleBlock(self, data):
     title = data['title']
     itemsCount = data['itemsCount']
     if itemsCount is not None and itemsCount > 1:
         title += _ms('#vehicle_customization:customization/tooltip/alreadyHave/count', count=itemsCount)
     typeText = ''
     if self._itemType == CUSTOMIZATION_TYPE.CAMOUFLAGE:
         typeText = _ms('#vehicle_customization:camouflage')
     elif self._itemType == CUSTOMIZATION_TYPE.EMBLEM:
         typeText = _ms('#vehicle_customization:emblem')
     elif self._itemType == CUSTOMIZATION_TYPE.INSCRIPTION:
         typeText = _ms('#vehicle_customization:inscription')
     typeText += ' ' + _ms(data['groupName'])
     return formatters.packImageTextBlockData(title=text_styles.highTitle(title), padding={'top': -5}, desc=text_styles.main(typeText))
Esempio n. 48
0
 def _packBlocks(self, isCurfewEnabled, timeLimits, serverName = None):
     title = TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_HEADER_CURFEW if isCurfewEnabled else TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_HEADER_INFO
     items = super(FortListViewTooltipData, self)._packBlocks()
     items.append(formatters.packTitleDescBlock(text_styles.highTitle(title), desc=text_styles.main(self._descr) if self._descr else None))
     blocksGap = 2
     mainBlock = self._packMainBlock(serverName, timeLimits)
     limits = timeLimits
     timeBlock = []
     _packTimeLimitsBlock(timeBlock, limits)
     if len(timeBlock) > 0:
         mainBlock.append(formatters.packBuildUpBlockData(timeBlock, 0))
     items.append(formatters.packBuildUpBlockData(mainBlock, blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     items.append(formatters.packBuildUpBlockData([formatters.packImageTextBlockData(title=text_styles.main(TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_FOOTER))], blocksGap))
     return items
Esempio n. 49
0
 def construct(self):
     if self.configuration.params and not self.configuration.simplifiedOnly:
         currentCrewSize = len([x for _, x in self.vehicle.crew if x is not None])
         if currentCrewSize < len(self.vehicle.descriptor.type.crewRoles):
             return [
                 formatters.packImageTextBlockData(
                     title="",
                     desc=text_styles.standard(TOOLTIPS.VEHICLE_STATS_FOOTNOTE),
                     img=RES_ICONS.MAPS_ICONS_LIBRARY_STORE_CONDITION_OFF,
                     imgPadding=formatters.packPadding(top=4),
                     txtGap=-4,
                     txtOffset=20,
                     padding=formatters.packPadding(left=59, right=20),
                 )
             ]
     return []
Esempio n. 50
0
 def _packBonusBlock(self, data):
     vehicle = g_currentVehicle.item
     blocks = []
     conditionBonus = data['condition'] is not None and data['type'] != CUSTOMIZATION_TYPE.CAMOUFLAGE
     bonusTitleLocal = makeHtmlString('html_templates:lobby/textStyle', 'bonusLocalText', {'message': '{0}{1}'.format(data['bonus_title_local'], '*' if conditionBonus else '')})
     blocks.append(formatters.packImageTextBlockData(title=text_styles.concatStylesWithSpace(bonusTitleLocal), desc=text_styles.main(data['bonus_desc']), img=data['bonus_icon'], imgPadding={'left': 11,
      'top': 3}, txtGap=-4, txtOffset=70, padding={'top': -1,
      'left': 7}))
     if data['showTTC'] and vehicle is not None and self._cType == CUSTOMIZATION_TYPE.CAMOUFLAGE:
         stockVehicle = g_itemsCache.items.getStockVehicle(vehicle.intCD)
         comparator = params_helper.camouflageComparator(vehicle, self._item)
         stockParams = params_helper.getParameters(stockVehicle)
         simplifiedBlocks = SimplifiedStatsBlockConstructor(stockParams, comparator).construct()
         if len(simplifiedBlocks) > 0:
             blocks.extend(simplifiedBlocks)
     return formatters.packBuildUpBlockData(blocks, linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
Esempio n. 51
0
 def construct(self):
     block = []
     if self.vehicle.isElite:
         vehicleType = TOOLTIPS.tankcaruseltooltip_vehicletype_elite(self.vehicle.type)
         bgLinkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_ELITE_VEHICLE_FAVORITE_BG_LINKAGE if self.vehicle.isFavorite else BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_ELITE_VEHICLE_BG_LINKAGE
     else:
         vehicleType = TOOLTIPS.tankcaruseltooltip_vehicletype_normal(self.vehicle.type)
         bgLinkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_NORMAL_VEHICLE_FAVORITE_BG_LINKAGE if self.vehicle.isFavorite else BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_NORMAL_VEHICLE_BG_LINKAGE
     nameStr = text_styles.highTitle(self.vehicle.userName)
     typeStr = text_styles.main(vehicleType)
     levelStr = text_styles.concatStylesWithSpace(text_styles.stats(int2roman(self.vehicle.level)), text_styles.standard(_ms(TOOLTIPS.VEHICLE_LEVEL)))
     icon = '../maps/icons/vehicleTypes/big/' + self.vehicle.type + ('_elite.png' if self.vehicle.isElite else '.png')
     imgOffset = 4
     textOffset = 82
     if self.vehicle.type == 'heavyTank':
         imgOffset = 11
         textOffset = 99
     iconBlock = formatters.packImageTextBlockData(title=nameStr, desc=text_styles.concatStylesToMultiLine(typeStr, levelStr), img=icon, imgPadding={'left': imgOffset,
      'top': -15}, txtGap=-2, txtOffset=textOffset, padding=formatters.packPadding(top=15, bottom=-15))
     block.append(formatters.packBuildUpBlockData([iconBlock], stretchBg=False, linkage=bgLinkage, padding=formatters.packPadding(left=-19 + self.leftPadding, top=-1)))
     return block
Esempio n. 52
0
 def _packBonusBlock(self, item):
     bonusTitleLocal = makeHtmlString(
         "html_templates:lobby/textStyle",
         "bonusLocalText",
         {"message": "{0}{1}".format(item["bonus_title_local"], "" if item["conditional"] is None else "*")},
     )
     return formatters.packBuildUpBlockData(
         [
             formatters.packImageTextBlockData(
                 title=text_styles.concatStylesWithSpace(
                     bonusTitleLocal, text_styles.stats(item["bonus_title_global"])
                 ),
                 desc=text_styles.main(item["bonus_desc"]),
                 img=item["bonus_icon"],
                 imgPadding={"left": 11, "top": 3},
                 txtGap=-4,
                 txtOffset=70,
                 padding={"top": -1, "left": 7},
             )
         ],
         0,
         BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
     )
Esempio n. 53
0
    def _packWayToBuyBlock(self, data):
        subBlocks = [formatters.packTextBlockData(text=text_styles.middleTitle(_ms('#vehicle_customization:customization/tooltip/wayToBuy/title')), padding={'bottom': 6})]
        for buyItem in data['buyItems']:
            buyItemDesc = text_styles.main(buyItem['desc'])
            if buyItem['type'] == BUY_ITEM_TYPE.WAYS_TO_BUY_MISSION:
                subBlocks.append(formatters.packImageTextBlockData(desc=buyItemDesc, img=RES_ICONS.MAPS_ICONS_LIBRARY_QUEST_ICON, imgPadding={'left': 53,
                 'top': 3}, txtGap=-4, txtOffset=73))
            elif buyItem['type'] == BUY_ITEM_TYPE.WAYS_TO_BUY_FOREVER:
                if buyItem['isSale']:
                    subBlocks.append(formatters.packSaleTextParameterBlockData(name=buyItemDesc, saleData={'newPrice': (0, buyItem['value'])}, padding={'left': 0}))
                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={'left': 0}))
                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={'left': 0}))

        return formatters.packBuildUpBlockData(subBlocks, 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LINKAGE, {'left': 3})
Esempio n. 54
0
 def _packBonusBlock(self, item):
     bonusTitleLocal = makeHtmlString('html_templates:lobby/textStyle', 'bonusLocalText', {'message': '{0}{1}'.format(item['bonus_title_local'], '' if item['conditional'] is None else '*')})
     return formatters.packBuildUpBlockData([formatters.packImageTextBlockData(title=text_styles.concatStylesWithSpace(bonusTitleLocal, text_styles.stats(item['bonus_title_global'])), desc=text_styles.main(item['bonus_desc']), img=item['bonus_icon'], imgPadding={'left': 11,
       'top': 3}, txtGap=-4, txtOffset=70, padding={'top': -1,
       'left': 7})], 0, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE)
Esempio n. 55
0
 def _packDescBlock(self, item):
     return formatters.packImageTextBlockData(title=text_styles.middleTitle(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_DESCRIPTION_HISTORY_TITLE)), desc=text_styles.standard(item['description']), txtGap=8)
Esempio n. 56
0
 def _packBlocks(self, *args, **kwargs):
     items = super(CustomizationTypesPacker, self)._packBlocks(*args, **kwargs)
     imgPdg = {'left': 3,
      'right': 8,
      'top': -4}
     txtGap = -4
     items.append(formatters.packBuildUpBlockData([formatters.packTitleDescBlockSmallTitle(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_CAMOUFLAGEBLOCKTITLE), text_styles.main(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_CAMOUFLAGEBLOCKDESCRIPTION)), formatters.packBuildUpBlockData([formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_WINTERCAMOUFLAGETITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_WINTERCAMOUFLAGEDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_WINTER, imgPdg, txtGap=txtGap), formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_SUMMERCAMOUFLAGETITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_SUMMERCAMOUFLAGEDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_SUMMER, imgPdg, txtGap=txtGap), formatters.packImageTextBlockData(text_styles.main(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_DESERTCAMOUFLAGETITLE), text_styles.standard(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_DESERTCAMOUFLAGEDESCRIPTION), RES_ICONS.MAPS_ICONS_HANGARTUTORIAL_DESERT, imgPdg, txtGap=txtGap)], gap=5)], gap=13))
     items.append(formatters.packTitleDescBlockSmallTitle(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_EMBLEMBLOCKTITLE), text_styles.main(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_EMBLEMBLOCKDESCRIPTION)))
     items.append(formatters.packTitleDescBlockSmallTitle(text_styles.middleTitle(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_LABELSBLOCKTITLE), text_styles.main(TOOLTIPS.HANGARTUTORIAL_CUSTOMIZATION_TYPES_LABELSBLOCKDESCRIPTION)))
     return items
Esempio n. 57
0
def _packTimeLimitsBlock(block, limits):
    textOffset = 30
    for limit in limits:
        text = i18n.makeString(TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_TIMELIMITFORMAT, startTime=limit.startTime, endTime=limit.endTime)
        block.append(formatters.packImageTextBlockData(title=text_styles.error(text), txtOffset=textOffset))
Esempio n. 58
0
 def _packMainBlock(self, serverName, timeLimits):
     if serverName or timeLimits:
         key = TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_TIMEDESCR
     else:
         key = TOOLTIPS.FORTIFICATION_SORTIE_LISTROOM_REGULATION_NONE
     return [formatters.packImageTextBlockData(title=text_styles.main(key))]
Esempio n. 59
0
 def pack(self, data):
     titleStr = text_styles.highTitle(self.__headerTitle)
     return [formatters.packImageTextBlockData(titleStr, img=self.__icon, txtPadding={'left': 18,
       'top': 9,
       'bottom': 1}, padding={'left': 2,
       'top': 7})]