def _format(self, condition, event): result = [] if not event.isGuiDisabled(): bonusTypes = condition.getValue() labelKey = QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE data = formatters.packMissionBonusTypeElements(bonusTypes) iconsList = ''.join([ iconData.icon for iconData in data ]) if len(bonusTypes) == 1 and findFirst(None, bonusTypes) in (ARENA_BONUS_TYPE.REGULAR, ARENA_BONUS_TYPE.RANKED): label = text_styles.main(data[0].iconLabel) else: label = text_styles.main(labelKey) bTypes = ', '.join([ iconData.iconLabel for iconData in data ]) tooltipBody = i18n.makeString(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE_BODY, battleBonusTypes=bTypes) result.append(formatters.packMissionPrebattleCondition(label, iconsList, makeTooltip(labelKey, tooltipBody))) return result
def requestMissionData(self, index): isObtained = not self._bootcamp.needAwarding() vehicleSelector = self.getComponent(QUESTS_ALIASES.MISSIONS_VEHICLE_SELECTOR_ALIAS) if vehicleSelector is not None: criteria = REQ_CRITERIA.VEHICLE.LEVELS([self._TANK_LEVEL]) | REQ_CRITERIA.IN_OWNERSHIP vehicleSelector.setCriteria(criteria, []) bTypesData = formatters.packMissionBonusTypeElements([ARENA_BONUS_TYPE.REGULAR]) bTypes = self._COMMA.join([ iconData.iconLabel for iconData in bTypesData ]) tooltipBody = makeString(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE_BODY, battleBonusTypes=bTypes) missionData = {'title': text_styles.promoSubTitle(backport.text(R.strings.bootcamp.quest.title())), 'battleConditions': [{'rendererLinkage': MISSIONS_ALIASES.BATTLE_CONDITION, 'linkageBig': MISSIONS_ALIASES.ANG_GROUP_BIG_LINKAGE, 'isDetailed': True, 'data': [{'title': text_styles.promoSubTitle(backport.text(R.strings.bootcamp.quest.name())), 'description': text_styles.highlightText(backport.text(R.strings.bootcamp.quest.condition())), 'state': MISSIONS_ALIASES.NONE, 'icon': backport.image(R.images.gui.maps.icons.quests.battleCondition.c_128.icon_battle_condition_battles_128x128()), 'maxDescLines': self._LINES_IN_DESCR}], 'linkage': MISSIONS_ALIASES.ANG_GROUP_DETAILED_LINKAGE}], 'statusLabel': text_styles.concatStylesWithSpace(icons.inProgress(), text_styles.standard(backport.text(R.strings.quests.missionDetails.missionsComplete(), count=text_styles.stats(self._MISSIONS_DONE), total=text_styles.standard(self._MISSIONS_COUNT)))), 'awards': [{'label': text_styles.gold(backport.text(R.strings.menu.premium.packet.days3())), 'padding': self._AWARD_LABEL_PADDING, 'imgSource': backport.image(R.images.gui.maps.icons.quests.bonuses.big.premium_3()), 'align': LABEL_ALIGN.RIGHT, 'tooltip': TOOLTIPS.AWARDITEM_PREMIUM, 'obtainedImage': backport.image(R.images.gui.maps.icons.library.awardObtained()), 'isObtained': isObtained, 'obtainedImageOffset': self._OBTAINED_IMAGE_OFFSET}, {'label': text_styles.gold(self._GOLD_LABEL), 'padding': self._AWARD_LABEL_PADDING, 'imgSource': backport.image(R.images.gui.maps.icons.quests.bonuses.big.gold()), 'align': LABEL_ALIGN.RIGHT, 'tooltip': TOOLTIPS.AWARDITEM_GOLD, 'obtainedImage': backport.image(R.images.gui.maps.icons.library.awardObtained()), 'isObtained': isObtained, 'obtainedImageOffset': self._OBTAINED_IMAGE_OFFSET}], 'background': 'default', 'prebattleConditions': [formatters.packMissionPrebattleCondition(text_styles.main(bTypesData[0].iconLabel), ''.join([ iconData.icon for iconData in bTypesData ]), makeTooltip(QUESTS.MISSIONDETAILS_CONDITIONS_BATTLEBONUSTYPE, tooltipBody))], 'uiDecoration': backport.image(R.images.gui.maps.icons.quests.decorations.default_750x264()), 'statusTooltipData': {}} self.as_setMissionDataS(missionData) return