Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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 };
m_aValues
SCR_BaseEditorAttributeEntryTimeSlider m_aValues
SCR_LoadoutBaseEditorAttribute
Definition: SCR_LoadoutBaseEditorAttribute.c:3
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_EArsenalItemType
SCR_EArsenalItemType
Definition: SCR_EArsenalItemType.c:2
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_EditorAttributeFloatStringValueHolder
Definition: SCR_BaseFloatValueHolderEditorAttribute.c:17
SCR_FactionLoadoutBaseEditorAttribute
Definition: SCR_FactionLoadoutBaseEditorAttribute.c:2
int
SCR_PossessingManagerComponentClass int
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