def __setHeader(self): nonHistoricItemsCount = sum((int(not it.isHistorical()) for it in self.__ctx.currentOutfit.items())) checkBoxText = '{}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_ITEMSPOPOVER_HISTORICCHECKBOX_ITEMS)) counterText = text_styles.vehicleStatusSimpleText('({})'.format(nonHistoricItemsCount)) currentSeasonImage = '' seasonLabel = '' if self.__ctx.currentSeason == SeasonType.SUMMER: currentSeasonImage = RES_ICONS.MAPS_ICONS_CUSTOMIZATION_ITEMS_POPOVER_SUMMER_BACK_LIST seasonLabel = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_INFOTYPE_MAPTYPE_SUMMER elif self.__ctx.currentSeason == SeasonType.DESERT: currentSeasonImage = RES_ICONS.MAPS_ICONS_CUSTOMIZATION_ITEMS_POPOVER_DESERT_BACK_LIST seasonLabel = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_INFOTYPE_MAPTYPE_DESERT elif self.__ctx.currentSeason == SeasonType.WINTER: currentSeasonImage = RES_ICONS.MAPS_ICONS_CUSTOMIZATION_ITEMS_POPOVER_WINTER_BACK_LIST seasonLabel = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_INFOTYPE_MAPTYPE_WINTER isClear = False clearMessage = '' if self._isNonHistoric and nonHistoricItemsCount == 0: isClear = True clearMessage = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_ITEMSPOPOVER_CLEAR_NONHISTORICMASSAGE elif isOutfitVisuallyEmpty(self.__ctx.currentOutfit): isClear = True clearMessage = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_ITEMSPOPOVER_CLEAR_MASSAGE title = text_styles.highTitle(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_ITEMSPOPOVER_TITLE_ITEMS, mapType=_ms(seasonLabel))) self.as_showClearMessageS(isClear, text_styles.main(clearMessage)) self.as_setHeaderDataS(_PopoverHeadersVO(title, checkBoxText, counterText, currentSeasonImage)._asdict())
def __setHeader(self): outfit = self.__ctx.mode.currentOutfit nonHistoricItems = [ intCD for intCD in outfit.items() if not self.__service.getItemByCD(intCD).isHistorical() ] nonHistoricItemsCount = len(nonHistoricItems) checkBoxLabel = R.strings.vehicle_customization.customization.itemsPopover.historicCheckBox.items checkBoxLabel = backport.text(checkBoxLabel()) counterLabel = text_styles.vehicleStatusSimpleText('({})'.format(nonHistoricItemsCount)) seasonName = SEASON_TYPE_TO_NAME[self.__ctx.season] seasonImage = R.images.gui.maps.icons.customization.items_popover.dyn('{}_back_list'.format(seasonName)) seasonImage = backport.image(seasonImage()) seasonLabel = R.strings.vehicle_customization.customization.infotype.mapType.dyn(seasonName) seasonLabel = backport.text(seasonLabel()) title = R.strings.vehicle_customization.customization.itemsPopover.title.items title = text_styles.highTitle(backport.text(title(), mapType=seasonLabel)) if self.__isNonHistoric and nonHistoricItemsCount == 0: isClear = True clearMessage = R.strings.vehicle_customization.customization.itemsPopover.clear.nonHistoricMassage clearMessage = backport.text(clearMessage()) elif isOutfitVisuallyEmpty(outfit): isClear = True clearMessage = R.strings.vehicle_customization.customization.itemsPopover.clear.message clearMessage = backport.text(clearMessage()) else: isClear = False clearMessage = '' self.as_showClearMessageS(isClear, text_styles.main(clearMessage)) headerVO = {'title': title, 'checkBoxText': checkBoxLabel, 'counterText': counterLabel, 'currentSeasonImage': seasonImage} self.as_setHeaderDataS(headerVO)
def makeEventBoardsTableViewStatusVO(title, tooltip, info, value1, value2, value3, showPoints, buttonLabel, buttonTooltip, buttonVisible, buttonEnabled, titleTooltip): buttonTop = not title result = { 'title': title, 'titleTooltip': tooltip, 'buttonLabel': buttonLabel, 'buttonTooltip': buttonTooltip, 'buttonVisible': buttonVisible, 'buttonEnabled': buttonEnabled, 'buttonTop': buttonTop, 'informationTooltip': titleTooltip } if showPoints: result.update({ 'info': text_styles.playerOnline(info), 'value1': text_styles.vehicleStatusSimpleText(getString(value1)), 'value2': text_styles.main(getString(value2)), 'value3': text_styles.main(getString(value3, '0')) }) return result
def _buildFrontSupplyItems(self): self._frontSupplyItems = [] if not self._wotPlusVehicles and self._isWotPlusRentEnabled() or self._isTelecomRentalsEnabled() and not self._telecomRentals.getAvailableRentCount() == 0: text = MENU.TANKCAROUSEL_WOTPLUSSELECTIONAVAILABLE if self._telecomRentals.getRentsPending(): text = MENU.TANKCAROUSEL_WOTPLUSSELECTIONPENDING self._frontSupplyItems.append({'isWotPlusSlot': True, 'infoText': text_styles.vehicleStatusInfoText(text), 'infoHoverText': text_styles.vehicleStatusInfoText(text), 'smallInfoText': text_styles.vehicleStatusSimpleText(text), 'icon': RES_ICONS.MAPS_ICONS_LIBRARY_TANKITEM_BUY_TANK, 'extraImage': RES_ICONS.MAPS_ICONS_LIBRARY_RENT_ICO_BIG, 'tooltip': TOOLTIPS.TANKS_CAROUSEL_WOT_PLUS_SLOT})
def __updateStyleLabel(self): label = '' tooltip = None if self.__ctx.mode.modeId == CustomizationModes.STYLED: showSpecialLabel = False counter = 0 for intCD in self._carouselDP.collection: item = self.service.getItemByCD(intCD) if item.itemTypeID != GUI_ITEM_TYPE.STYLE: break if item.canBeEditedForVehicle(g_currentVehicle.item.intCD): counter += 1 if counter > EDITABLE_STYLE_STORAGE_DEPTH: showSpecialLabel = True break if showSpecialLabel: storedStylesCount = len(self.service.getStoredStyleDiffs()) img = icons.makeImageTag( backport.image( R.images.gui.maps.icons.customization.edited_big())) label = text_styles.vehicleStatusSimpleText( backport.text( R.strings.vehicle_customization.savedStyles.label(), img=img, current=storedStylesCount, max=EDITABLE_STYLE_STORAGE_DEPTH)) tooltipHeader = text_styles.middleTitle( backport.text( R.strings.tooltips.customization.savedStyles.title(), img=img, current=storedStylesCount, max=EDITABLE_STYLE_STORAGE_DEPTH)) tooltipBody = text_styles.main( backport.text( R.strings.tooltips.customization.savedStyles.body(), max=EDITABLE_STYLE_STORAGE_DEPTH)) tooltip = makeTooltip(tooltipHeader, tooltipBody) else: label = text_styles.main( backport.text( R.strings.vehicle_customization.defaultStyle.label())) self.as_setCarouselInfoLabelDataS(label, tooltip) return
def __setHeader(self): outfit = self.__ctx.mode.currentOutfit nonHistoricItems = [ intCD for intCD in outfit.items() if self.__service.getItemByCD(intCD).customizationDisplayType() == CustomizationDisplayType.NON_HISTORICAL ] nonHistoricItemsCount = len(nonHistoricItems) fantasticalItems = [ intCD for intCD in outfit.items() if self.__service.getItemByCD(intCD).customizationDisplayType() == CustomizationDisplayType.FANTASTICAL ] fantasticalItemsCount = len(fantasticalItems) nonHistoricCheckBoxText = R.strings.vehicle_customization.customization.itemsPopover.historicCheckBox.items nonHistoricCheckBoxText = backport.text(nonHistoricCheckBoxText()) nonHistoricCounterText = text_styles.vehicleStatusSimpleText( '({})'.format(nonHistoricItemsCount)) fantasticalCheckBoxText = R.strings.vehicle_customization.customization.itemsPopover.fantasticalCheckBox.items fantasticalCheckBoxText = backport.text(fantasticalCheckBoxText()) fantasticalCounterText = text_styles.vehicleStatusSimpleText( '({})'.format(fantasticalItemsCount)) seasonName = SEASON_TYPE_TO_NAME[self.__ctx.season] seasonImage = R.images.gui.maps.icons.customization.items_popover.dyn( '{}_back_list'.format(seasonName)) seasonImage = backport.image(seasonImage()) seasonLabel = R.strings.vehicle_customization.customization.infotype.mapType.dyn( seasonName) seasonLabel = backport.text(seasonLabel()) title = R.strings.vehicle_customization.customization.itemsPopover.title.items title = text_styles.highTitle( backport.text(title(), mapType=seasonLabel)) if self.__isNonHistoric and nonHistoricItemsCount == 0: if self.__isFantastical and fantasticalItemsCount == 0: isClear = True clearMessage = R.strings.vehicle_customization.customization.itemsPopover.clear.nonHistoricFantasticalMessage clearMessage = backport.text(clearMessage()) elif not self.__isFantastical: isClear = True clearMessage = R.strings.vehicle_customization.customization.itemsPopover.clear.nonHistoricMessage clearMessage = backport.text(clearMessage()) else: isClear = False clearMessage = '' elif self.__isFantastical and fantasticalItemsCount == 0 and not self.__isNonHistoric: isClear = True clearMessage = R.strings.vehicle_customization.customization.itemsPopover.clear.fantasticalMessage clearMessage = backport.text(clearMessage()) elif isOutfitVisuallyEmpty(outfit): isClear = True clearMessage = R.strings.vehicle_customization.customization.itemsPopover.clear.message clearMessage = backport.text(clearMessage()) else: isClear = False clearMessage = '' self.as_showClearMessageS(isClear, text_styles.main(clearMessage)) headerVO = { 'title': title, 'nonHistoricCheckBoxText': nonHistoricCheckBoxText, 'nonHistoricCounterText': nonHistoricCounterText, 'fantasticalCheckBoxText': fantasticalCheckBoxText, 'fantasticalCounterText': fantasticalCounterText, 'currentSeasonImage': seasonImage } self.as_setHeaderDataS(headerVO)