Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_EditorStruct.c
Go to the documentation of this file.
1
7/*
8[BaseContainerProps(), Obsolete("Only used for backwards compatiblity for GM saves. Will be removed entirely.")]
9class SCR_EditorStruct : SCR_JsonApiStruct
10{
11 [Attribute(desc: "Array of attributes evaluated during saving. Can include global as well as entity attributes.")]
12 protected ref SCR_EditorAttributeList m_AttributeList;
13
14 [Attribute("1", desc: "Enable to save the list of playable factions and their attributes.")]
15 protected bool m_bSaveFactions;
16
17 [Attribute("1", desc: "Enable to save scenario attributes like weather or time of day.")]
18 protected bool m_bSaveMissionAttributes;
19
20 [Attribute(uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(EEditableEntityFlag), desc: "When defined, only entities with *all* of these flags will be saved.\nLeave empty to save all interactive entities.")]
21 protected EEditableEntityFlag m_eRequiredEntityFlags;
22
23 //protected string m_sBuildVersion;
24 protected ref SCR_EditorMetaStruct m_Meta = new SCR_EditorMetaStruct();
25 protected ref array<ref SCR_EditableFactionStruct> m_aFactions = {};
26 protected ref array<ref SCR_EditableEntityStruct> m_aEntities = {};
27 protected ref array<ref SCR_EditorAttributeStruct> m_aAttributes = {};
28
29 override void Log()
30 {
31 Print("--- SCR_EditorStruct ------------------------");
32
33 m_Meta.Log();
34 SCR_EditableEntityStruct.LogEntities(m_aEntities, m_AttributeList);
35
36 if (m_bSaveFactions)
37 SCR_EditableFactionStruct.LogFactions(m_aFactions, m_AttributeList);
38
39 if (m_bSaveMissionAttributes)
40 SCR_EditorAttributeStruct.LogAttributes(m_aAttributes, m_AttributeList);
41
42 Print("---------------------------------------------");
43 }
44
45 override bool Serialize()
46 {
47 m_Meta.Serialize();
48 SCR_EditableEntityStruct.SerializeEntities(m_aEntities, m_AttributeList, m_eRequiredEntityFlags);
49
50 if (m_bSaveFactions)
51 SCR_EditableFactionStruct.SerializeFactions(m_aFactions, m_AttributeList);
52
53 if (m_bSaveMissionAttributes)
54 SCR_EditorAttributeStruct.SerializeAttributes(m_aAttributes, m_AttributeList, GetGame().GetGameMode());
55
56 Print("SUCCESS: SCR_EditorStruct.SaveEditor()", LogLevel.VERBOSE);
57 return true;
58 }
59
60 override bool Deserialize()
61 {
62 m_Meta.Deserialize();
63 SCR_EditableEntityStruct.DeserializeEntities(m_aEntities, m_AttributeList);
64
65 if (m_bSaveFactions)
66 SCR_EditableFactionStruct.DeserializeFactions(m_aFactions, m_AttributeList);
67
68 if (m_bSaveMissionAttributes)
69 SCR_EditorAttributeStruct.DeserializeAttributes(m_aAttributes, m_AttributeList, GetGame().GetGameMode());
70
71 Print("SUCCESS: SCR_EditorStruct.LoadEditor()", LogLevel.VERBOSE);
72 return true;
73 }
74
75 override void ClearCache()
76 {
77 m_Meta.ClearCache();
78 m_aEntities.Clear();
79
80 if (m_bSaveFactions)
81 m_aFactions.Clear();
82
83 if (m_bSaveMissionAttributes)
84 m_aAttributes.Clear();
85 }
86
87 void ResetEditor()
88 {
89 SCR_EditableEntityStruct.ClearEntities(m_aEntities);
90 }
91
92 void SCR_EditorStruct()
93 {
94 RegV("m_Meta");
95 RegV("m_aEntities");
96
97 if (m_bSaveFactions)
98 RegV("m_aFactions");
99
100 if (m_bSaveMissionAttributes)
101 RegV("m_aAttributes");
102 }
103};
104*/