Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DeviceSpecificComponent.c
Go to the documentation of this file.
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};
ArmaReforgerScripted GetGame()
Definition game.c:1398
InputManager GetInputManager()
override void HandlerDeattached(Widget w)
static bool IsEditMode()
Definition Functions.c:1566
SCR_FieldOfViewSettings Attribute