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_VariableSightsFOVInfo.c
Go to the documentation of this file.
1
class
SCR_VariableSightsFOVInfo
:
SCR_BaseVariableSightsFOVInfo
2
{
3
[
Attribute
(
""
,
UIWidgets
.Auto,
desc
:
"Individual FOV settings."
)]
4
protected
ref array<float>
m_aFOVs
;
5
6
[
Attribute
(
"6.0"
,
UIWidgets
.Slider,
desc
:
"Interpolation speed."
,
params
:
"0 100 0.1"
)]
7
protected
float
m_fInterpolationSpeed
;
8
10
protected
float
m_fCurrentFOV
= 60.0;
11
13
protected
int
m_iCurrentIndex
= -1;
14
15
//------------------------------------------------------------------------------------------------
19
override
int
GetCount
()
20
{
21
return
m_aFOVs
.Count();
22
}
23
24
//------------------------------------------------------------------------------------------------
28
override
int
GetCurrentIndex
()
29
{
30
return
m_iCurrentIndex
;
31
}
32
33
//------------------------------------------------------------------------------------------------
38
protected
override
void
SetIndex
(
int
index
)
39
{
40
m_iCurrentIndex
=
index
;
41
}
42
43
//------------------------------------------------------------------------------------------------
49
protected
override
void
OnInit
(
IEntity
owner,
BaseSightsComponent
sights)
50
{
51
// Initialize to default (first available) value
52
if
(
GetCount
() > 0)
53
{
54
SetIndex
(0);
55
m_fCurrentFOV
=
m_aFOVs
[0];
56
}
57
else
58
m_fCurrentFOV
= 60.0;
59
}
60
61
//------------------------------------------------------------------------------------------------
68
protected
override
void
OnUpdate
(
IEntity
owner,
BaseSightsComponent
sights,
float
timeSlice)
69
{
70
if
(!
m_aFOVs
.IsIndexValid(
m_iCurrentIndex
))
71
return
;
72
73
float
target =
m_aFOVs
[
m_iCurrentIndex
];
74
m_fCurrentFOV
=
Math
.Lerp(
m_fCurrentFOV
, target, timeSlice *
m_fInterpolationSpeed
);
75
}
76
77
//------------------------------------------------------------------------------------------------
79
override
bool
IsAdjusting
()
80
{
81
if
(!
m_aFOVs
.IsIndexValid(
m_iCurrentIndex
))
82
return
false
;
83
84
return
!
float
.AlmostEqual(
m_fCurrentFOV
,
m_aFOVs
[
m_iCurrentIndex
]);
85
}
86
87
//------------------------------------------------------------------------------------------------
92
protected
override
float
GetCurrentFOV
()
93
{
94
return
m_fCurrentFOV
;
95
}
96
97
//------------------------------------------------------------------------------------------------
104
override
float
GetBaseFOV
()
105
{
106
if
(!
m_aFOVs
.IsEmpty())
107
return
m_aFOVs
[0];
108
109
return
m_fCurrentFOV
;
110
}
111
};
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
BaseSightsComponent
Definition
BaseSightsComponent.c:13
IEntity
Definition
IEntity.c:13
Math
Definition
Math.c:13
SCR_BaseVariableSightsFOVInfo
Definition
SCR_BaseVariableSightsFOVInfo.c:2
SCR_VariableSightsFOVInfo
Definition
SCR_VariableSightsFOVInfo.c:2
SCR_VariableSightsFOVInfo::m_fInterpolationSpeed
float m_fInterpolationSpeed
Definition
SCR_VariableSightsFOVInfo.c:7
SCR_VariableSightsFOVInfo::SetIndex
override void SetIndex(int index)
Definition
SCR_VariableSightsFOVInfo.c:38
SCR_VariableSightsFOVInfo::GetCount
override int GetCount()
Definition
SCR_VariableSightsFOVInfo.c:19
SCR_VariableSightsFOVInfo::IsAdjusting
override bool IsAdjusting()
Returns true when current FOV of the optic does not match the target FOV.
Definition
SCR_VariableSightsFOVInfo.c:79
SCR_VariableSightsFOVInfo::OnUpdate
override void OnUpdate(IEntity owner, BaseSightsComponent sights, float timeSlice)
Definition
SCR_VariableSightsFOVInfo.c:68
SCR_VariableSightsFOVInfo::m_fCurrentFOV
float m_fCurrentFOV
Immediate field of view value.
Definition
SCR_VariableSightsFOVInfo.c:10
SCR_VariableSightsFOVInfo::GetBaseFOV
override float GetBaseFOV()
Definition
SCR_VariableSightsFOVInfo.c:104
SCR_VariableSightsFOVInfo::m_iCurrentIndex
int m_iCurrentIndex
Currently selected FOV or -1 if none.
Definition
SCR_VariableSightsFOVInfo.c:13
SCR_VariableSightsFOVInfo::m_aFOVs
ref array< float > m_aFOVs
Definition
SCR_VariableSightsFOVInfo.c:4
SCR_VariableSightsFOVInfo::GetCurrentFOV
override float GetCurrentFOV()
Definition
SCR_VariableSightsFOVInfo.c:92
SCR_VariableSightsFOVInfo::OnInit
override void OnInit(IEntity owner, BaseSightsComponent sights)
Definition
SCR_VariableSightsFOVInfo.c:49
SCR_VariableSightsFOVInfo::GetCurrentIndex
override int GetCurrentIndex()
Definition
SCR_VariableSightsFOVInfo.c:28
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Weapon
Sights
SightsFOVInfo
SCR_VariableSightsFOVInfo.c
Generated by
1.17.0