1 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"GUI for in-game editor. Works only with SCR_EditorBaseEntity!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
10 [
Attribute(
desc:
"Menu created when the editor is opened.", defvalue:
"-1", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(
ChimeraMenuPreset))]
13 [
Attribute(
desc:
"Visibility status when the editor is opened.", defvalue:
"1")]
14 private bool m_bVisible;
16 [
Attribute(
desc:
"Is visibility of the menu preserved whent editor is closed and opened again?", defvalue:
"1")]
17 private bool m_bVisiblePersistent;
19 private bool m_bVisibleDefault;
22 private InputManager m_InputManager;
24 private ref ScriptInvoker Event_OnVisibilityChange =
new ScriptInvoker;
31 void SetVisible(
bool visible,
bool instant =
false)
75 return m_EditorMenuComponent;
81 ScriptInvoker GetOnVisibilityChange()
83 return Event_OnVisibilityChange;
86 protected void OnModeChange()
88 SetVisible(
true,
true);
92 override protected void EOnEditorPostActivate()
95 if (!m_bVisiblePersistent)
m_bVisible = m_bVisibleDefault;
101 MenuBase baseMenu =
GetGame().GetMenuManager().OpenMenu(menuPreset);
105 GetGame().GetMenuManager().CloseMenu(baseMenu);
106 Print(
"Editor menu is not type EditorMenuBase!", LogLevel.ERROR);
112 GetGame().GetMenuManager().CloseMenu(baseMenu);
113 Print(
"Editor menu root widget is missing SCR_MenuEditorUIComponent!", LogLevel.ERROR);
119 editorManager.GetOnModeChange().Insert(OnModeChange);
121 override protected void EOnEditorDeactivate()
125 editorManager.GetOnModeChange().Remove(OnModeChange);
127 override protected void EOnEditorClose()
129 if (m_EditorMenu)
GetGame().GetMenuManager().CloseMenu(m_EditorMenu);
132 if (hudManager) hudManager.SetVisible(
true);
134 override protected void EOnEditorActivate()
138 override protected void EOnEditorInit()
141 DiagMenu.RegisterMenu(
SCR_DebugMenuID.DEBUGUI_EDITOR_GUI,
"Editor GUI",
"Editor");