Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SetSpeedManualCameraComponent.c
Go to the documentation of this file.
1
2
4[BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6{
7 [Attribute("2.5")]
8 protected float m_fGamepadCameraSpeed;
9
10 [Attribute("12")]
12
13 protected bool m_bIsBoosted;
14 protected bool m_bIsUsingGamepad;
15
16// [Attribute("3")]
17// float m_fLayoutDuration;
18//
19// [Attribute(params: "layout")]
20// private ResourceName m_Layout;
21// private TextWidget m_Widget;
22// private float m_fWidgetAlpha;
23
24 //------------------------------------------------------------------------------------------------
25 protected void OnInputDeviceIsGamepad(bool isGamepad)
26 {
27 m_bIsUsingGamepad = isGamepad;
28
30 m_bIsBoosted = false;
31 }
32
33 //------------------------------------------------------------------------------------------------
34 protected void ManualCameraSpeedToggle()
35 {
36 if (!IsEnabled())
37 return;
38
40
41 //UpdateWidget();
42 }
43
44// //------------------------------------------------------------------------------------------------
45// protected void UpdateWidget()
46// {
47// if (!m_Widget) return;
48//
49// if (!m_bIsBoosted)
50// m_Widget.SetTextFormat("#AR-ValueUnit_Short_Multiplier", m_fGamepadCameraSpeed);
51// else
52// m_Widget.SetTextFormat("#AR-ValueUnit_Short_Multiplier", m_fGamepadCameraSpeedBoosted);
53//
54// m_Widget.SetVisible(true);
55// m_fWidgetAlpha = 1 + m_fLayoutDuration;
56// }
57
58// //------------------------------------------------------------------------------------------------
59// protected void FadeOutWidget(float timeSlice)
60// {
61// if (!m_Widget || !m_Widget.IsVisible()) return;
62//
63// m_fWidgetAlpha -= timeSlice;
64// if (m_fWidgetAlpha > 0)
65// {
66// m_Widget.SetOpacity(Math.Clamp(m_fWidgetAlpha, 0, 1));
67// }
68// else
69// {
70// m_Widget.SetVisible(false);
71// }
72// }
73
74 //------------------------------------------------------------------------------------------------
76 {
77 if (!param.isManualInputEnabled || !m_bIsUsingGamepad)
78 return;
79
80 if (!m_bIsBoosted)
81 {
82 param.multiplier *= m_fGamepadCameraSpeed;
83 }
84 else
85 {
86 param.multiplier *= m_fGamepadCameraSpeedBoosted;
87
88 float lateral = GetInputManager().GetActionValue("ManualCameraMoveLateral");
89 float vertical = GetInputManager().GetActionValue("ManualCameraMoveVertical");
90 float longitudinal = GetInputManager().GetActionValue("ManualCameraMoveLongitudinal");
91
92 if (lateral == 0 && vertical == 0 && longitudinal == 0)
93 {
94 m_bIsBoosted = false;
95 //UpdateWidget()
96 }
97 }
98 }
99
100 //------------------------------------------------------------------------------------------------
101 override bool EOnCameraInit()
102 {
103 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
104
105 GetInputManager().AddActionListener("ManualCameraSpeedToggle", EActionTrigger.DOWN, ManualCameraSpeedToggle);
106
107 //m_Widget = TextWidget.Cast(GetCameraEntity().CreateCameraWidget(m_Layout, false));
108 return true;
109 }
110
111 //------------------------------------------------------------------------------------------------
112 override void EOnCameraExit()
113 {
114 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
115
116 GetInputManager().RemoveActionListener("ManualCameraSpeedToggle", EActionTrigger.DOWN, ManualCameraSpeedToggle);
117
118 //if (m_Widget) m_Widget.RemoveFromHierarchy();
119 }
120}
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.
Instantly set the speed to a value within a sequence.
override void EOnCameraFrame(SCR_ManualCameraParam param)
SCR_FieldOfViewSettings Attribute
EActionTrigger