Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorStruct.c
Go to the documentation of this file.
1 
9 {
10  [Attribute(desc: "Array of attributes evaluated during saving. Can include global as well as entity attributes.")]
11  protected ref SCR_EditorAttributeList m_AttributeList;
12 
13  [Attribute("1", desc: "Enable to save the list of playable factions and their attributes.")]
14  protected bool m_bSaveFactions;
15 
16  [Attribute("1", desc: "Enable to save scenario attributes like weather or time of day.")]
17  protected bool m_bSaveMissionAttributes;
18 
19  [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.")]
20  protected EEditableEntityFlag m_eRequiredEntityFlags;
21 
22  //protected string m_sBuildVersion;
23  protected ref SCR_EditorMetaStruct m_Meta = new SCR_EditorMetaStruct();
24  protected ref array<ref SCR_EditableFactionStruct> m_aFactions = {};
25  protected ref array<ref SCR_EditableEntityStruct> m_aEntities = {};
26  protected ref array<ref SCR_EditorAttributeStruct> m_aAttributes = {};
27 
31  override void Log()
32  {
33  Print("--- SCR_EditorStruct ------------------------");
34 
35  m_Meta.Log();
36  SCR_EditableEntityStruct.LogEntities(m_aEntities, m_AttributeList);
37 
38  if (m_bSaveFactions)
39  SCR_EditableFactionStruct.LogFactions(m_aFactions, m_AttributeList);
40 
41  if (m_bSaveMissionAttributes)
42  SCR_EditorAttributeStruct.LogAttributes(m_aAttributes, m_AttributeList);
43 
44  Print("---------------------------------------------");
45  }
49  override bool Serialize()
50  {
51  m_Meta.Serialize();
52  SCR_EditableEntityStruct.SerializeEntities(m_aEntities, m_AttributeList, m_eRequiredEntityFlags);
53 
54  if (m_bSaveFactions)
55  SCR_EditableFactionStruct.SerializeFactions(m_aFactions, m_AttributeList);
56 
57  if (m_bSaveMissionAttributes)
58  SCR_EditorAttributeStruct.SerializeAttributes(m_aAttributes, m_AttributeList, GetGame().GetGameMode());
59 
60  Print("SUCCESS: SCR_EditorStruct.SaveEditor()", LogLevel.VERBOSE);
61  return true;
62  }
66  override bool Deserialize()
67  {
68  m_Meta.Deserialize();
69  SCR_EditableEntityStruct.DeserializeEntities(m_aEntities, m_AttributeList);
70 
71  if (m_bSaveFactions)
72  SCR_EditableFactionStruct.DeserializeFactions(m_aFactions, m_AttributeList);
73 
74  if (m_bSaveMissionAttributes)
75  SCR_EditorAttributeStruct.DeserializeAttributes(m_aAttributes, m_AttributeList, GetGame().GetGameMode());
76 
77  Print("SUCCESS: SCR_EditorStruct.LoadEditor()", LogLevel.VERBOSE);
78  return true;
79  }
83  override void ClearCache()
84  {
85  m_Meta.ClearCache();
86  m_aEntities.Clear();
87 
88  if (m_bSaveFactions)
89  m_aFactions.Clear();
90 
91  if (m_bSaveMissionAttributes)
92  m_aAttributes.Clear();
93  }
97  void ResetEditor()
98  {
99  SCR_EditableEntityStruct.ClearEntities(m_aEntities);
100  }
101  void SCR_EditorStruct()
102  {
103  RegV("m_Meta");
104  RegV("m_aEntities");
105 
106  if (m_bSaveFactions)
107  RegV("m_aFactions");
108 
109  if (m_bSaveMissionAttributes)
110  RegV("m_aAttributes");
111  }
112 };
EEditableEntityFlag
EEditableEntityFlag
Unique flags of the entity.
Definition: EEditableEntityFlag.c:5
SCR_EditorMetaStruct
Definition: SCR_EditorMetaStruct.c:6
SCR_EditableFactionStruct
Definition: SCR_EditableFactionStruct.c:1
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_EditorStruct
Definition: SCR_EditorStruct.c:8
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditorAttributeList
Definition: SCR_EditorAttributeConfig.c:2
SCR_EditableEntityStruct
Definition: SCR_EditableEntityStruct.c:6
SCR_EditorAttributeStruct
Definition: SCR_EditorAttributeStruct.c:6
SCR_JsonApiStruct
Definition: SCR_JsonApiStruct.c:5
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