Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InventoryStorageGadgetsUI.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
5 {
6 
7 
8 
9  //------------------------------------------------------------------------ USER METHODS ------------------------------------------------------------------------
10 
11  //------------------------------------------------------------------------------------------------
12  // ! creates the slot
13  override SCR_InventorySlotUI CreateSlotUI( InventoryItemComponent pComponent, SCR_ItemAttributeCollection pAttributes = null )
14  {
15  return SCR_InventorySlotGadgetUI( pComponent, this ); //creates the slot
16  }
17 
18 
19  //------------------------------------------------------------------------------------------------
20  // !
21  override int CreateSlots( )
22  {
23  array<IEntity> pItemsInStorage = new array<IEntity>();
24  GetAllItems( pItemsInStorage );
25 
26  if( !pItemsInStorage )
27  return -1;
28 
29  foreach ( IEntity pItem: pItemsInStorage )
30  {
31  InventoryItemComponent pComponent = GetItemComponentFromEntity( pItem );
32  if( pComponent )
33  m_aSlots.Insert( CreateSlotUI( pComponent ) );
34  }
35  return m_aSlots.Count()-1;
36  }
37 
38  //------------------------------------------------------------------------ COMMON METHODS ----------------------------------------------------------------------
39 
40  //------------------------------------------------------------------------------------------------
41  override void HandlerAttached( Widget w )
42  {
43  super.HandlerAttached( w );
44 
45  CreateEmptyLayout();
46  CreateSlots();
47  SortSlots();
48  }
49 
50 
51  //------------------------------------------------------------------------------------------------
52  void SCR_InventoryStorageGadgetsUI( BaseInventoryStorageComponent storage, LoadoutAreaType slotID = null, SCR_InventoryMenuUI menuManager = null, int iPage = 0, array<BaseInventoryStorageComponent> aTraverseStorage = null )
53  {
54  //TODO: make consistent the visibility of variable ( SetSlotID vs m_iMaxRows )
55  SetSlotAreaType( slotID );
56  m_MenuHandler = menuManager;
57  m_iMaxRows = 1;
58  m_iMaxColumns = 6;
59  m_iMatrix = new SCR_Matrix( m_iMaxColumns, m_iMaxRows );
60  m_sGridPath = "GadgetGrid";
61  m_Storage = storage;
62  }
63 
64  //------------------------------------------------------------------------------------------------
66  {
67  }
68 };
SCR_InventoryStorageGadgetsUI
Definition: SCR_InventoryStorageGadgetsUI.c:4
SCR_InventoryStorageBaseUI
Definition: SCR_InventoryStorageBaseUI.c:6
SCR_InventorySlotGadgetUI
Definition: SCR_InventorySlotGadgetUI.c:6
m_aSlots
protected ref array< SCR_WeaponRackSlotEntity > m_aSlots
Definition: SCR_ArsenalDisplayComponent.c:13
SCR_InventoryMenuUI
Definition: SCR_InventoryMenuUI.c:247
InventoryItemComponent
Definition: InventoryItemComponent.c:12
SCR_ItemAttributeCollection
Definition: SCR_ItemAttributeCollection.c:2
SCR_Matrix
Definition: SCR_Matrix.c:2
LoadoutAreaType
Definition: LoadoutAreaType.c:12
m_MenuHandler
SCR_DeployMenuBase m_MenuHandler
Main deploy menu with the map present.
SCR_InventorySlotUI
Definition: SCR_InventorySlotUI.c:27
m_Storage
BaseInventoryStorageComponent m_Storage
Definition: SCR_TourniquetStorageComponent.c:10