def __applyCustomizationNewCounter(self, vehicle):
     if vehicle.isCustomizationEnabled(
     ) and not self.__bootcampCtrl.isInBootcamp():
         availableItemTypes = getItemTypesAvailableForVehicle()
         counter = vehicle.getC11nItemsNoveltyCounter(
             self.__itemsCache.items, itemTypes=availableItemTypes)
         serverSettings = self.__settingsCore.serverSettings
         progressiveItemsViewVisited = serverSettings.getOnceOnlyHintsSetting(
             OnceOnlyHints.C11N_PROGRESSION_VIEW_HINT)
         if not progressiveItemsViewVisited and self.__uiSpamController.shouldBeHidden(
                 OnceOnlyHints.C11N_PROGRESSION_VIEW_HINT):
             progressiveItemsViewVisited = True
             serverSettings.setOnceOnlyHintsSettings({
                 OnceOnlyHints.C11N_PROGRESSION_VIEW_HINT:
                 True,
                 OnceOnlyHints.C11N_EDITABLE_STYLES_HINT:
                 True,
                 OnceOnlyHints.C11N_PROGRESSION_REQUIRED_STYLES_HINT:
                 True
             })
         if not progressiveItemsViewVisited and isVehicleCanBeCustomized(
                 vehicle, GUI_ITEM_TYPE.PROJECTION_DECAL):
             counter += 1
         counter += getEditableStylesExtraNotificationCounter()
     else:
         counter = 0
     self.as_setCustomizationBtnCounterS(counter)
 def _onLoading(self, itemCD, vehicleCD, progressionLevel, showSecondButton):
     self.__item = self.__itemsCache.items.getItemByCD(itemCD)
     self.__vehicle = self.__itemsCache.items.getItemByCD(vehicleCD) if vehicleCD != UNBOUND_VEH_KEY else g_currentVehicle.item
     self.__level = progressionLevel
     self.__itemsInNeedToUpgrade = self.__getItemsInNeedToUpgrade()
     if self.__item is None:
         raise SoftException('invalid item: &s', itemCD)
     if self.__vehicle is None:
         raise SoftException('invalid vehicle: &s', vehicleCD)
     if self.__level > 1 and not self.__itemsInNeedToUpgrade and getItemInstalledCount(self.__item) > 0:
         self.__resetItemNovelty()
     isNewItem = self.__level == 1
     with self.viewModel.transaction() as model:
         model.setIsNewItem(isNewItem)
         showSecondButton = showSecondButton and isVehicleCanBeCustomized(self.__vehicle, GUI_ITEM_TYPE.STYLE, itemsFilter=lambda item: item.isProgressionRequiredCanBeEdited(self.__vehicle.intCD))
         if vehicleCD != UNBOUND_VEH_KEY:
             self.__setVehicleInfo(model)
         self.__setItemInfo(model)
         self.__setButtons(model, showSecondButton)
         self.__updateButtons(model=model)
     if isNewItem:
         eventName = SOUNDS.NEW_PROGRESSIVE_DECAL
     else:
         eventName = SOUNDS.PROGRESSIVE_DECAL_UPGRADE
     WWISE.WW_eventGlobal(eventName)
     WWISE.WW_setState(ProgressiveRewardSoundEvents.PROGRESSIVE_REWARD_VIEW_GROUP, ProgressiveRewardSoundEvents.PROGRESSIVE_REWARD_VIEW_ENTER)
     return
 def __isCustEnabledForActiveVehicle(self):
     currentVehicle = g_currentVehicle.item
     if currentVehicle is not None and currentVehicle.intCD != self.__vehicle.intCD:
         vehicle = currentVehicle
     else:
         vehicle = self.__vehicle
     return vehicle.isCustomizationEnabled() and isVehicleCanBeCustomized(
         vehicle, GUI_ITEM_TYPE.STYLE)
Beispiel #4
0
 def _updateButtons(self, _):
     isLocked = True
     if not currentHangarIsSteelHunter(
     ) and self.__vehicle is not None and self.__vehicle.isCustomizationEnabled(
     ):
         isLocked = self._entity.get('savedData', {}).get(
             'toStyle', False) and not isVehicleCanBeCustomized(
                 self.__vehicle, GUI_ITEM_TYPE.STYLE)
     self._updateButtonsState(lock=isLocked)
     return
Beispiel #5
0
 def __applyCustomizationNewCounter(self, vehicle):
     if vehicle.isCustomizationEnabled() and not self.bootcampCtrl.isInBootcamp():
         availableItemTypes = getItemTypesAvailableForVehicle()
         counter = vehicle.getC11nItemsNoveltyCounter(self.itemsCache.items, itemTypes=availableItemTypes)
         progressiveItemsViewVisited = self.settingsCore.serverSettings.getOnceOnlyHintsSetting(OnceOnlyHints.C11N_PROGRESSION_VIEW_HINT)
         if not progressiveItemsViewVisited and isVehicleCanBeCustomized(vehicle, GUI_ITEM_TYPE.PROJECTION_DECAL):
             counter += 1
         counter += getEditableStylesExtraNotificationCounter()
     else:
         counter = 0
     self.as_setCustomizationBtnCounterS(counter)
Beispiel #6
0
 def __getFilterMessage(self):
     selectedSlot = self.__ctx.mode.selectedSlot
     if selectedSlot is not None and selectedSlot.slotType == GUI_ITEM_TYPE.PROJECTION_DECAL:
         return backport.text(R.strings.vehicle_customization.carousel.
                              message.propertysheet())
     else:
         if g_currentVehicle.item.isProgressionDecalsOnly:
             if not isVehicleCanBeCustomized(
                     g_currentVehicle.item, GUI_ITEM_TYPE.PROJECTION_DECAL):
                 return backport.text(
                     R.strings.vehicle_customization.carousel.message.
                     noProgressionDecals())
         return backport.text(
             R.strings.vehicle_customization.carousel.message.description())
def getEditableStylesExtraNotificationCounter(styles=None, settingsCore=None):
    vehicle = g_currentVehicle.item
    serverSettings = settingsCore.serverSettings
    if not serverSettings.getOnceOnlyHintsSetting(OnceOnlyHints.C11N_EDITABLE_STYLES_HINT):
        itemsFilter = lambda item: item.isEditable
    elif not serverSettings.getOnceOnlyHintsSetting(OnceOnlyHints.C11N_PROGRESSION_REQUIRED_STYLES_HINT):
        itemsFilter = lambda item: item.isProgressionRequiredCanBeEdited(vehicle.intCD)
    else:
        return 0
    if styles is not None:
        if any(ifilter(itemsFilter, styles)):
            return 1
        return 0
    else:
        return 1 if isVehicleCanBeCustomized(vehicle, GUI_ITEM_TYPE.STYLE, itemsFilter=itemsFilter) else 0