Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 def __packTypesListBlock(self):
     return formatters.packImageListParameterBlockData(
         listIconSrc=[
             formatters.packImageListIconData(getVehicleTypeAssetPath(v))
             for v in self._vehicleTypes
         ],
         columnWidth=27,
         rowHeight=20,
         padding=formatters.packPadding(bottom=8, left=7))
Exemplo n.º 3
0
 def __packNationsListBlock(self):
     return formatters.packImageListParameterBlockData(
         listIconSrc=[
             formatters.packImageListIconData(getNationsFilterAssetPath(n))
             for n in self._nations
         ],
         columnWidth=32,
         rowHeight=20,
         padding=formatters.packPadding(left=15, bottom=8))