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_LightManagerInfo.c
Go to the documentation of this file.
1
class
SCR_LightManagerInfo
:
SCR_BaseVehicleInfo
2
{
3
[
Attribute
(
SCR_Enum
.GetDefault(
ELightType
.NoLight),
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
ELightType
))]
4
protected
ELightType
m_eLightType
;
5
6
[
Attribute
(
SCR_Enum
.GetDefault(
ELightType
.NoLight),
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
ELightType
))]
7
protected
ELightType
m_eSuppressedBy
;
8
9
[
Attribute
(
"-1"
, uiwidget:
UIWidgets
.ComboBox, enums: { ParamEnum(
"Either"
,
"-1"
), ParamEnum(
"Left"
,
"0"
), ParamEnum(
"Right"
,
"1"
)})]
10
protected
int
m_iLightSide
;
11
12
protected
BaseLightManagerComponent
m_LightManager
;
13
protected
BaseLightSlot
m_LightSlot
;
14
protected
ref
ScriptInvoker
m_OnLightStateChanged
;
15
16
protected
bool
m_bIsLit
=
true
;
17
18
//------------------------------------------------------------------------------------------------
20
override
EVehicleInfoState
GetState
()
21
{
22
// Light manager does not have events yet
23
bool
isSuppressed;
24
if
(
m_eSuppressedBy
!=
ELightType
.NoLight)
25
isSuppressed =
m_LightManager
&&
m_LightManager
.GetLightsState(
m_eSuppressedBy
,
m_iLightSide
);
26
27
// TODO: Beam lights should be dark blue!
28
if
(
m_bIsLit
&& !isSuppressed &&
m_LightManager
&&
m_LightManager
.GetLightsState(
m_eLightType
,
m_iLightSide
))
29
return
EVehicleInfoState
.ENABLED;
30
else
31
return
EVehicleInfoState
.DISABLED;
32
}
33
34
//------------------------------------------------------------------------------------------------
35
override
bool
DisplayStartDrawInit
(
IEntity
owner)
36
{
37
// Terminate if there is no light manager
38
if
(!
m_LightManager
)
39
return
false
;
40
41
array<BaseLightSlot> outLights =
new
array<BaseLightSlot>;
42
int
iLights =
m_LightManager
.GetLights(outLights);
43
44
BaseLightSlot
lightSlot;
45
ELightType
lightType;
46
int
lightSide;
47
48
for
(
int
i = 0; i < iLights; i++)
49
{
50
lightSlot = outLights.Get(i);
51
52
lightType = lightSlot.GetLightType();
53
lightSide = lightSlot.GetLightSide();
54
55
if
((
m_eLightType
== lightType) && (
m_iLightSide
== -1 ||
m_iLightSide
== lightSide))
56
{
57
#ifdef DEBUG_VEHICLE_UI
58
PrintFormat
(
"[%1] BaseLightSlot detected %2 | type: %3 | side: %4"
, i, lightSlot, lightType, lightSide);
59
#endif
60
61
m_LightSlot
= lightSlot;
62
63
if
(
SCR_LightSlot
.Cast(
m_LightSlot
))
64
m_OnLightStateChanged
=
SCR_LightSlot
.Cast(
m_LightSlot
).
GetOnLightStateChanged
();
65
66
break
;
67
};
68
}
69
70
// Terminate if there is no light slot associated with the setup
71
if
(!
m_LightSlot
)
72
return
false
;
73
74
// Add monitoring of light states changes
75
if
(
m_OnLightStateChanged
)
76
m_OnLightStateChanged
.Insert(
OnLightStateChanged
);
77
78
return
super.DisplayStartDrawInit(owner);
79
}
80
81
//------------------------------------------------------------------------------------------------
82
override
void
DisplayStopDraw
(
IEntity
owner)
83
{
84
// Remove monitoring of light states changes
85
if
(
m_OnLightStateChanged
)
86
m_OnLightStateChanged
.Remove(
OnLightStateChanged
);
87
88
super.DisplayStopDraw(owner);
89
}
90
91
//------------------------------------------------------------------------------------------------
93
void
OnLightStateChanged
(
bool
state)
94
{
95
m_bIsLit
= state;
96
97
#ifdef DEBUG_VEHICLE_UI
98
PrintFormat
(
"%1 OnLightStateChanged: %2"
,
this
,
m_bIsLit
);
99
#endif
100
}
101
102
//------------------------------------------------------------------------------------------------
104
override
void
DisplayInit
(
IEntity
owner)
105
{
106
super.DisplayInit(owner);
107
108
m_LightManager
=
BaseLightManagerComponent
.Cast(owner.
FindComponent
(
BaseLightManagerComponent
));
109
}
110
}
ELightType
ELightType
Definition
ELightType.c:8
EVehicleInfoState
EVehicleInfoState
UI indicator state, controlling colors and opacity.
Definition
SCR_BaseVehicleInfo.c:6
BaseLightManagerComponent
Definition
BaseLightManagerComponent.c:13
BaseLightSlot
Definition
BaseLightSlot.c:8
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_Enum
Definition
SCR_Enum.c:2
SCR_LightManagerInfo
Definition
SCR_LightManagerInfo.c:2
SCR_LightManagerInfo::m_iLightSide
int m_iLightSide
Definition
SCR_LightManagerInfo.c:10
SCR_LightManagerInfo::OnLightStateChanged
void OnLightStateChanged(bool state)
Definition
SCR_LightManagerInfo.c:93
SCR_LightManagerInfo::m_eLightType
ELightType m_eLightType
Definition
SCR_LightManagerInfo.c:4
SCR_LightManagerInfo::m_bIsLit
bool m_bIsLit
Used for directional/hazard lights that blink.
Definition
SCR_LightManagerInfo.c:16
SCR_LightManagerInfo::m_eSuppressedBy
ELightType m_eSuppressedBy
Definition
SCR_LightManagerInfo.c:7
SCR_LightManagerInfo::GetState
override EVehicleInfoState GetState()
Can be overridden to get state of actual system or linked to an event.
Definition
SCR_LightManagerInfo.c:20
SCR_LightManagerInfo::m_OnLightStateChanged
ref ScriptInvoker m_OnLightStateChanged
Definition
SCR_LightManagerInfo.c:14
SCR_LightManagerInfo::DisplayStopDraw
override void DisplayStopDraw(IEntity owner)
Definition
SCR_LightManagerInfo.c:82
SCR_LightManagerInfo::DisplayStartDrawInit
override bool DisplayStartDrawInit(IEntity owner)
Definition
SCR_LightManagerInfo.c:35
SCR_LightManagerInfo::m_LightManager
BaseLightManagerComponent m_LightManager
Definition
SCR_LightManagerInfo.c:12
SCR_LightManagerInfo::m_LightSlot
BaseLightSlot m_LightSlot
Definition
SCR_LightManagerInfo.c:13
SCR_LightManagerInfo::DisplayInit
override void DisplayInit(IEntity owner)
Init the UI, runs 1x at the start of the game.
Definition
SCR_LightManagerInfo.c:104
SCR_LightSlot
Definition
SCR_LightSlot.c:2
SCR_LightSlot::GetOnLightStateChanged
ScriptInvoker GetOnLightStateChanged()
Definition
SCR_LightSlot.c:17
UIWidgets
Definition
attributes.c:40
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
HUD
VehicleInfo
SCR_LightManagerInfo.c
Generated by
1.17.0