Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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))]
9
10 [Attribute("2", UIWidgets.ComboBox, "Slot size", "", ParamEnumArray.FromEnum(ESlotID))]
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 [Attribute("1", UIWidgets.CheckBox, "Allows for the item to be refunded in arsenals (set to false for mission critical items)")]
23 protected bool m_bRefundable;
24
25 private ItemPhysicalAttributes m_PhysAttributes;
26
27 //------------------------------------------------------------------------------------------------
28 float GetVolume()
29 {
30 if (m_PhysAttributes != null)
31 {
32 return m_PhysAttributes.GetVolume();
33 }
34 return 0.0;
35 }
36
37
38 //------------------------------------------------------------------------------------------------
39 float GetWeight()
40 {
41 if (m_PhysAttributes != null)
42 {
43 return m_PhysAttributes.GetWeight();
44 }
45 return 0.0;
46 };
47
48 //------------------------------------------------------------------------------------------------
49 bool IsDraggable()
50 {
51 return m_bDraggable;
52 }
53
54 //------------------------------------------------------------------------------------------------
55 bool IsVisible(InventoryItemComponent inventoryItem)
56 {
57 return m_bVisible;
58 }
59
60 //------------------------------------------------------------------------------------------------
61 bool IsStackable()
62 {
63 return m_bStackable;
64 }
65
66 //------------------------------------------------------------------------------------------------
67 bool IsRefundable()
68 {
69 return m_bRefundable;
70 }
71
72 //------------------------------------------------------------------------------------------------
73 void SetSlotSize( ESlotSize slotSize )
74 {
75 m_Size = slotSize;
76 }
77
78 //------------------------------------------------------------------------------------------------
79 void SetDraggable(bool isDraggable)
80 {
81 m_bDraggable = isDraggable;
82 }
83
84 //------------------------------------------------------------------------------------------------
85 void SetRefundable(bool isRefundable)
86 {
87 m_bRefundable = isRefundable;
88 }
89
90 //------------------------------------------------------------------------------------------------
91 void SetSlotType( ESlotID slotID )
92 {
93 m_SlotType = slotID;
94 }
95
96 //------------------------------------------------------------------------------------------------
97 ESlotID GetSlotType() { return m_SlotType; }
98
99 //------------------------------------------------------------------------------------------------
100 int GetSlotSum()
101 {
102 int iRetVal = 0;
103 switch( m_Size )
104 {
105 case ESlotSize.SLOT_1x1: { iRetVal = 1; } break;
106 case ESlotSize.SLOT_2x1: { iRetVal = 2; } break;
107 case ESlotSize.SLOT_2x2: { iRetVal = 4; } break;
108 case ESlotSize.SLOT_3x3: { iRetVal = 9; } break;
109 }
110 return iRetVal;
111 }
112
113 //------------------------------------------------------------------------------------------------
115 ESlotSize GetItemSize()
116 {
117 return m_Size;
118 }
119
121 ESlotSize GetQuickSlotItemSize()
122 {
124 return GetItemSize();
125
126 return m_eQuickSlotSize;
127 }
128
129 override protected void OnInitCollection(IEntityComponentSource src)
130 {
131 m_PhysAttributes = ItemPhysicalAttributes.Cast(FindAttribute(ItemPhysicalAttributes));
132 }
133};
SCR_EQuickSlotSize
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_EEntitySpawnerSlotType GetSlotType()
bool IsVisible()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void OnInitCollection(IEntityComponentSource src)
SCR_FieldOfViewSettings Attribute