27 if (
m_aSlots.IsEmpty() || iSlotIndex == -1 )
34 if ( iSlotIndex >
m_aSlots.Count() - 1 )
49 if ( fWheelValue == 0 )
55 if ( fWheelValue == 1 )
116 pSlot.SetSlotVisible(
false );
124 int count = pItemsInStorage.Count();
126 count =
Math.Min(count, 3);
130 for (
int i =
m_aSlots.Count() - count; i > 0; i--)
140 for (
int i = 0; i < count; i++)
144 m_aSlots[i].UpdateReferencedComponent(pComponent);
153 override protected void GetAllItems( out notnull array<IEntity> pItemsInStorage, BaseInventoryStorageComponent pStorage = null )
158 array<ref SCR_QuickslotBaseContainer> quickslots =
m_InventoryStorage.GetQuickSlotItems();
163 pItemsInStorage.Clear();
168 if (!entityContainer)
170 pItemsInStorage.Insert(null);
174 pItemsInStorage.Insert(entityContainer.GetEntity());
184 array<IEntity> itemsInStorage = {};
195 array<int> aCoordinates;
196 int iWidgetColumnSize, iWidgetRowSize;
197 const int iPageCounter = 0;
198 int iRelativeOffset = 0;
207 Widget w = pSlot.GetWidget();
211 iWidgetColumnSize = pSlot.GetColumnSize();
212 iWidgetRowSize = pSlot.GetRowSize();
214 int iCol = pSlot.GetSlotIndex() + iRelativeOffset;
215 m_iMatrix.ReservePlace( iWidgetColumnSize, iWidgetRowSize, iCol, 0 );
217 iRelativeOffset += ( iWidgetColumnSize - 1 );
219 pSlot.SetPage( iPageCounter );
221 GridSlot.SetColumnSpan( w, iWidgetColumnSize );
222 GridSlot.SetRowSpan( w, iWidgetRowSize );
235 if (!storageComponent)
245 Widget w = pSlot.GetWidget();
250 if (pSlot.GetSlotIndex() > 3)
253 if (!quickslotContainer)
265 if (!pSlot.GetInventoryItemComponent())
279 int iWidgetColumnSize, iWidgetRowSize;
280 int iRelativeOffset = 0;
294 pAttrib.SetSlotType(
ESlotID.SLOT_ANY );
295 pAttrib.SetSlotSize( eSlotSize );
299 Widget w = pSlot.GetWidget();
303 iWidgetColumnSize = pSlot.GetColumnSize();
304 iWidgetRowSize = pSlot.GetRowSize();
306 int iCol = i + iRelativeOffset;
307 m_iMatrix.ReservePlace( iWidgetColumnSize, iWidgetRowSize, iCol, 0 );
313 pSlot.SetSlotVisible(
false);
318 iRelativeOffset += iWidgetColumnSize - 1;
322 GridSlot.SetColumnSpan( w, iWidgetColumnSize );
323 GridSlot.SetRowSpan( w, iWidgetRowSize );
353 if (isClosingQuickSlots)
383 if (!characterController)
386 SCR_InventoryStorageManagerComponent storageManager = SCR_InventoryStorageManagerComponent.Cast(characterController.GetInventoryStorageManager());
391 if (!characterStorage)
394 array<ref SCR_QuickslotBaseContainer> quickslotItems = {};
423 foreach (
int i,
IEntity item : items)
425 if (item != currentItem)
478 m_aSlots[
index].UpdateReferencedComponent(itemComp, attributes);
488 for (
int id = 0;
id < slotCount; ++
id)
526 m_wGrid.SetRowFillWeight(y, 1);
529 m_wGrid.SetColumnFillWeight(x, 1);
570 super.HandlerAttached( w );
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_QuickslotEntityContainer(IEntity entity)
proto external Managed FindComponent(typename typeName)
array< ref SCR_QuickslotBaseContainer > GetQuickSlotItems()
SCR_QuickslotBaseContainer GetContainerFromQuickslot(int index)
InventoryItemComponent GetInventoryItemComponent()
SCR_InventorySlotUI m_pSelectedSlot
SCR_CharacterInventoryStorageComponent m_InventoryStorage
ref array< SCR_InventorySlotUI > m_aSlots
LoadoutAreaType m_eSlotAreaType
void CreateEmptyLayout(bool recreate=false)
InputManager m_pInputManager
ChimeraCharacter m_Player
SCR_InventoryMenuUI m_MenuHandler
void SCR_InventoryStorageBaseUI(BaseInventoryStorageComponent storage, LoadoutAreaType slotID=null, SCR_InventoryMenuUI menuManager=null, int iPage=0, array< BaseInventoryStorageComponent > aTraverseStorage=null)
InventoryItemComponent GetItemComponentFromEntity(IEntity pEntity)
BaseInventoryStorageComponent m_Storage
SCR_InventorySlotQuickSlotUI CreateSlotUI(InventoryItemComponent pComponent, int iSlotIndex, SCR_ItemAttributeCollection pAttributes=null)
override void SetRowsAndColumns()
static int s_iInitSelectedSlotIndex
void UseSelectedQuickslot()
int GetLastSelectedSlotIndex()
override void HandlerAttached(Widget w)
static int s_iLastSelectedSlotIndex
void UpdateOwnedSlots(notnull array< IEntity > pItemsInStorage)
void HighlightLastSelectedSlot()
ResourceName m_sGamepadIcons
void SelectSlot(float fWheelValue)
void GetAllItems(out notnull array< IEntity > pItemsInStorage, BaseInventoryStorageComponent pStorage=null)
override void InitPaging()
bool UseItemInSlot(bool isClosingQuickSlots)
void SCR_InventoryStorageQuickSlotsUI(BaseInventoryStorageComponent storage, LoadoutAreaType slotID=null, SCR_InventoryMenuUI menuManager=null, int iPage=0, array< BaseInventoryStorageComponent > aTraverseStorage=null)
ResourceName GetGamepadIcons()
override void RefreshSlot(int index)
override void FillWithEmptySlots()
InventoryItemComponent GetCurrentSlotItem()
void SetInitialQuickSlot()
void SetItem(InventoryItemComponent pInventoryComponent, int iSlotIndex)
SCR_InventorySlotUI m_pLastSelectedSlot
void SelectSlot(int iSlotIndex)
static const float s_fDisabledOpacity
static bool s_bQuickBarClosed
static const float s_fEnabledOpacity
void CheckIfQuickSlotActionsAvailable(IEntity player)
void HighlightSlot(int iSlotIndex, bool bHighlight)
int GetActualSlotsUsedCount()
SCR_QuickslotBaseContainer is intended to be used for quickslots, to allow quickslotting of non-item ...
void ActivateContainer()
Gets called when the quickslot with this container is activated.
bool IsQuickslotActionAvailable()
returns true if the containers action can be performed