Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FactionLoadoutBaseEditorAttribute.c
Go to the documentation of this file.
3{
4 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5 {
6 //~Todo: Disabled for now
7 return null;
8
9 SCR_EditableFactionComponent editableFaction = SCR_EditableFactionComponent.Cast(item);
10 if (!editableFaction)
11 return null;
12
13 return SCR_BaseEditorAttributeVar.CreateInt(editableFaction.GetAllowedArsenalItemTypes());
14 }
15
16 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
17 {
18 if (!var)
19 return;
20
21 SCR_EditableFactionComponent editableFaction = SCR_EditableFactionComponent.Cast(item);
22 if (!editableFaction)
23 return;
24
25 //Get the current and add/remove flags as all arsenal attributes edit the same enum and would otherwise override itself
26 SCR_EArsenalItemType loadOutFlags = editableFaction.GetAllowedArsenalItemTypes();
27
28 int newArsenalflags = var.GetInt();
29
31 {
32 //Check if flag is true or not
33 if (newArsenalflags & (int)value.GetFloatValue())
34 loadOutFlags |= (int)value.GetFloatValue();
35 else
36 loadOutFlags &= ~(int)value.GetFloatValue();
37 }
38
39 //Update the arsenal
40 editableFaction.SetAllowedArsenalItemTypes(loadOutFlags);
41 }
42
43};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_BaseEditorAttributeEntryTimeSlider m_aValues
SCR_EArsenalItemType
static SCR_BaseEditorAttributeVar CreateInt(int value)
Definition int.c:13