Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SetSpeedManualCameraComponent.c
Go to the documentation of this file.
1
2
4
[
BaseContainerProps
(), SCR_BaseManualCameraComponentTitle()]
5
class
SCR_SetSpeedManualCameraComponent
:
SCR_BaseManualCameraComponent
6
{
7
[
Attribute
(
"2.5"
)]
8
protected
float
m_fGamepadCameraSpeed
;
9
10
[
Attribute
(
"12"
)]
11
protected
float
m_fGamepadCameraSpeedBoosted
;
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
29
if
(!
m_bIsUsingGamepad
)
30
m_bIsBoosted
=
false
;
31
}
32
33
//------------------------------------------------------------------------------------------------
34
protected
void
ManualCameraSpeedToggle
()
35
{
36
if
(!
IsEnabled
())
37
return
;
38
39
m_bIsBoosted
= !
m_bIsBoosted
;
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
//------------------------------------------------------------------------------------------------
75
override
void
EOnCameraFrame
(
SCR_ManualCameraParam
param)
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
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition
SCR_BaseManualCameraComponent.c:6
SCR_BaseManualCameraComponent::GetInputManager
InputManager GetInputManager()
Definition
SCR_BaseManualCameraComponent.c:70
SCR_BaseManualCameraComponent::IsEnabled
int IsEnabled()
Definition
SCR_BaseManualCameraComponent.c:104
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition
SCR_ManualCameraParam.c:6
SCR_SetSpeedManualCameraComponent
Instantly set the speed to a value within a sequence.
Definition
SCR_SetSpeedManualCameraComponent.c:6
SCR_SetSpeedManualCameraComponent::ManualCameraSpeedToggle
void ManualCameraSpeedToggle()
Definition
SCR_SetSpeedManualCameraComponent.c:34
SCR_SetSpeedManualCameraComponent::EOnCameraExit
override void EOnCameraExit()
Definition
SCR_SetSpeedManualCameraComponent.c:112
SCR_SetSpeedManualCameraComponent::m_fGamepadCameraSpeedBoosted
float m_fGamepadCameraSpeedBoosted
Definition
SCR_SetSpeedManualCameraComponent.c:11
SCR_SetSpeedManualCameraComponent::m_fGamepadCameraSpeed
float m_fGamepadCameraSpeed
Definition
SCR_SetSpeedManualCameraComponent.c:8
SCR_SetSpeedManualCameraComponent::EOnCameraInit
override bool EOnCameraInit()
Definition
SCR_SetSpeedManualCameraComponent.c:101
SCR_SetSpeedManualCameraComponent::OnInputDeviceIsGamepad
void OnInputDeviceIsGamepad(bool isGamepad)
Definition
SCR_SetSpeedManualCameraComponent.c:25
SCR_SetSpeedManualCameraComponent::m_bIsUsingGamepad
bool m_bIsUsingGamepad
Definition
SCR_SetSpeedManualCameraComponent.c:14
SCR_SetSpeedManualCameraComponent::m_bIsBoosted
bool m_bIsBoosted
Definition
SCR_SetSpeedManualCameraComponent.c:13
SCR_SetSpeedManualCameraComponent::EOnCameraFrame
override void EOnCameraFrame(SCR_ManualCameraParam param)
Definition
SCR_SetSpeedManualCameraComponent.c:75
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
Game
Camera
Components
SCR_SetSpeedManualCameraComponent.c
Generated by
1.17.0