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))
def _packConvertDescrBlock(self, vehicleName, nationName): descriptionBlock = formatters.packTextBlockData(text=text_styles.main( TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_FRAGMENTSCONVERT)) orTextObject = formatters.packAlignedTextBlockData( text=text_styles.main( TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_OR), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER) orTextBlock = formatters.packBuildUpBlockData( blocks=[orTextObject], align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, blockWidth=140, padding=formatters.packPadding(top=43)) vehicleBlock = self._getImageWithBottomTitleBlock( RES_ICONS.MAPS_ICONS_BLUEPRINTS_TOOLTIP_FRAGMENTRIBBON, vehicleName) internBlock = self._getImageWithBottomTitleBlock( RES_ICONS.MAPS_ICONS_BLUEPRINTS_FRAGMENT_MEDIUM_INTELLIGENCE, TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_INTERNATIONALS, formatters.packPadding(right=-70)) nationBlock = self._getImageWithBottomTitleBlock( RES_ICONS.getBlueprintFragment('medium', nationName), TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_NATIONALS, formatters.packPadding(left=-70)) arrowLeft = formatters.packImageBlockData( img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_TOOLTIP_ARROW_LEFT, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=20, right=-30)) arrowRight = formatters.packImageBlockData( img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_TOOLTIP_ARROW_RIGHT, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=20, left=-30)) middleBlock = formatters.packBuildUpBlockData( blocks=[arrowLeft, vehicleBlock, arrowRight], gap=1, layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER) sideBlock = formatters.packBuildUpBlockData( blocks=[internBlock, orTextBlock, nationBlock], layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(left=10, right=10, top=-35)) formulaBlock = formatters.packBuildUpBlockData( blocks=[middleBlock, sideBlock], gap=0, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER) return formatters.packBuildUpBlockData( blocks=[descriptionBlock, formulaBlock], padding=formatters.packPadding(bottom=-20))
def _packBlocks(self, *args, **kwargs): blocks = super(BasicFreeSheetTooltip, self)._packBlocks(*args, **kwargs) campaign = self.context.buildItem(*args, **kwargs) topItems = [ formatters.packTextBlockData( text_styles.highTitle( _ms(TOOLTIPS.PERSONALMISSIONS_FREESHEET_TITLE, campaignName=campaign.getUserName()))), formatters.packImageBlockData( AwardSheetPresenter.getIcon(AwardSheetPresenter.Size.BIG), BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-5, bottom=11)) ] blocks.append(formatters.packBuildUpBlockData(topItems)) infoBlock = self._getInfoBlock() if infoBlock is not None: blocks.append(infoBlock) bottomItems = [] for block in self._getDescriptionBlock(): if block is not None: bottomItems.append(block) blocks.append(formatters.packBuildUpBlockData(bottomItems)) return blocks
def _packBlocks(self, badgeID): blocks = super(BadgeTooltipData, self)._packBlocks() badge = self._context.buildItem(badgeID) paramsConfig = self._context.getParamsConfiguration(badge) if badge is None: _logger.warning( 'Missing tooltip text for %r, please check badge.po', int(badgeID)) return blocks else: tooltipData = [ formatters.packTextBlockData( text_styles.highTitle(badge.getUserName())), formatters.packImageBlockData( badge.getHugeIcon(), BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-5, bottom=11)) ] if g_currentVehicle.isPresent() and paramsConfig.showVehicle: vehicle = g_currentVehicle.item tooltipData.append( formatters.packBadgeInfoBlockData( badge.getThumbnailIcon(), vehicle.iconContour, text_styles.bonusPreviewText(getPlayerName()), text_styles.bonusPreviewText(vehicle.shortUserName))) blocks.append(formatters.packBuildUpBlockData(tooltipData)) blocks.append( formatters.packTextBlockData( text_styles.main(badge.getUserDescription()))) return blocks
def _packBlocks(self, boosterID, *args, **kwargs): items = super(BoosterTooltipData, self)._packBlocks(*args, **kwargs) booster = self.context.buildItem(boosterID) statsFields = self.context.getStatsConfiguration(booster) items.append( formatters.packBuildUpBlockData([ formatters.packTitleDescBlock( text_styles.highTitle(booster.fullUserName), desc=text_styles.main(booster.description)), formatters.packImageBlockData( img=booster.bigTooltipIcon, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=180, height=180, padding={ 'top': -14, 'bottom': -14 }) ])) items.append(self.__packDueDate(booster)) if statsFields.quests: questsResult = self.__getBoosterQuestNames(boosterID) if len(questsResult): items.append(self.__packAccessCondition(questsResult)) if statsFields.buyPrice and booster.buyPrice: priceBlock = self.__getBoosterPrice(booster) items.append(formatters.packBuildUpBlockData(priceBlock)) if statsFields.activeState and booster.inCooldown: items.append(self.__packActiveState(booster.getUsageLeftTimeStr())) return items
def _packAdvancedBlocks(self, movie, header, description): descrTextR = R.strings.tooltips.advanced.dyn(description) if descrTextR and descrTextR.isValid(): descrText = backport.text(descrTextR()) else: descrText = '#tooltips:advanced/' + 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
def _packIconBlock(self, item): actualWidth = 84 if self.__cItemType == CUSTOMIZATION_TYPE.INSCRIPTION: actualWidth = 176 return formatters.packImageBlockData( img=item["icon"], align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=actualWidth, height=84 )
def __packItemBlock(self, items): blocks = [] for itemData in items: count = itemData.get('count', 0) itemId = itemData.get('id', 0) itemType = itemData.get('type', '') icon, title = self.__getItemData(itemType, itemId) if not icon: continue awardCount = backport.text(self.__resPath.awardCount(), count=count) if count > 1 else ' ' textBlock = formatters.packTitleDescBlock( title=text_styles.main(title), desc=text_styles.stats(awardCount), padding=formatters.packPadding(top=-35, left=58), descPadding=formatters.packPadding(top=0, left=-24)) imageBlock = formatters.packImageBlockData(img=icon, width=48, height=48) blocks.append(imageBlock) blocks.append(textBlock) return formatters.packBuildUpBlockData( blocks, layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_VERTICAL, padding=formatters.packPadding(top=10, bottom=-20), align=BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT, stretchBg=False)
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
def __packFragmentsInfoBlock(self): countBlock = formatters.packImageTextBlockData( title=text_styles.main( TOOLTIPS.BLUEPRINT_VEHICLEBLUEPRINTTOOLTIP_FRAGMENTSACQUIRED), desc=text_styles.concatStylesWithSpace( text_styles.bonusLocalText( str(self.__blueprintData.filledCount)), text_styles.main(' '.join( ('/', str(self.__blueprintData.totalCount))))), img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_FRAGMENT_MEDIUM_VEHICLE, txtPadding=formatters.packPadding(left=11), txtGap=-6, padding=formatters.packPadding(top=4)) transitionBlock = formatters.packImageBlockData( img=RES_ICONS.MAPS_ICONS_BLUEPRINTS_TOOLTIP_POINTER, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-3, left=24, right=24)) if self.__blueprintData.filledCount != self.__blueprintData.totalCount: discountBlock = self.__packDiscountBlock() else: discountBlock = self.__packFreeUnlockBlock() return formatters.packBuildUpBlockData( blocks=[countBlock, transitionBlock, discountBlock], linkage=BLOCKS_TOOLTIP_TYPES. TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE, layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL, padding=formatters.packPadding(bottom=-10), blockWidth=390)
def _packBlocks(self, invID, isLocked): items = super(NotRecruitedTooltipData, self)._packBlocks() item = self.context.buildItem(invID) self.item = item blocks = list() blocks.append(formatters.packImageTextBlockData(title=text_styles.highTitle(item.getFullUserName()), desc=text_styles.main(item.getLabel()))) specialIcon = item.getSpecialIcon() blocks.append(formatters.packImageBlockData(img=specialIcon if specialIcon is not None else item.getBigIcon(), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=350 if specialIcon is not None else -1, height=238 if specialIcon is not None else -1)) blocks.append(formatters.packSeparatorBlockData(paddings=formatters.packPadding(top=-40))) descrStr = i18n.makeString(item.getDescription()) hasDescr = descrStr != EMPTY_STRING if hasDescr: blocks.append(formatters.packTextBlockData(text_styles.main(descrStr), useHtml=True, padding=formatters.packPadding(top=18))) howToGetStr = i18n.makeString(item.getHowToGetInfo()) hasHowToGetStr = howToGetStr != EMPTY_STRING if hasHowToGetStr: blocks.append(formatters.packTextBlockData(text_styles.middleTitle(backport.text(R.strings.tooltips.notrecruitedtankman.howToGet())), useHtml=True, padding=formatters.packPadding(top=17 if hasDescr else 18, bottom=5))) blocks.append(formatters.packTextBlockData(text_styles.main(howToGetStr), useHtml=True, padding=formatters.packPadding())) skills = item.getLearntSkills(multiplyNew=True) if skills: tankmanSkill = item.getTankmanSkill() blocks.append(formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.NOTRECRUITEDTANKMAN_SKILLSTITLE), useHtml=True, padding=formatters.packPadding(top=17 if hasDescr else 18, bottom=10))) blocks.append(formatters.packImageListParameterBlockData(listIconSrc=[ formatters.packImageListIconData(tankmanSkill(skillName=skillName).bigIconPath) for skillName in skills ], columnWidth=52, rowHeight=52, verticalGap=10, horizontalGap=10)) expiryTime = item.getExpiryTime() if expiryTime: blocks.append(formatters.packTextBlockData(text_styles.middleTitle(TOOLTIPS.NOTRECRUITEDTANKMAN_EXPIRETITLE), useHtml=True, padding=formatters.packPadding(top=20 if skills else (17 if hasDescr else 16), 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)) if isLocked: alertStr = item.getAdditionalAlert() if alertStr: blocks.append(formatters.packTextBlockData(text_styles.alertBig(alertStr), padding=formatters.packPadding(top=20))) items.append(formatters.packBuildUpBlockData(blocks, padding=formatters.packPadding(bottom=-5))) return items
def __getHeader(self): nationID = nations.INDICES.get(self.__nationName) return [ formatters.packImageBlockData( img=RES_ICONS.getTooltipFlag(self.__nationName), align=BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT, padding=formatters.packPadding(bottom=-80, left=-20)), formatters.packTextBlockData(text=text_styles.highTitle( backport.text( R.strings.tooltips.collectibleVehicleTooltip.header(), nation=backport.text( R.strings.nations.dyn( self.__nationName).genetiveCase())))), formatters.packImageTextBlockData( img=backport.image(R.images.gui.maps.icons.buttons. icon_table_comparison_inhangar()), imgPadding=formatters.packPadding(top=-2, left=-5), desc=text_styles.main( backport.text( R.strings.tooltips.collectibleVehicleTooltip. statistics(), inventory=text_styles.stats( len( helper.getCollectibleVehiclesInInventory( nationID))), common=len(helper.getCollectibleVehicles(nationID))))) ]
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
def __packImageBlock(itemName): return formatters.packImageBlockData( img=backport.image( R.images.gui.maps.icons.mapbox.selectableCrewbookTooltip.dyn( itemName)()), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-1))
def __packImageBlock(shortName): image = R.images.gui.maps.icons.battlePass.tooltips.dyn(shortName) if not image.exists(): image = R.images.gui.maps.icons.battlePass.tooltips.new_device_fv_gift return formatters.packImageBlockData( img=backport.image(image()), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-1))
def _packIconBlock(self, data): actualWidth = 84 if self._cType == CUSTOMIZATION_TYPE.INSCRIPTION: actualWidth = 176 return formatters.packImageBlockData( img=data['icon'], align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=actualWidth, height=84)
def __packQuestReward(self, bonus): if bonus.label.startswith('x'): align = BLOCKS_TOOLTIP_TYPES.ALIGN_RIGHT padding = formatters.packPadding(top=-16, right=12) else: align = BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER padding = formatters.packPadding(top=-16) iconBlock = formatters.packImageBlockData(img=bonus.getImage(AWARDS_SIZES.SMALL), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER) textBlock = formatters.packAlignedTextBlockData(text=bonus.getFormattedLabel(), align=align, padding=padding) return formatters.packBuildUpBlockData(blocks=[iconBlock, textBlock], blockWidth=72, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-8, bottom=-6))
def _packBlocks(self, label, description, icon): items = super(StatsTooltipData, self)._packBlocks() items.append( formatters.packBuildUpBlockData([ formatters.packTextBlockData(text_styles.highTitle(label)), formatters.packImageBlockData( img=icon, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER), formatters.packTextBlockData(text_styles.main(description)) ])) return items
def _packIconBlock(self): width = 102 if self._item.isWide(): width = 204 if self._item.itemTypeName == 'inscription' else 278 return formatters.packImageBlockData( img=self._item.icon, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=width, height=102, padding={'bottom': 2})
def __packTitleBlock(self): blocks = [ formatters.packTextBlockData(text=text_styles.highTitle( backport.text( R.strings.veh_compare.vehConf.tooltips.camoTitle())), padding=formatters.packPadding( top=-3, left=-2)), formatters.packImageBlockData(img=self.__camo.bonus.iconBig, padding=formatters.packPadding( top=-6, left=90)) ] return formatters.packBuildUpBlockData(blocks)
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
def _constructHeader(self, skillLevel, level): block = [] if level: romanLvl = int2roman(level) desc = backport.text(R.strings.epic_battle.metaAbilityScreen.Ability_level(), lvl=text_styles.expText(romanLvl)) descFormatter = text_styles.main else: desc = backport.text(R.strings.epic_battle.metaAbilityScreen.Ability_not_unlocked()) descFormatter = text_styles.standard block.append(formatters.packTitleDescBlock(title=text_styles.highTitle(skillLevel.name), desc=descFormatter(desc), gap=-5)) block.append(formatters.packImageBlockData(img=backport.image(R.images.gui.maps.icons.epicBattles.skills.c_176x176.dyn(skillLevel.icon)()), padding=formatters.packPadding(left=123, top=10))) return block
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
def _getImageWithBottomTitleBlock(imagePath, imageTitle, blockPadding=None): titleBlock = formatters.packAlignedTextBlockData( text=text_styles.stats(imageTitle), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-5)) imageBlock = formatters.packImageBlockData( img=imagePath, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER) return formatters.packBuildUpBlockData( blocks=[imageBlock, titleBlock], align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, blockWidth=140, padding=blockPadding)
def _packBlocks(self, *args, **kwargs): module = vehicles.g_cache.equipments()[args[0]] if module is None: return else: items = super(EquipmentsTooltipData, self)._packBlocks() leftPadding = 20 rightPadding = 20 topPadding = 20 verticalPadding = 2 innerBlockLeftPadding = 100 headerBlockItem = [ formatters.packBuildUpBlockData( self.__constructHeaderBlock(module, leftPadding, innerBlockLeftPadding), padding=formatters.packPadding(left=leftPadding, right=rightPadding, top=topPadding, bottom=verticalPadding)) ] cooldownBlock = self.__constructCooldownBlock( module, verticalPadding, innerBlockLeftPadding) if cooldownBlock is not None: headerBlockItem.append(cooldownBlock) items.append(formatters.packBuildUpBlockData(headerBlockItem)) items.append( formatters.packBuildUpBlockData( self.__constructDescriptionBlock(module, leftPadding), linkage=BLOCKS_TOOLTIP_TYPES. TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE, padding=formatters.packPadding(left=leftPadding, right=rightPadding, top=verticalPadding, bottom=verticalPadding))) items.append( formatters.packTextBlockData(text=text_styles.standard( backport.text( R.strings.tooltips.battle_royale.artefact.source())), padding=formatters.packPadding( left=innerBlockLeftPadding, top=verticalPadding))) if hasattr(module, 'tooltipMovie') and module.tooltipMovie: block = formatters.packImageBlockData( module.tooltipMovie, BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT, padding=5, linkage=BLOCKS_TOOLTIP_TYPES. TOOLTIP_ADVANCED_CLIP_BLOCK_LINKAGE) items.append(block) return items
def _constructHeader(self, skillLevel): block = [ formatters.packTitleDescBlock(title=text_styles.highTitle( skillLevel.name), gap=-5), formatters.packImageBlockData(img=backport.image( R.images.gui.maps.icons.epicBattles.skills.c_176x176.dyn( skillLevel.icon)()), width=128, height=128, padding=formatters.packPadding( left=123, top=-10)) ] return block
def __getDescription(): return [ formatters.packImageBlockData( img=backport.image(R.images.gui.maps.icons.vehicleCollector. collectibles_pic()), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(bottom=10)), formatters.packTextBlockData( text=text_styles.main( backport.text(R.strings.tooltips.collectibleVehicleTooltip. description())), padding=formatters.packPadding(bottom=10)), formatters.packTextBlockData(text=text_styles.main( backport.text( R.strings.tooltips.collectibleVehicleTooltip.elite()))) ]
def __packDiscountBlock(self): fragmentBlock = formatters.packImageBlockData( img=RES_ICONS.getBlueprintFragment('medium', 'vehicle'), padding=formatters.packPadding(top=4, left=8)) percentDiscount, xpDiscount = self.context.getFragmentDiscounts( self.__vehicle) discountBlock = self._getUnlockDiscountBlock( percentDiscount, xpDiscount, TOOLTIPS. BLUEPRINT_VEHICLEBLUEPRINTEMPTYSLOTTOOLTIP_RESEARCHDISCOUNT, True) return formatters.packBuildUpBlockData( blocks=[fragmentBlock, discountBlock], gap=24, linkage=BLOCKS_TOOLTIP_TYPES. TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE, layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL, padding=formatters.packPadding(bottom=-10), blockWidth=370)
def _packIconBlock(self, isHistorical=False): linkAs = BLOCKS_TOOLTIP_TYPES.TOOLTIP_IMAGE_BLOCK_LINKAGE width = self._countImageWidth() if self._specialArgs: component = pickPacker( self._item.itemTypeID).getRawComponent()(*self._specialArgs) else: component = None if isHistorical is not True: linkAs = BLOCKS_TOOLTIP_TYPES.TOOLTIP_IMAGE_BLOCK_NON_HISTORICAL_LINKAGE return formatters.packImageBlockData( img=self._item.getIconApplied(component), linkage=linkAs, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=width, height=self.CUSTOMIZATION_TOOLTIP_ICON_HEIGHT, padding=formatters.packPadding(bottom=2))
def _packBlocks(self, *args, **kwargs): items = super(BadgesSuffixRankedItem, self)._packBlocks(*args) items.append( formatters.packBuildUpBlockData( [ formatters.packImageBlockData( img=backport.image(R.images.gui.maps.icons.library. badges.icon_star_yellow()), padding=formatters.packPadding(top=3)), formatters.packTextBlockData( text_styles.neutral( backport.text(R.strings.tooltips.badgepage.ranked. suffixItem.duration()))) ], padding=formatters.packPadding(top=-4), layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL)) return items
def _packAdvancedBlocks(self, movie, header, description): descrText = TOOLTIPS.getAdvancedDescription(description) if descrText is None: descrText = '#advanced/' + description 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
def _packConversionFormulaBlock(self, intelRequired, nationRequired, vehicle): nationalRequiredOptions, nationalAllianceFragments = self.context.getAllianceNationFragmentsData(vehicle) blocks = [] if intelRequired > self.context.getUniversalCount(): intelText = text_styles.critical(str(intelRequired)) else: intelText = text_styles.warning(str(intelRequired)) blocks.append(formatters.packImageTextBlockData(desc=intelText, img=backport.image(R.images.gui.maps.icons.blueprints.fragment.special.intelligence()), imgAtLeft=False, txtAlign=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, imgPadding=formatters.packPadding(top=4, left=2), padding=formatters.packPadding(top=4))) blocks.append(formatters.packImageTextBlockData(desc=text_styles.main(backport.text(R.strings.tooltips.blueprint.VehicleBlueprintTooltip.chose())), img=backport.image(R.images.gui.maps.icons.blueprints.blueprintScreen.icPlus()), txtPadding=formatters.packPadding(top=1, left=4), padding=formatters.packPadding(top=3, left=6))) for index, (nationId, cost) in enumerate(nationalRequiredOptions.iteritems()): nationName = nations.MAP[nationId] if cost > nationalAllianceFragments[nationId]: nationText = text_styles.critical(backport.getIntegralFormat(cost)) else: nationText = text_styles.warning(backport.getIntegralFormat(cost)) blocks.append(formatters.packImageTextBlockData(desc=nationText, img=backport.image(R.images.gui.maps.icons.blueprints.fragment.special.dyn(nationName)()), imgAtLeft=False, txtAlign=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, imgPadding=formatters.packPadding(top=4, left=2), padding=formatters.packPadding(top=4))) if index < len(nationalRequiredOptions) - 1: blocks.append(formatters.packImageBlockData(img=backport.image(R.images.gui.maps.icons.library.delimeter()), align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, padding=formatters.packPadding(top=-4, left=2, right=-2, bottom=4))) return formatters.packBuildUpBlockData(blocks=blocks, layout=BLOCKS_TOOLTIP_TYPES.LAYOUT_HORIZONTAL, align=BLOCKS_TOOLTIP_TYPES.ALIGN_LEFT, padding=formatters.packPadding(top=1, bottom=-15))
def _packBlocks(self, boosterID, *args, **kwargs): items = super(BoosterTooltipData, self)._packBlocks(*args, **kwargs) booster = self.context.buildItem(boosterID) statsFields = self.context.getStatsConfiguration(booster) items.append(formatters.packBuildUpBlockData([formatters.packTitleDescBlock(text_styles.highTitle(booster.fullUserName), desc=text_styles.main(booster.description)), formatters.packImageBlockData(img=booster.bigTooltipIcon, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=180, height=180, padding={'top': -14, 'bottom': -14})])) items.append(self.__packDueDate(booster)) if statsFields.quests: questsResult = self.__getBoosterQuestNames(boosterID) if len(questsResult): items.append(self.__packAccessCondition(questsResult)) if statsFields.buyPrice and booster.buyPrice: priceBlock = self.__getBoosterPrice(booster) items.append(formatters.packBuildUpBlockData(priceBlock)) if statsFields.activeState and booster.inCooldown: items.append(self.__packActiveState(booster.getUsageLeftTimeStr())) return items
def _packBlocks(self, boosterID, *args, **kwargs): items = super(BoosterTooltipData, self)._packBlocks(*args, **kwargs) booster = g_goodiesCache.getBooster(boosterID) questsResult = self.__getBoosterQuestNames(boosterID) items.append(formatters.packBuildUpBlockData([formatters.packTitleDescBlock(text_styles.highTitle(booster.fullUserName), desc=text_styles.main(booster.description)), formatters.packImageBlockData(img=booster.bigTooltipIcon, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=180, height=180, padding={'top': -14, 'bottom': -14})])) items.append(self.__packDueDate(booster)) if len(questsResult): qNames = '"%s"' % ', '.join(questsResult) items.append(self.__packAccessCondition(qNames)) if booster.inCooldown: items.append(self.__packActiveState(booster.getUsageLeftTimeStr())) return items