Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MouseAreaEditorUIComponent.c
Go to the documentation of this file.
1 
4 {
5  protected bool m_bIsMouseOn;
6  protected bool m_bIsUsingMouseAndKeyboard;
7 
8  //------------------------------------------------------------------------------------------------
11  bool IsMouseOn()
12  {
13  return m_bIsMouseOn || !m_bIsUsingMouseAndKeyboard;
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  protected void OnInputDeviceIsGamepad(bool isGamepad)
18  {
19  //--- Cache the value
20  m_bIsUsingMouseAndKeyboard = !isGamepad;
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  override bool OnMouseEnter(Widget w, int x, int y)
25  {
26  m_bIsMouseOn = true;
27  return false;
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
32  {
33  m_bIsMouseOn = false;
34  return false;
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override void HandlerAttachedScripted(Widget w)
39  {
40  OnInputDeviceIsGamepad(!GetGame().GetInputManager().IsUsingMouseAndKeyboard());
41  GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
42  }
43 
44  //------------------------------------------------------------------------------------------------
45  override void HandlerDeattached(Widget w)
46  {
47  GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
48  }
49 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_MouseAreaEditorUIComponent
Definition: SCR_MouseAreaEditorUIComponent.c:3
m_bIsUsingMouseAndKeyboard
protected bool m_bIsUsingMouseAndKeyboard
Definition: SCR_NotificationsLogUIComponent.c:42
SCR_BaseEditorUIComponent
Definition: SCR_BaseEditorUIComponent.c:3
GetInputManager
protected InputManager GetInputManager()
Definition: SCR_BaseManualCameraComponent.c:65