Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorButtonUIComponent.c
Go to the documentation of this file.
1 class SCR_EditorButtonUIComponent : ScriptedWidgetComponent
2 {
3  protected Widget m_Widget;
4 
5  //------------------------------------------------------------------------------------------------
6  protected void OnEditorLimitedChange(bool isLimited)
7  {
8  m_Widget.SetVisible(!isLimited);
9  }
10 
11  //------------------------------------------------------------------------------------------------
12  override bool OnClick(Widget w, int x, int y, int button)
13  {
14  SCR_EditorManagerEntity.OpenInstance();
15  return false;
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  override void HandlerAttached(Widget w)
20  {
21  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
22  if (!editorManager)
23  return;
24 
25  m_Widget = w;
26 
27  editorManager.GetOnLimitedChange().Insert(OnEditorLimitedChange);
28  OnEditorLimitedChange(editorManager.IsLimited());
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  override void HandlerDeattached(Widget w)
33  {
34  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
35  if (!editorManager)
36  return;
37 
38  editorManager.GetOnLimitedChange().Remove(OnEditorLimitedChange);
39  }
40 }
SCR_EditorButtonUIComponent
Definition: SCR_EditorButtonUIComponent.c:1
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26