Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_DeviceSpecificComponent.c
Go to the documentation of this file.
1 class SCR_DeviceSpecificComponent: ScriptedWidgetComponent
2 {
3  [Attribute("0", UIWidgets.Auto, "")]
4  private bool m_bControllerOnly;
5 
6  private Widget m_Widget;
7 
8  protected void OnInputDeviceIsGamepad(bool isGamepad)
9  {
10  bool enable = m_bControllerOnly == isGamepad;
11  m_Widget.SetEnabled(enable);
12  m_Widget.SetVisible(enable);
13  }
14  override void HandlerAttached(Widget w)
15  {
16  if (SCR_Global.IsEditMode()) return;
17 
18  m_Widget = w;
19 
20  OnInputDeviceIsGamepad(!GetGame().GetInputManager().IsUsingMouseAndKeyboard());
21  GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
22  }
23  override void HandlerDeattached(Widget w)
24  {
25  if (SCR_Global.IsEditMode()) return;
26 
27  GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
28  }
29 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_DeviceSpecificComponent
Definition: SCR_DeviceSpecificComponent.c:1
SCR_Global
Definition: Functions.c:6
GetInputManager
protected InputManager GetInputManager()
Definition: SCR_BaseManualCameraComponent.c:65