Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ScriptedWidgetComponent.c
Go to the documentation of this file.
4 typedef ScriptInvokerBase<ScriptInvokerScriptedWidgetComponentMethod> ScriptInvokerScriptedWidgetComponent;
5 
6 //------------------------------------------------------------------------------------------------
7 class SCR_ScriptedWidgetComponent : ScriptedWidgetComponent
8 {
9  protected Widget m_wRoot;
10 
11  //TODO: typed invoker ScriptInvokerScriptedWidgetComponent
12  ref ScriptInvoker m_OnClick = new ScriptInvoker;
13 
14  //------------------------------------------------------------------------------------------------
15  override void HandlerAttached(Widget w)
16  {
17  m_wRoot = w;
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  override bool OnClick(Widget w, int x, int y, int button)
22  {
23  m_OnClick.Invoke(this);
24  return super.OnClick(w, x, y, button);
25  }
26 
27  //------------------------------------------------------------------------------------------------
29  static SCR_ScriptedWidgetComponent GetComponent(typename componentType, string name, Widget parent, bool searchAllChildren = true)
30  {
31  if (!parent || name == string.Empty)
32  return null;
33 
34  Widget w;
35  if (searchAllChildren)
36  w = parent.FindAnyWidget(name);
37  else
38  w = parent.FindWidget(name);
39 
40  if (!w)
41  {
42  Print(string.Format("SCR_ScriptedWidgetComponent.GetComponent: widget not found: %1 %2", componentType, name), LogLevel.WARNING);
43  Debug.DumpStack();
44  return null;
45  }
46 
47  return SCR_ScriptedWidgetComponent.Cast(w.FindHandler(componentType));
48  }
49 
50  //------------------------------------------------------------------------------------------------
51  Widget GetRootWidget()
52  {
53  return m_wRoot;
54  }
55 
56  //------------------------------------------------------------------------------------------------
57  bool IsVisible()
58  {
59  if (!m_wRoot)
60  return false;
61 
62  return m_wRoot.IsVisible();
63  }
64 };
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
ScriptInvokerScriptedWidgetComponentMethod
func ScriptInvokerScriptedWidgetComponentMethod
Definition: SCR_ScriptedWidgetComponent.c:3
func
func
Definition: SCR_AIThreatSystem.c:5
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7
ScriptInvokerScriptedWidgetComponent
ScriptInvokerBase< ScriptInvokerScriptedWidgetComponentMethod > ScriptInvokerScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:4
m_OnClick
ref ScriptInvoker m_OnClick
Definition: SCR_MapToolMenuUI.c:13