Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_LightManagerInfoMulti.c
Go to the documentation of this file.
1[BaseContainerProps(configRoot: true)]
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
18{
19 [Attribute("", UIWidgets.Auto)]
20 protected ref array<ref SCR_LightManagerInfoEntry> m_aLights;
21
24 protected bool m_bActiveLightChanged;
25
26 //------------------------------------------------------------------------------------------------
29 {
30 bool enabled;
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)
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 {
66 icon = m_pActiveLight.m_sIcon;
67
68 super.SetIcon(icon);
69 }
70
71 //------------------------------------------------------------------------------------------------
72 override void SetColor(EVehicleInfoState state, EVehicleInfoColor color)
73 {
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
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
107 }
108};
ELightType
Definition ELightType.c:8
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EVehicleInfoColor
Predefined colors that can be assigned in the InfoDisplay configuration.
EVehicleInfoState
UI indicator state, controlling colors and opacity.
proto external Managed FindComponent(typename typeName)
Base class for all vehicle UI state and damage indicators.
EVehicleInfoState m_eState
override void DisplayInit(IEntity owner)
Init the UI, runs 1x at the start of the game.
override bool DisplayStartDrawInit(IEntity owner)
override bool UpdateRequired(EVehicleInfoState state)
override EVehicleInfoState GetState()
Can be overridden to get state of actual system or linked to an event.
override void SetIcon(string icon)
ref array< ref SCR_LightManagerInfoEntry > m_aLights
BaseLightManagerComponent m_pLightManager
override void SetColor(EVehicleInfoState state, EVehicleInfoColor color)
SCR_LightManagerInfoEntry m_pActiveLight
SCR_FieldOfViewSettings Attribute