Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InventorySlotWeaponSlotsUI.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
5 {
6  private static ResourceName m_sPrimaryWeaponSlot = "{CDE4B2BF08F5EA5F}UI/Textures/InventoryIcons/InvenorySlot-Primary_UI.edds";
7  private static ResourceName m_sSecondaryWeaponSlot = "{D08526F28B9ACAB9}UI/Textures/InventoryIcons/InvenorySlot-Secondary_UI.edds";
8  private static ResourceName m_sGrenadeWeaponSlot = "{E841B37EB8382114}UI/Textures/InventoryIcons/InvenorySlot-Grenade_UI.edds";
9 
10  protected string m_sWeaponSlotType;
11  protected ImageWidget m_wGamepadHintSmall;
12  protected ImageWidget m_wGamepadHintLarge;
13  protected int m_iWeaponSlotIndex;
14 
15  //------------------------------------------------------------------------ USER METHODS ----------------------------------------------------------------------
16 
17  //------------------------------------------------------------------------------------------------
18  override void Init()
19  {
20  super.Init();
21 
22  if (!m_pItem)
23  {
24  if (m_sWeaponSlotType == "primary")
25  SetIcon(m_sPrimaryWeaponSlot);
26  else if (m_sWeaponSlotType == "secondary")
27  SetIcon(m_sSecondaryWeaponSlot);
28  else if (m_sWeaponSlotType == "grenade")
29  SetIcon(m_sGrenadeWeaponSlot);
30  }
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  override string SetSlotSize()
35  {
36  ESlotSize slotSize;
37  string slotLayout = SLOT_LAYOUT_1x1;
38 
39  if (m_sWeaponSlotType == "primary")
40  slotSize = ESlotSize.SLOT_2x1;
41  else
42  slotSize = ESlotSize.SLOT_1x1;
43 
44  switch (slotSize)
45  {
46  case ESlotSize.SLOT_1x1: { slotLayout = SLOT_LAYOUT_1x1; m_iSizeX = 1; m_iSizeY = 1; } break;
47  case ESlotSize.SLOT_2x1: { slotLayout = SLOT_LAYOUT_2x1; m_iSizeX = 2; m_iSizeY = 1; } break;
48  }
49 
50  return slotLayout;
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  int GetWeaponSlotIndex()
55  {
56  return m_iWeaponSlotIndex;
57  }
58 
59  //------------------------------------------------------------------------ COMMON METHODS ----------------------------------------------------------------------
60 
61  //------------------------------------------------------------------------------------------------
62  void SCR_InventorySlotWeaponSlotsUI( InventoryItemComponent pComponent = null, SCR_InventoryStorageBaseUI pStorageUI = null, bool bVisible = true, int iSlotIndex = -1, SCR_ItemAttributeCollection pAttributes = null, int iWeaponSlotIndex = 0, string sWeaponSlotType = "" )
63  {
64  m_iQuickSlotIndex = iSlotIndex;
65  m_iWeaponSlotIndex = iWeaponSlotIndex;
66  m_sWeaponSlotType = sWeaponSlotType;
67  m_Attributes = pAttributes;
68  UpdateReferencedComponent( pComponent );
69  }
70 
71  //------------------------------------------------------------------------------------------------
73  {
74  }
75 };
m_Attributes
private SCR_ItemAttributeCollection m_Attributes
Definition: SCR_UniversalInventoryStorageComponent.c:23
SCR_InventorySlotWeaponSlotsUI
Definition: SCR_InventorySlotWeaponSlotsUI.c:4
SCR_InventoryStorageBaseUI
Definition: SCR_InventoryStorageBaseUI.c:6
m_iSizeY
int m_iSizeY
Definition: SCR_MapRTWBaseUI.c:6
ESlotSize
ESlotSize
Definition: InventoryConstants.c:1
InventoryItemComponent
Definition: InventoryItemComponent.c:12
SCR_ItemAttributeCollection
Definition: SCR_ItemAttributeCollection.c:2
m_iSizeX
int m_iSizeX
Definition: SCR_MapRTWBaseUI.c:3
SLOT_LAYOUT_1x1
const string SLOT_LAYOUT_1x1
Definition: SCR_InventorySlotUI.c:1
SCR_InventorySlotUI
Definition: SCR_InventorySlotUI.c:27
SLOT_LAYOUT_2x1
const string SLOT_LAYOUT_2x1
Definition: SCR_InventorySlotUI.c:2