Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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
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};
EEditorModeFlag
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
static SCR_BaseEditorAttributeVar CreateVector(vector value)
ref array< ref SCR_EditorAttributeFloatStringValueHolder > m_aValues
Core component to manage SCR_EditorManagerEntity.
SCR_EditorSettingsEntity GetSettingsEntity()
EEditorMode GetBaseModes(EEditorModeFlag flags=-1, bool coreOnly=false)
int GetBaseModePrefabs(out notnull array< SCR_EditorModePrefab > outPrefabs, EEditorModeFlag flags=-1, bool coreOnly=false)
SCR_EditorModeUIInfo GetInfo()
bool GetBaseModes(out EEditorMode modes=0)
void SetBaseModes(EEditorMode modes, bool validate=true)
EEditorMode
Editor mode that defines overall functionality.
Definition EEditorMode.c:6