def __setSeasonData(self, forceAnim=False):
        seasonRenderersList = []
        filledSeasonSlots = 0
        for season in SEASONS_ORDER:
            seasonName = SEASON_TYPE_TO_NAME.get(season)
            if self.__ctx.mode == C11nMode.CUSTOM:
                isFilled = self.__ctx.checkSlotsFillingForSeason(season)
            else:
                isFilled = self.__ctx.modifiedStyle is not None
            filledSeasonSlots += int(isFilled)
            seasonRenderersList.append({
                'nameText':
                VEHICLE_CUSTOMIZATION.getSeasonName(seasonName),
                'nameSelectedText':
                VEHICLE_CUSTOMIZATION.getSeasonSelectedName(seasonName),
                'seasonImageSrc':
                RES_ICONS.getSeasonImage(seasonName),
                'seasonBGImageSrc':
                RES_ICONS.getSeasonBGImage(seasonName),
                'seasonShineImageSrc':
                RES_ICONS.getSeasonShineImage(seasonName),
                'isFilled':
                isFilled,
                'forceAnim':
                forceAnim,
                'tooltip':
                makeTooltip(
                    body=VEHICLE_CUSTOMIZATION.getSheetSeasonName(seasonName))
            })

        self.as_setSeasonsBarDataS(seasonRenderersList)
        self._seasonSoundAnimantion.setFilledSeasonSlots(
            filledSeasonSlots, forceAnim)
        return
Esempio n. 2
0
    def __setSeasonData(self):
        seasonRenderersList = []
        for season in SEASONS_ORDER:
            seasonName = SEASON_TYPE_TO_NAME.get(season)
            seasonRenderersList.append({'seasonName': VEHICLE_CUSTOMIZATION.getSeasonName(seasonName),
                                        'seasonIconSmall': RES_ICONS.getSeasonIcon(seasonName)})

        self.as_setSeasonPanelDataS({'seasonRenderersList': seasonRenderersList})
    def _getData(self):
        seasonItemData = []
        allUnique = set()
        if self._item:
            for season in SEASONS_ORDER:
                seasonName = SEASON_TYPE_TO_NAME.get(season)
                seasonUnique = set()
                outfit = self._item.getOutfit(season)
                items = []
                for item in outfit.items():
                    if item.intCD not in seasonUnique:
                        items.append({
                            'image': item.icon,
                            'hasBonus': item.bonus is not None,
                            'isWide': item.isWide(),
                            'intCD': item.intCD
                        })
                    allUnique.add(item.intCD)
                    seasonUnique.add(item.intCD)

                seasonItemData.append({
                    'season':
                    text_styles.main(
                        VEHICLE_CUSTOMIZATION.getSeasonName(seasonName)),
                    'itemRendererVOs':
                    items
                })

        itemText = _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_POPOVER_STYLE_ITEMS)
        name = self._name
        desc = self._desc
        itemData = self._getItemData()
        if itemData is None:
            desc = text_styles.neutral(
                VEHICLE_CUSTOMIZATION.CUSTOMIZATION_POPOVER_EMPTYSTYLE_HINT)
            itemData = {
                'intCD':
                0,
                'icon':
                RES_ICONS.MAPS_ICONS_LIBRARY_TANKITEM_BUY_TANK_POPOVER_SMALL
            }
        showProlongationCB = False
        autoProlongationCBLabel = VEHICLE_CUSTOMIZATION.CUSTOMIZATION_POPOVER_STYLE_AUTOPROLONGATIONLABEL
        if self._item is not None and self._item.isRentable:
            showProlongationCB = True
        return StyleDataVO(name, desc, self._isEmpty, itemData, seasonItemData,
                           itemText, len(allUnique), showProlongationCB,
                           autoProlongationCBLabel,
                           g_currentVehicle.item.isAutoRentStyle).asDict()