Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TooltipAreaEditorUIComponent.c
Go to the documentation of this file.
1 
4 {
5  [Attribute()]
6  protected string m_sMouseAndKeyboardWidgetName;
7 
8  [Attribute()]
9  protected string m_sControllerWidgetName;
10 
11  [Attribute()]
12  protected int m_iOffsetTop;
13 
14  [Attribute()]
15  protected int m_iOffsetRight;
16 
17  [Attribute()]
18  protected int m_iOffsetBottom;
19 
20  [Attribute()]
21  protected int m_iOffsetLeft;
22 
23  protected InputManager m_InputManager;
24  protected Widget m_MouseAndKeyboardWidget;
25  protected Widget m_ControllerWidget;
26 
27  //------------------------------------------------------------------------------------------------
29  Widget GetAreaWidget()
30  {
31  if (m_InputManager.IsUsingMouseAndKeyboard())
32  return m_MouseAndKeyboardWidget;
33  else
34  return m_ControllerWidget;
35  }
36 
37  //------------------------------------------------------------------------------------------------
42  void GetOffsets(out int top, out int right, out int bottom, out int left)
43  {
44  top = m_iOffsetTop;
45  right = m_iOffsetRight;
46  bottom = m_iOffsetBottom;
47  left = m_iOffsetLeft;
48  }
49 
50  //------------------------------------------------------------------------------------------------
52  void ClearTooltips()
53  {
54  ClearAreaWidget(m_MouseAndKeyboardWidget);
55  ClearAreaWidget(m_ControllerWidget);
56  }
57 
58  //------------------------------------------------------------------------------------------------
59  protected void ClearAreaWidget(Widget w)
60  {
61  Widget child = w.GetChildren();
62  while (child)
63  {
64  child.RemoveFromHierarchy();
65  child = child.GetSibling();
66  }
67  }
68 
69  //------------------------------------------------------------------------------------------------
70  override void HandlerAttachedScripted(Widget w)
71  {
72  m_InputManager = GetGame().GetInputManager();
73 
74  m_MouseAndKeyboardWidget = w.FindAnyWidget(m_sMouseAndKeyboardWidgetName);
75  if (!m_MouseAndKeyboardWidget)
76  Print(string.Format("Widget '%1' not found!", m_sMouseAndKeyboardWidgetName), LogLevel.NORMAL);
77 
78  m_ControllerWidget = w.FindAnyWidget(m_sControllerWidgetName);
79  if (!m_ControllerWidget)
80  Print(string.Format("Widget '%1' not found!", m_sControllerWidgetName), LogLevel.NORMAL);
81  }
82 }
m_InputManager
protected InputManager m_InputManager
Definition: SCR_BaseManualCameraComponent.c:15
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_TooltipAreaEditorUIComponent
Definition: SCR_TooltipAreaEditorUIComponent.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseEditorUIComponent
Definition: SCR_BaseEditorUIComponent.c:3