1 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"Layout for in-game editor. Works only with SCR_EditorBaseEntity!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
9 return m_EditableEntityUI;
17 [
Attribute(
"", UIWidgets.ResourceNamePicker,
"",
"layout")]
18 protected ResourceName m_AlwaysShownLayout;
20 [
Attribute(
"", UIWidgets.ResourceNamePicker,
"",
"layout")]
21 protected ResourceName m_HideableLayout;
23 protected Widget m_AlwaysShownWidget;
24 protected Widget m_HideableWidget;
35 return prefabData.GetEditableEntityUI();
46 bool GetCursorWorldPos(out vector worldPos, TraceFlags flags = -1)
58 IEntity GetTraceEntity()
66 override void EOnEditorPostActivate()
71 Print(
"SCR_MenuLayoutEditorComponent requires SCR_MenuEditorComponent!", LogLevel.ERROR);
78 WorkspaceWidget workspace =
GetGame().GetWorkspace();
79 if (!workspace)
return;
82 m_AlwaysShownWidget = workspace.CreateWidgets(m_AlwaysShownLayout, menuEditor.GetMenuComponent().GetAlwaysShownWidget());
83 FrameSlot.SetAnchorMin(m_AlwaysShownWidget, 0, 0);
84 FrameSlot.SetAnchorMax(m_AlwaysShownWidget, 1, 1);
85 FrameSlot.SetOffsets(m_AlwaysShownWidget, 0, 0, 0, 0);
87 m_HideableWidget = workspace.CreateWidgets(m_HideableLayout, menuEditor.GetMenuComponent().GetHideableWidget());
88 FrameSlot.SetAnchorMin(m_HideableWidget, 0, 0);
89 FrameSlot.SetAnchorMax(m_HideableWidget, 1, 1);
90 FrameSlot.SetOffsets(m_HideableWidget, 0, 0, 0, 0);
100 override void EOnEditorPostDeactivate()
102 if (m_AlwaysShownWidget)
104 m_AlwaysShownWidget.RemoveFromHierarchy();
105 m_AlwaysShownWidget =
null;
107 if (m_HideableWidget)
109 m_HideableWidget.RemoveFromHierarchy();
110 m_HideableWidget =
null;