3 protected ref InventorySearchPredicate m_SearchPredicate;
6 override void HandlerAttached(Widget w)
8 super.HandlerAttached(w);
13 if (CreateSlots() == 0)
21 m_widget.FindAnyWidget(
"CategoryPanel").SetVisible(
false);
22 ActivateCloseStorageButton();
29 m_wItemStorage.SetVisible(
false);
30 m_wCapacityPercentageText.SetVisible(
false);
31 m_wWeightText.SetVisible(
false);
32 m_wCapacityDisplay.SetVisible(
false);
33 m_wWeightDisplay.SetVisible(
false);
36 protected override void SetPreviewItem()
40 protected override int CreateSlots()
42 array<IEntity> pItemsInStorage = {};
43 int count = GetRelevantItems(pItemsInStorage);
44 UpdateOwnedSlots(pItemsInStorage);
49 protected int GetRelevantItems(out notnull array<IEntity> items)
57 override bool IsTraversalAllowed()
62 override void Refresh()
70 if (CreateSlots() == 0)
79 protected void ActivateCloseStorageButton()
81 m_wCloseStorageButton = ButtonWidget.Cast(m_widget.FindAnyWidget(
"CloseStorageBtn"));
82 if (m_wCloseStorageButton)
84 m_wCloseStorageButton.SetVisible(
true);
89 nav.EnableCloseWithGamepad(
false);
90 nav.m_OnActivated.Insert(CloseStorage);
95 protected void CloseStorage()
102 BaseInventoryStorageComponent storage,
106 array<BaseInventoryStorageComponent> aTraverseStorage =
null,
107 InventorySearchPredicate searchPredicate =
null)
111 m_eSlotAreaType = slotID;
114 m_iMatrix =
new SCR_Matrix(m_iMaxColumns, m_iMaxRows);
115 m_iPageSize = m_iMaxRows * m_iMaxColumns;
125 super.HandlerAttached(w);
126 w.FindAnyWidget(
"CategoryPanel").SetVisible(
false);
141 BaseInventoryStorageComponent storage,
145 array<BaseInventoryStorageComponent> aTraverseStorage =
null)
149 m_eSlotAreaType = slotID;
152 m_iMatrix =
new SCR_Matrix(m_iMaxColumns, m_iMaxRows);
161 Widget wGrid = m_pStorageUI.GetStorageGrid();
162 m_widget =
GetGame().GetWorkspace().CreateWidgets(
"{F437ACE2BD5F11E1}UI/layouts/Menus/Inventory/InventoryItemSlot.layout", wGrid);
163 m_widget.AddHandler(
this);
168 return m_pStorageUI.OnDrop(slot);