public void Init(InventoryEquipmentModel model, CategoryManager categoryManager)
 {
     this.model           = model;
     this.categoryManager = categoryManager;
     categoryManager.InitAndDisableButtons(model.InventoryData, new InventoryCategoryManagerEventProxy());
     categoryManager.SetAllItemCount(model.InventoryData.Inventory.Count - model.HiddenItems.Count);
     categoryManager.EnableEquippedButton(model.InventoryData.CurrentAvatarEquipment.Count > 0);
     categoryManager.ShowHiddenButton(isVisible: false);
     setupListeners();
 }
Example #2
0
 private void setupModel()
 {
     model = new InventoryEquipmentModel();
     if (Service.Get <CPDataEntityCollection>().TryGetComponent <InventoryData>(Service.Get <CPDataEntityCollection>().LocalPlayerHandle, out var component))
     {
         model.SetInventory(component);
     }
     else
     {
         Log.LogError(this, "Unable to locate InventoryData object. This object should already exist as it is created in the home controller.");
     }
 }
Example #3
0
        public void Init(InventoryEquipmentModel model)
        {
            this.model          = model;
            templateDefinitions = Service.Get <GameData>().Get <Dictionary <int, TemplateDefinition> >();
            scrollRect          = editableItemController.GetComponentInChildren <ScrollRect>();
            itemImageBuilder    = ItemImageBuilder.acquire();
            categoryController  = new InventoryCategoryController();
            categoryController.Init(model, categoryManager);
            InventoryContext.EventBus.DispatchEvent(default(ClothingDesignerUIEvents.ShowAllTemplates));
            setupListeners();
            editableItemController.gameObject.SetActive(value: true);
            int size = model.DisplayedInventory.Count + 2;

            editableItemController.CreateEditableItemList(inventoryPrefabContentKey, size);
            IsInitialized = true;
        }
 public ModelCreated(InventoryEquipmentModel equipmentModel)
 {
     EquipmentModel = equipmentModel;
 }