def _buildCustomizationItemData(item): return buildCustomizationItemDataVO(item, None, True, False, True, addExtraName=False)
def _carouseItemWrapper(self, itemCD): item = self.service.getItemByCD(itemCD) itemInventoryCount = self.__ctx.getItemInventoryCount(item) if item.itemTypeID == GUI_ITEM_TYPE.MODIFICATION: showUnsupportedAlert = not isRendererPipelineDeferred() else: showUnsupportedAlert = False isCurrentlyApplied = itemCD in self._carouselDP.getCurrentlyApplied() return buildCustomizationItemDataVO(item, itemInventoryCount, showUnsupportedAlert=showUnsupportedAlert, isCurrentlyApplied=isCurrentlyApplied)
def _carouseItemWrapper(self, itemCD): item = self.itemsCache.items.getItemByCD(itemCD) itemInventoryCount = self.getItemInventoryCount(item) if item.itemTypeID == GUI_ITEM_TYPE.MODIFICATION: showUnsupportedAlert = not self._isDeferredRenderer else: showUnsupportedAlert = False isCurrentlyApplied = itemCD in self._carouselDP.getCurrentlyApplied() return buildCustomizationItemDataVO(item, itemInventoryCount, showUnsupportedAlert=showUnsupportedAlert, isCurrentlyApplied=isCurrentlyApplied, plainView=True)
def _getItemData(base, self): if isinstance(self._c11nView, MainView): return base(self) rendererVO = None if self._item is not None: rendererVO = buildCustomizationItemDataVO( self._item, count=self._c11nView.getItemInventoryCount(self._item) if self._item.isRentable else None, plainView=True) # no bonus shall be displayed return rendererVO
def _getItemData(self): """ generates data for the carousel item renderer :return: carousel item renderer VO """ rendererVO = None if self._item is not None: rendererVO = buildCustomizationItemDataVO( self._item, count=self._c11nView.getItemInventoryCount(self._item) if self._item.isRentable else None) return rendererVO
def buildList(self, purchaseItems): self.clear() elementGroups = {group:[] for group in PURCHASE_GROUPS} elementSets = {group:[] for group in PURCHASE_GROUPS} purchaseItemsCopy = self._purchaseItems[:] while purchaseItemsCopy: element = purchaseItemsCopy[0] if element.isDismantling: purchaseItemsCopy.pop(0) continue def filterItems(otherElement): correctType = otherElement.item.intCD == element.item.intCD correctSeason = otherElement.group == element.group correctAction = otherElement.isFromInventory == element.isFromInventory and otherElement.isDismantling == element.isDismantling return correctSeason and correctType and correctAction matchedItems = filter(filterItems, purchaseItemsCopy) for delItem in matchedItems: purchaseItemsCopy.remove(delItem) quantity = len(matchedItems) if quantity == 1: itemName = element.item.userName else: itemName = '{} x{}'.format(element.item.userName, quantity) priceItem = {'id': element.item.intCD, 'selected': element.selected, 'itemImg': buildCustomizationItemDataVO(element.item, None, True, False, False), 'itemName': itemName, 'titleMode': False, 'compoundPrice': getItemPricesVO(element.price * quantity)[0], 'isFromStorage': element.isFromInventory} group = element.group elementGroups[group].append(priceItem) elementSets[group].append(matchedItems) self._list = [] self._purchaseItemSets = [] for group in PURCHASE_GROUPS: items = elementGroups[group] sets = elementSets[group] if items: title = _CUSTOMIZATION_SEASON_TITLES[group] self._list.append({'titleMode': True, 'titleText': _ms(text_styles.middleTitle(title))}) self._list.extend(items) self._purchaseItemSets.extend(sets) return
def _carouseItemWrapper(self, itemCD): item = self.service.getItemByCD(itemCD) inventoryCount = self.__ctx.mode.getItemInventoryCount(item) purchaseLimit = self.__ctx.mode.getPurchaseLimit(item) isApplied = itemCD in self._carouselDP.getAppliedItems() isBaseStyleItem = itemCD in self._carouselDP.getBaseStyleItems() if item.isStyleOnly or isBaseStyleItem: isDarked = isUsedUp = False else: isDarked = purchaseLimit <= 0 and inventoryCount <= 0 isUsedUp = isItemUsedUp(item) showEditableHint = False showEditBtnHint = False if self.__ctx.modeId == CustomizationModes.STYLED: autoRentEnabled = self.__ctx.mode.isAutoRentEnabled() if item.isProgressionRequired: showEditableHint = not bool( self.__serverSettings.getOnceOnlyHintsSetting( OnceOnlyHints.C11N_PROGRESSION_REQUIRED_STYLE_SLOT_HINT )) showEditBtnHint = not bool( self.__serverSettings.getOnceOnlyHintsSetting( OnceOnlyHints. C11N_PROGRESSION_REQUIRED_STYLE_SLOT_BUTTON_HINT)) elif item.isEditable: showEditableHint = not bool( self.__serverSettings.getOnceOnlyHintsSetting( OnceOnlyHints.C11N_EDITABLE_STYLE_SLOT_HINT)) showEditBtnHint = not bool( self.__serverSettings.getOnceOnlyHintsSetting( OnceOnlyHints.C11N_EDITABLE_STYLE_SLOT_BUTTON_HINT)) else: autoRentEnabled = False isChained, isUnsuitable = self._carouselDP.processDependentParams(item) return buildCustomizationItemDataVO(item=item, count=inventoryCount, isApplied=isApplied, isDarked=isDarked, isUsedUp=isUsedUp, autoRentEnabled=autoRentEnabled, vehicle=g_currentVehicle.item, showEditableHint=showEditableHint, showEditBtnHint=showEditBtnHint, isChained=isChained, isUnsuitable=isUnsuitable)
def _carouseItemWrapper(self, itemCD): item = self.service.getItemByCD(itemCD) itemInventoryCount = self.__ctx.getItemInventoryCount(item) purchaseLimit = self.__ctx.getPurchaseLimit(item) if item.itemTypeID == GUI_ITEM_TYPE.MODIFICATION: showUnsupportedAlert = not isRendererPipelineDeferred() else: showUnsupportedAlert = False isCurrentlyApplied = itemCD in self._carouselDP.getCurrentlyApplied() noPrice = item.buyCount <= 0 isDarked = purchaseLimit == 0 and itemInventoryCount == 0 isAlreadyUsed = isDarked and not isCurrentlyApplied return buildCustomizationItemDataVO( item, itemInventoryCount, showUnsupportedAlert=showUnsupportedAlert, isCurrentlyApplied=isCurrentlyApplied, isAlreadyUsed=isAlreadyUsed, forceLocked=isAlreadyUsed, isDarked=isDarked, noPrice=noPrice)
def _getItemData(self): rendererVO = None if self._item is not None: rendererVO = buildCustomizationItemDataVO(self._item, count=self._c11nView.getItemInventoryCount(self._item) if self._item.isRentable else None) return rendererVO