Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RotateModifierManualCameraComponent.c
Go to the documentation of this file.
1
2
4[BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6{
7 private bool m_bRotate;
8
9 //------------------------------------------------------------------------------------------------
10 protected void OnInputDeviceIsGamepad(bool isGamepad)
11 {
12 //--- Always rotate with controller, cancel rotation when switching to mouse and keyboard
13 m_bRotate = isGamepad;
14 }
15
16 //------------------------------------------------------------------------------------------------
17 protected void ManualCameraRotateDown()
18 {
19 if (!IsEnabled())
20 return;
21
22 if (GetCameraEntity().GetCameraParam().isCursorEnabled)
23 m_bRotate = true;
24 }
25
26 //------------------------------------------------------------------------------------------------
27 protected void ManualCameraRotateUp()
28 {
29 if (!IsEnabled())
30 return;
31
32 m_bRotate = false;
33 }
34
35 //------------------------------------------------------------------------------------------------
37 {
38 if (!param.isManualInputEnabled) return;
39
40 if (m_bRotate)
41 param.flag = param.flag | EManualCameraFlag.ROTATE;
42 else
43 param.flag = param.flag & ~EManualCameraFlag.ROTATE;
44 }
45
46 //------------------------------------------------------------------------------------------------
47 override bool EOnCameraInit()
48 {
49 OnInputDeviceIsGamepad(!GetGame().GetInputManager().IsUsingMouseAndKeyboard());
50 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
51 GetInputManager().AddActionListener("ManualCameraRotate", EActionTrigger.DOWN, ManualCameraRotateDown);
52 GetInputManager().AddActionListener("ManualCameraRotate", EActionTrigger.UP, ManualCameraRotateUp);
53 return true;
54 }
55
56 //------------------------------------------------------------------------------------------------
57 override void EOnCameraExit()
58 {
59 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
60 GetInputManager().RemoveActionListener("ManualCameraRotate", EActionTrigger.DOWN, ManualCameraRotateDown);
61 GetInputManager().RemoveActionListener("ManualCameraRotate", EActionTrigger.UP, ManualCameraRotateUp);
62 }
63}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Parent class from which all SCR_ManualCamera components inherit.
Parameter for carrying information between individual camera components.
Basic camera rotation with modifier button held (RMB by default).
override void EOnCameraFrame(SCR_ManualCameraParam param)
EActionTrigger
EManualCameraFlag