Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorSettingsEntity.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Editor", description: "World settings for the editor", color: "251 91 0 255", icon: "WBData/EntityEditorProps/entityEditor.png")]
3 {
4 };
5 
13 {
14  [Attribute(uiwidget: UIWidgets.ResourceNamePicker, desc: "Individual editor manager", params: "et", category: "Editor Settings")]
15  protected ResourceName m_EditorManagerPrefab;
16 
17  [Attribute(desc: "True to disable the editor completely.\nFOR DEVELOPMENT PURPOSES ONLY!", category: "Editor Settings")]
18  protected bool m_bDisableEditor;
19 
20  [Attribute(desc: "When enabled, using the editor in this scenario is a legal operation, part of game rules.\nFor example this is enabled in Game Master scenarios which are about GM building the gameplay,\nbut it's disabled in Conflict where only admin can access the editor.", category: "Editor Settings")]
21  protected bool m_bIsUnlimitedEditorLegal;
22 
23  [Attribute(desc: "When enabled, each player will receive editor modes defined by 'Base Modes' attribute instead of the modes defined in core config.", category: "Editor Settings")]
24  protected bool m_bOverrideBaseModes;
25 
26  [Attribute("0", UIWidgets.Flags, "Editor modes added to every pllayer when they connect.", enums: ParamEnumArray.FromEnum(EEditorMode), category: "Editor Settings")]
27  protected EEditorMode m_BaseModes;
28 
32  static SCR_EditorSettingsEntity GetInstance()
33  {
35  if (core)
36  return core.GetSettingsEntity();
37  else
38  return null;
39  }
40 
46  ResourceName GetPrefab(ResourceName basePrefab)
47  {
48  if (m_EditorManagerPrefab.IsEmpty()) return basePrefab;
49  return m_EditorManagerPrefab;
50  }
51 
57  bool IsEditorDisabled()
58  {
59  return m_bDisableEditor;
60  }
61 
68  bool IsUnlimitedEditorLegal()
69  {
70  return m_bIsUnlimitedEditorLegal;
71  }
72 
77  void EnableBaseOverride(bool value)
78  {
79  m_bOverrideBaseModes = value;
80  }
85  bool IsBaseOverrideEnabled()
86  {
87  return m_bOverrideBaseModes;
88  }
94  bool GetBaseModes(out EEditorMode modes = 0)
95  {
96  modes = m_BaseModes;
97  return m_bOverrideBaseModes;
98  }
104  void SetBaseModes(EEditorMode modes, bool validate = true)
105  {
106  m_BaseModes = modes;
107 
108  //--- Validate all existing editor modes
109  if (validate)
110  {
112  if (core)
113  {
114  array<SCR_EditorManagerEntity> editorManagers = {};
115  core.GetEditorEntities(editorManagers);
116  foreach (SCR_EditorManagerEntity editorManager: editorManagers)
117  {
118  editorManager.SetEditorModes(EEditorModeAccess.BASE, m_BaseModes, false);
119  }
120  }
121  }
122  }
123 
124  void SCR_EditorSettingsEntity(IEntitySource src, IEntity parent)
125  {
127  if (core) core.SetSettingsEntity(this);
128  }
129 };
SCR_EditorBaseEntityClass
Definition: SCR_EditorBaseEntity.c:2
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
EEditorModeAccess
EEditorModeAccess
Definition: EEditorModeAccess.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_EditorSettingsEntity
Definition: SCR_EditorSettingsEntity.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition: SCR_EditorManagerCore.c:5
EEditorMode
EEditorMode
Editor mode that defines overall functionality.
Definition: EEditorMode.c:5
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_EditorBaseEntity
Definition: SCR_EditorBaseEntity.c:14
SCR_EditorSettingsEntityClass
Definition: SCR_EditorSettingsEntity.c:2
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26