def __updateProjectionDecalAnchorsVisability(self): formfactor = None item = self.__ctx.mode.selectedItem if item is not None: formfactor = item.formfactor visibleAnchors = defaultdict(set) outfit = self.__ctx.mode.currentOutfit for slotId in self.__processedAnchors: if isSlotFilled(outfit, slotId): isDisplayed = self.__menuSlotId != slotId self.changeAnchorParams(slotId, isDisplayed=isDisplayed, isAutoScalable=True) root = self.__closeGroups.find(slotId) if root is not None: visibleAnchors[root].add(slotId) continue if formfactor is not None: anchor = g_currentVehicle.item.getAnchorBySlotId( slotId.slotType, slotId.areaId, slotId.regionIdx) if anchor.isFitForFormfactor(formfactor): self.changeAnchorParams(slotId, isDisplayed=True, isAutoScalable=True, isCollidable=True) root = self.__closeGroups.find(slotId) if root is not None: visibleAnchors[root].add(slotId) continue self.changeAnchorParams(slotId, isDisplayed=False, isAutoScalable=False) self.__spreadAnchorsApart(visibleAnchors) return
def __updateRegionsAnchorsVisability(self): outfit = self.__ctx.mode.currentOutfit for slotId in self.__processedAnchors: isDisplayed = isSlotFilled(outfit, slotId) isAutoScalable = self.__menuSlotId != slotId self.changeAnchorParams(slotId, isDisplayed=isDisplayed, isAutoScalable=isAutoScalable)
def _installItem(self, intCD, slotId, season=None, component=None): outfit = self.currentOutfit if season is None else self._modifiedOutfits[season] if isItemsQuantityLimitReached(outfit, slotId.slotType) and not isSlotFilled(outfit, slotId): return False else: item = self._service.getItemByCD(intCD) component = component or self._getComponent(item, slotId) multiSlot = outfit.getContainer(slotId.areaId).slotFor(slotId.slotType) multiSlot.set(item.intCD, idx=slotId.regionIdx, component=component) return True
def updateState(self): outfit = self.__ctx.mode.getModifiedOutfit(self.__ctx.season) lock = isItemsQuantityLimitReached(outfit, self.slotId.slotType) if isSlotFilled(outfit, self.slotId): newState = UnselectedFilledState(self) elif lock: newState = LockedState(self) else: newState = UnselectedEmptyState(self) if self.stateID != newState.stateID: self.changeState(newState)