Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ModesEditorAttribute.c
Go to the documentation of this file.
1 
6 {
7  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
8  {
9  if (!item.IsInherited(BaseGameMode))
10  return null;
11 
12  //--- Global modes, influences which modes will players have access to upon connecting
14  if (!core)
15  return null;
16 
17  SCR_EditorSettingsEntity editorSettings = core.GetSettingsEntity();
18  if (!editorSettings)
19  return null;
20 
21  //--- Select overridden base modes. If there is no override, select modes added by default to everyone.
22  EEditorMode modes;
23  if (!editorSettings.GetBaseModes(modes))
24  modes = core.GetBaseModes(EEditorModeFlag.DEFAULT);
25 
26  super.ReadVariable(item, manager);
27  SetFlags(modes);
28 
29  return SCR_BaseEditorAttributeVar.CreateVector(GetFlagVector());
30  }
31 
32  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
33  {
34  if (!var)
35  return;
36 
37  super.WriteVariable(item, var, manager, playerID);
38 
39  //--- Global modes
41  if (!core)
42  return;
43 
44  SCR_EditorSettingsEntity editorSettings = core.GetSettingsEntity();
45  if (!editorSettings)
46  return;
47 
48  editorSettings.SetBaseModes(GetFlags(0));
49  }
50 
51  protected override void CreatePresets()
52  {
54  if (!core) return;
55 
56  m_aValues.Clear();
57 
59  SCR_SortedArray<SCR_EditorModePrefab> modePrefabs = new SCR_SortedArray<SCR_EditorModePrefab>;
60  for (int i, count = core.GetBaseModePrefabs(modePrefabs, EEditorModeFlag.EDITABLE, true); i < count; i++)
61  {
62  mode = modePrefabs[i];
64  value.SetWithUIInfo(mode.GetInfo(), mode.GetMode());
65  m_aValues.Insert(value);
66  }
67  }
68 };
GetFlags
int GetFlags(out array< SCR_FlagComponent > flags)
Definition: SCR_MilitaryBaseComponent.c:428
m_aValues
SCR_BaseEditorAttributeEntryTimeSlider m_aValues
SCR_EditorSettingsEntity
Definition: SCR_EditorSettingsEntity.c:12
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition: SCR_EditorManagerCore.c:5
SCR_BaseMultiSelectPresetsEditorAttribute
Definition: SCR_BaseMultiSelectPresetsEditorAttribute.c:4
SCR_ModesEditorAttribute
Definition: SCR_ModesEditorAttribute.c:5
EEditorModeFlag
EEditorModeFlag
Definition: EEditorModeFlag.c:1
EEditorMode
EEditorMode
Editor mode that defines overall functionality.
Definition: EEditorMode.c:5
SCR_EditorAttributeFloatStringValueHolder
Definition: SCR_BaseFloatValueHolderEditorAttribute.c:17
SCR_EditorModePrefab
Definition: SCR_EditorManagerEntity.c:1888
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