Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MenuLayoutEditorComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Editor", description: "Layout for in-game editor. Works only with SCR_EditorBaseEntity!", icon: "WBData/ComponentEditorProps/componentEditor.png")]
12
16{
17 [Attribute("", UIWidgets.ResourceNamePicker, "", "layout")]
19
20 [Attribute("", UIWidgets.ResourceNamePicker, "", "layout")]
22
26
32 {
34 if (prefabData)
35 return prefabData.GetEditableEntityUI();
36 else
37 return null;
38 }
39
46 bool GetCursorWorldPos(out vector worldPos, TraceFlags flags = -1)
47 {
49 return m_CursorComponent.GetCursorWorldPos(worldPos, flags: flags);
50 else
51 return false;
52 }
53
59 {
61 return m_CursorComponent.GetTraceEntity();
62 else
63 return null;
64 }
65
66 override void EOnEditorPostActivate()
67 {
69 if (!menuEditor)
70 {
71 Print("SCR_MenuLayoutEditorComponent requires SCR_MenuEditorComponent!", LogLevel.ERROR);
72 return;
73 }
74
75 EditorMenuBase menu = menuEditor.GetMenu();
76 if (!menu) return;
77
78 WorkspaceWidget workspace = GetGame().GetWorkspace();
79 if (!workspace) return;
80
81 //--- Find widget which is parent for hiding - layout will be created under it, so it's hidden as well
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);
86
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);
91
92 //--- Get cursor component
93 m_CursorComponent = SCR_CursorEditorUIComponent.Cast(menu.GetRootComponent().FindComponent(SCR_CursorEditorUIComponent));
94
95 //--- Fade in
96 //m_Widget.SetOpacity(0);
97 //AnimateWidget.Opacity(m_Widget, 1, 5);
98 }
99
101 {
103 {
104 m_AlwaysShownWidget.RemoveFromHierarchy();
105 m_AlwaysShownWidget = null;
106 }
108 {
109 m_HideableWidget.RemoveFromHierarchy();
110 m_HideableWidget = null;
111 }
112 }
113};
SCR_EAIThreatSectorFlags flags
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_CharacterSoundComponentClass GetComponentData()
void SCR_BaseEditorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
ref SCR_EditableEntityUIConfig m_EditableEntityUI
SCR_EditableEntityUIConfig GetEditableEntityUI()
SCR_EditableEntityUIConfig GetEditableEntityUI()
SCR_CursorEditorUIComponent m_CursorComponent
bool GetCursorWorldPos(out vector worldPos, TraceFlags flags=-1)
proto external GenericEntity GetOwner()
Get owner entity.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
TraceFlags
Definition TraceFlags.c:13