Exemple #1
0
 def __packBonusBlock(self):
     blocks = []
     vehicle = cmp_helpers.getCmpConfiguratorMainView().getCurrentVehicle()
     camo = cmp_helpers.getSuitableCamouflage(vehicle)
     bonusTitleLocal = makeHtmlString(
         'html_templates:lobby/textStyle', 'bonusLocalText',
         {'message': '+{}'.format(camo.bonus.getFormattedValue(vehicle))})
     blocks.append(
         formatters.packImageTextBlockData(
             title=text_styles.concatStylesWithSpace(bonusTitleLocal),
             desc=text_styles.main(camo.bonus.description),
             img=camo.bonus.icon,
             imgPadding={
                 'left': 11,
                 'top': 3
             },
             txtGap=-4,
             txtOffset=65,
             padding={
                 'top': -1,
                 'left': 7
             }))
     if not self._showTTC and vehicle is not None:
         stockVehicle = self.itemsCache.items.getStockVehicle(vehicle.intCD)
         comparator = params_helper.camouflageComparator(vehicle, camo)
         stockParams = params_helper.getParameters(stockVehicle)
         simplifiedBlocks = SimplifiedStatsBlockConstructor(
             stockParams, comparator).construct()
         if simplifiedBlocks:
             blocks.extend(simplifiedBlocks)
     return formatters.packBuildUpBlockData(
         blocks,
         linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE
     )
 def _packBonusBlock(self, bonus, camo, isApplied):
     blocks = []
     vehicle = g_currentVehicle.item
     bonusPercent = bonus.getFormattedValue(vehicle)
     blocks.append(
         formatters.packImageTextBlockData(
             title=text_styles.bonusLocalInfoTipText(
                 text_styles.concatStylesToSingleLine('+', bonusPercent)),
             img=RES_ICONS.MAPS_ICONS_LIBRARY_QUALIFIERS_48X48_CAMOUFLAGE,
             imgPadding=formatters.packPadding(top=-8, left=12),
             txtPadding=formatters.packPadding(top=-4),
             txtOffset=69))
     blocks.append(
         formatters.packTextBlockData(
             text=text_styles.main(self.bonusDescription),
             padding=formatters.packPadding(top=-46, left=110)))
     stockVehicle = self.itemsCache.items.getStockVehicle(vehicle.intCD)
     comparator = params_helper.camouflageComparator(stockVehicle, camo)
     stockParams = params_helper.getParameters(stockVehicle)
     padding = formatters.packPadding(left=105, top=2, bottom=-6)
     simplifiedBlocks = SimplifiedStatsBlockConstructor(
         stockParams, comparator, padding).construct()
     if simplifiedBlocks and not isApplied:
         blocks.extend(simplifiedBlocks)
     return formatters.packBuildUpBlockData(
         blocks,
         linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE
     )
Exemple #3
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)
Exemple #4
0
 def __packBonusBlock(self):
     blocks = []
     vehicle = cmp_helpers.getCmpConfiguratorMainView().getCurrentVehicle()
     itemID, camo = cmp_helpers.getSuitableCamouflage(vehicle)
     if camo:
         camo['itemID'] = itemID
     cmpItem = self.__getItem(camo, VEHICLE_CAMOUFLAGE_BONUS[vehicle.type])
     bonusTitleLocal = makeHtmlString('html_templates:lobby/textStyle', 'bonusLocalText', {'message': '{0}{1}'.format(cmpItem.qualifier.getFormattedValue(), '')})
     blocks.append(formatters.packImageTextBlockData(title=text_styles.concatStylesWithSpace(bonusTitleLocal), desc=text_styles.main(cmpItem.qualifier.getExtendedName()), img=cmpItem.qualifier.getIcon42x42(), imgPadding={'left': 11,
      'top': 3}, txtGap=-4, txtOffset=65, padding={'top': -1,
      'left': 7}))
     if not self._showTTC and vehicle is not None:
         stockVehicle = self.itemsCache.items.getStockVehicle(vehicle.intCD)
         comparator = params_helper.camouflageComparator(vehicle, cmpItem)
         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)
Exemple #5
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 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
     )