Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ItemAttributeCollection.c
Go to the documentation of this file.
3 {
4  [Attribute("2", UIWidgets.ComboBox, "Slot size", "", ParamEnumArray.FromEnum(ESlotSize))]
5  protected ESlotSize m_Size;
6 
7  [Attribute(SCR_EQuickSlotSize.DEFAULT.ToString(), desc: "Slot size when item is equipped in quickbar. Set default to keep original slot size", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(SCR_EQuickSlotSize))]
8  protected SCR_EQuickSlotSize m_eQuickSlotSize;
9 
10  [Attribute("2", UIWidgets.ComboBox, "Slot size", "", ParamEnumArray.FromEnum(ESlotID))]
11  protected ESlotID m_SlotType;
12 
13  [Attribute("1", UIWidgets.CheckBox, "Sets item movable by drag'n'drop")]
14  protected bool m_bDraggable;
15 
16  [Attribute("1", UIWidgets.CheckBox, "Sets item visible in inventory")]
17  protected bool m_bVisible;
18 
19  [Attribute("1", UIWidgets.CheckBox, "Sets item stackable in inventory")]
20  protected bool m_bStackable;
21 
22  private ItemPhysicalAttributes m_PhysAttributes;
23 
24  //------------------------------------------------------------------------------------------------
25  float GetVolume()
26  {
27  if (m_PhysAttributes != null)
28  {
29  return m_PhysAttributes.GetVolume();
30  }
31  return 0.0;
32  }
33 
34 
35  //------------------------------------------------------------------------------------------------
36  float GetWeight()
37  {
38  if (m_PhysAttributes != null)
39  {
40  return m_PhysAttributes.GetWeight();
41  }
42  return 0.0;
43  };
44 
45  //------------------------------------------------------------------------------------------------
46  bool IsDraggable()
47  {
48  return m_bDraggable;
49  }
50 
51  //------------------------------------------------------------------------------------------------
52  bool IsVisible()
53  {
54  return m_bVisible;
55  }
56 
57  //------------------------------------------------------------------------------------------------
58  bool IsStackable()
59  {
60  return m_bStackable;
61  }
62 
63  //------------------------------------------------------------------------------------------------
64  void SetSlotSize( ESlotSize slotSize )
65  {
66  m_Size = slotSize;
67  }
68 
69  //------------------------------------------------------------------------------------------------
70  void SetDraggable(bool isDraggable)
71  {
72  m_bDraggable = isDraggable;
73  }
74 
75  //------------------------------------------------------------------------------------------------
76  void SetSlotType( ESlotID slotID )
77  {
78  m_SlotType = slotID;
79  }
80 
81  //------------------------------------------------------------------------------------------------
82  ESlotID GetSlotType() { return m_SlotType; }
83 
84  //------------------------------------------------------------------------------------------------
85  int GetSlotSum()
86  {
87  int iRetVal = 0;
88  switch( m_Size )
89  {
90  case ESlotSize.SLOT_1x1: { iRetVal = 1; } break;
91  case ESlotSize.SLOT_2x1: { iRetVal = 2; } break;
92  case ESlotSize.SLOT_2x2: { iRetVal = 4; } break;
93  case ESlotSize.SLOT_3x3: { iRetVal = 9; } break;
94  }
95  return iRetVal;
96  }
97 
98  //------------------------------------------------------------------------------------------------
100  ESlotSize GetItemSize()
101  {
102  return m_Size;
103  }
104 
106  ESlotSize GetQuickSlotItemSize()
107  {
108  if (m_eQuickSlotSize == SCR_EQuickSlotSize.DEFAULT)
109  return GetItemSize();
110 
111  return m_eQuickSlotSize;
112  }
113 
114  override protected void OnInitCollection(IEntityComponentSource src)
115  {
116  m_PhysAttributes = ItemPhysicalAttributes.Cast(FindAttribute(ItemPhysicalAttributes));
117  }
118 };
ESlotID
ESlotID
Definition: InventoryConstants.c:14
ItemAttributeCollection
Definition: ItemAttributeCollection.c:12
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EQuickSlotSize
SCR_EQuickSlotSize
Definition: InventoryConstants.c:9
ESlotSize
ESlotSize
Definition: InventoryConstants.c:1
ItemPhysicalAttributes
Definition: ItemPhysicalAttributes.c:12
SCR_ItemAttributeCollection
Definition: SCR_ItemAttributeCollection.c:2
m_bVisible
protected bool m_bVisible
Definition: SCR_UITaskManagerComponent.c:28
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468