Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ShowHideInEditorUIComponent.c
Go to the documentation of this file.
1 class SCR_ShowHideInEditorUIComponent : ScriptedWidgetComponent
2 {
3  protected Widget m_Root;
4 
5  [Attribute("1")]
6  protected bool m_bShowInEditor;
7 
8  //------------------------------------------------------------------------------------------------
9  protected void OnEditorOpen()
10  {
11  m_Root.SetVisible(m_bShowInEditor);
12  }
13 
14  //------------------------------------------------------------------------------------------------
15  protected void OnEditorClosed()
16  {
17  m_Root.SetVisible(!m_bShowInEditor);
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  override void HandlerAttached(Widget w)
22  {
23  m_Root = w;
24  SCR_EditorManagerEntity editorManagerEntity = SCR_EditorManagerEntity.GetInstance();
25 
26  if (!editorManagerEntity)
27  return;
28 
29  editorManagerEntity.GetOnOpened().Insert(OnEditorOpen);
30  editorManagerEntity.GetOnClosed().Insert(OnEditorClosed);
31 
32  m_Root.SetVisible(m_bShowInEditor == editorManagerEntity.IsOpened());
33  }
34 
35  //------------------------------------------------------------------------------------------------
36  override void HandlerDeattached(Widget w)
37  {
38  SCR_EditorManagerEntity editorManagerEntity = SCR_EditorManagerEntity.GetInstance();
39 
40  if (!editorManagerEntity)
41  return;
42 
43  editorManagerEntity.GetOnOpened().Remove(OnEditorOpen);
44  editorManagerEntity.GetOnClosed().Remove(OnEditorClosed);
45  }
46 }
m_Root
SCR_ServerHostingModSubMenu m_Root
SCR_ShowHideInEditorUIComponent
Definition: SCR_ShowHideInEditorUIComponent.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26