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_LightManagerInfoMulti.c
Go to the documentation of this file.
1
[
BaseContainerProps
(configRoot:
true
)]
2
class
SCR_LightManagerInfoEntry
: Managed
3
{
4
[
Attribute
(
SCR_Enum
.GetDefault(
ELightType
.NoLight),
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
ELightType
))]
5
ELightType
m_eLightType;
6
7
[
Attribute
(
"-1"
, uiwidget:
UIWidgets
.ComboBox, enums: { ParamEnum(
"Either"
,
"-1"
), ParamEnum(
"Left"
,
"0"
), ParamEnum(
"Right"
,
"1"
)})]
8
int
m_iLightSide;
9
10
[
Attribute
(
""
,
UIWidgets
.EditBox,
"Indicator icon to be displayed."
)]
11
string
m_sIcon;
12
13
[
Attribute
(
SCR_Enum
.GetDefault(
EVehicleInfoColor
.WHITE),
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
EVehicleInfoColor
))]
14
EVehicleInfoColor
m_eColor;
15
};
16
17
class
SCR_LightManagerInfoMulti
:
SCR_BaseVehicleInfo
18
{
19
[
Attribute
(
""
,
UIWidgets
.Auto)]
20
protected
ref array<ref SCR_LightManagerInfoEntry>
m_aLights
;
21
22
protected
BaseLightManagerComponent
m_pLightManager
;
23
protected
SCR_LightManagerInfoEntry
m_pActiveLight
;
24
protected
bool
m_bActiveLightChanged
;
25
26
//------------------------------------------------------------------------------------------------
28
override
EVehicleInfoState
GetState
()
29
{
30
bool
enabled;
31
SCR_LightManagerInfoEntry
lightPrev =
m_pActiveLight
;
32
33
foreach
(
SCR_LightManagerInfoEntry
light :
m_aLights
)
34
{
35
if
(!light || light.m_eLightType ==
ELightType
.NoLight)
36
continue
;
37
38
enabled =
m_pLightManager
&&
m_pLightManager
.GetLightsState(light.m_eLightType, light.m_iLightSide);
39
40
if
(enabled)
41
{
42
m_pActiveLight
= light;
43
break
;
44
}
45
}
46
47
if
(
m_pActiveLight
!= lightPrev)
48
m_bActiveLightChanged
=
true
;
49
50
if
(enabled)
51
{
52
return
EVehicleInfoState
.ENABLED;
53
}
54
else
55
{
56
m_pActiveLight
= null;
57
return
EVehicleInfoState
.DISABLED;
58
}
59
60
}
61
62
//------------------------------------------------------------------------------------------------
63
override
void
SetIcon
(
string
icon)
64
{
65
if
(
m_pActiveLight
)
66
icon =
m_pActiveLight
.m_sIcon;
67
68
super.SetIcon(icon);
69
}
70
71
//------------------------------------------------------------------------------------------------
72
override
void
SetColor
(
EVehicleInfoState
state,
EVehicleInfoColor
color)
73
{
74
if
(
m_pActiveLight
)
75
color =
m_pActiveLight
.m_eColor;
76
77
super.SetColor(state, color);
78
}
79
80
//------------------------------------------------------------------------------------------------
81
override
bool
UpdateRequired
(
EVehicleInfoState
state)
82
{
83
bool
isRequired =
m_eState
!= state ||
m_bActiveLightChanged
;
84
85
m_bActiveLightChanged
=
false
;
86
87
return
isRequired;
88
}
89
90
//------------------------------------------------------------------------------------------------
91
override
bool
DisplayStartDrawInit
(
IEntity
owner)
92
{
93
// Terminate if there is no light manager
94
if
(!
m_pLightManager
)
95
return
false
;
96
97
return
super.DisplayStartDrawInit(owner);
98
}
99
100
//------------------------------------------------------------------------------------------------
102
override
void
DisplayInit
(
IEntity
owner)
103
{
104
super.DisplayInit(owner);
105
106
m_pLightManager
=
BaseLightManagerComponent
.Cast(owner.
FindComponent
(
BaseLightManagerComponent
));
107
}
108
};
ELightType
ELightType
Definition
ELightType.c:8
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
EVehicleInfoColor
EVehicleInfoColor
Predefined colors that can be assigned in the InfoDisplay configuration.
Definition
SCR_BaseVehicleInfo.c:17
EVehicleInfoState
EVehicleInfoState
UI indicator state, controlling colors and opacity.
Definition
SCR_BaseVehicleInfo.c:6
BaseLightManagerComponent
Definition
BaseLightManagerComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_BaseVehicleInfo
Base class for all vehicle UI state and damage indicators.
Definition
SCR_BaseVehicleInfo.c:29
SCR_BaseVehicleInfo::m_eState
EVehicleInfoState m_eState
Definition
SCR_BaseVehicleInfo.c:49
SCR_Enum
Definition
SCR_Enum.c:2
SCR_LightManagerInfoEntry
Definition
SCR_LightManagerInfoMulti.c:3
SCR_LightManagerInfoMulti
Definition
SCR_LightManagerInfoMulti.c:18
SCR_LightManagerInfoMulti::DisplayInit
override void DisplayInit(IEntity owner)
Init the UI, runs 1x at the start of the game.
Definition
SCR_LightManagerInfoMulti.c:102
SCR_LightManagerInfoMulti::m_bActiveLightChanged
bool m_bActiveLightChanged
Definition
SCR_LightManagerInfoMulti.c:24
SCR_LightManagerInfoMulti::DisplayStartDrawInit
override bool DisplayStartDrawInit(IEntity owner)
Definition
SCR_LightManagerInfoMulti.c:91
SCR_LightManagerInfoMulti::UpdateRequired
override bool UpdateRequired(EVehicleInfoState state)
Definition
SCR_LightManagerInfoMulti.c:81
SCR_LightManagerInfoMulti::GetState
override EVehicleInfoState GetState()
Can be overridden to get state of actual system or linked to an event.
Definition
SCR_LightManagerInfoMulti.c:28
SCR_LightManagerInfoMulti::SetIcon
override void SetIcon(string icon)
Definition
SCR_LightManagerInfoMulti.c:63
SCR_LightManagerInfoMulti::m_aLights
ref array< ref SCR_LightManagerInfoEntry > m_aLights
Definition
SCR_LightManagerInfoMulti.c:20
SCR_LightManagerInfoMulti::m_pLightManager
BaseLightManagerComponent m_pLightManager
Definition
SCR_LightManagerInfoMulti.c:22
SCR_LightManagerInfoMulti::SetColor
override void SetColor(EVehicleInfoState state, EVehicleInfoColor color)
Definition
SCR_LightManagerInfoMulti.c:72
SCR_LightManagerInfoMulti::m_pActiveLight
SCR_LightManagerInfoEntry m_pActiveLight
Definition
SCR_LightManagerInfoMulti.c:23
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
HUD
VehicleInfo
SCR_LightManagerInfoMulti.c
Generated by
1.17.0