Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NTElementBase.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
4{
5 //------------------------------------------------------------------------------------------------
6 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
7 {
8 string val;
9 source.Get("m_sWidgetName", val);
10 title = val + " " + source.GetClassName();
11 return true;
12 }
13};
14
15//------------------------------------------------------------------------------------------------
19{
20 [Attribute("", UIWidgets.EditBox, "Widget name")]
21 string m_sWidgetName;
22
23 [Attribute("", UIWidgets.Object, "Entity state configuration")]
24 protected ref array<ref SCR_NTStateConfigBase> m_aEntityStates;
25
26 [Attribute("0", UIWidgets.CheckBox, "Whether this element should get scaled down with distance \n ! For scalable elements only")]
27 protected bool m_bScaleElement;
28
30
31 //------------------------------------------------------------------------------------------------
34 {
35 Widget widget = data.m_NameTagWidget.FindAnyWidget(m_sWidgetName);
36 if (!widget)
37 {
38 Print("Nametags: Improperly setup element in a zone config, cannot fetch requested widget " + this , LogLevel.WARNING);
39 return;
40 }
41
42 data.m_aNametagElements[index] = widget; // add to data array
43
45 }
46
47 //------------------------------------------------------------------------------------------------
52 {
53 ENameTagEntityState state = data.m_ePriorityEntityState;
56 while (state != stateMin)
57 {
58 if (data.m_eEntityStateFlags & state)
59 {
60 cfg = m_aEntityStatesMap.Get(state);
61 if (cfg)
62 return cfg;
63 }
64
65 state = state >> 1;
66 }
67
68 return m_aEntityStatesMap.Get(ENameTagEntityState.DEFAULT);
69 }
70
71 //------------------------------------------------------------------------------------------------
75
76 //------------------------------------------------------------------------------------------------
80 {}
81
82 //------------------------------------------------------------------------------------------------
86 {
87 // Initial setup
88 if ( !data.m_aNametagElements[index] )
89 {
91 return;
92 }
93
94 // scale
96 {
97 data.m_fTimeSliceUpdate = 1.0;
99 }
100
101 }
102
103 //------------------------------------------------------------------------------------------------
105 {
106 foreach (SCR_NTStateConfigBase entState : m_aEntityStates)
107 {
108 ENameTagEntityState stateEnum = entState.m_eEntityState;
109 if (stateEnum)
110 m_aEntityStatesMap.Insert(stateEnum, entState);
111 }
112 }
113};
114
115//------------------------------------------------------------------------------------------------
118{
119 //------------------------------------------------------------------------------------------------
120 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
121 {
123 source.Get("m_eEntityState", type);
124 title = typename.EnumToString(ENameTagEntityState, type);
125
126 return true;
127 }
128};
129
130//------------------------------------------------------------------------------------------------
134{
135 [Attribute("", UIWidgets.ComboBox, "Configure selected entity state", "", ParamEnumArray.FromEnum(ENameTagEntityState))]
136 int m_eEntityState;
137
138 [Attribute("1 1 1 1", UIWidgets.ColorPicker, desc: "Color")]
139 ref Color m_vColor;
140
141 [Attribute("1", UIWidgets.Slider, desc: "Default opacity when in line of sight", "0 1 1")]
142 float m_fOpacityDefault;
143
144 [Attribute("true", UIWidgets.CheckBox, "If tag fade time is set, choose whether this state should skip the animation")]
145 bool m_bAnimateTransition;
146};
147
148//------------------------------------------------------------------------------------------------
152{
153 [Attribute("0 0 0 1", UIWidgets.ColorPicker, desc: "Text shadow color")]
154 ref Color m_vShadowColor;
155
156 [Attribute("12", UIWidgets.CheckBox, "Text shadow size", params: "0 30")]
157 int m_fShadowSize;
158
159 [Attribute("1", UIWidgets.Slider, desc: "Text shadow opacity", "0 1 1")]
160 float m_fShadowOpacity;
161};
162
163//------------------------------------------------------------------------------------------------
167{
168 [Attribute("", UIWidgets.EditBox, desc: "Image selection",)]
169 string m_sImagesetQuad;
170};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EDamageType type
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Get all prefabs that have the spawner data
ENameTagEntityState
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
void ScaleElement(SCR_NameTagData data, int index)
ref map< ENameTagEntityState, SCR_NTStateConfigBase > m_aEntityStatesMap
void InitElementWidget(SCR_NameTagData data, int index)
Find and set this elements widget of nametag struct.
ref array< ref SCR_NTStateConfigBase > m_aEntityStates
void UpdateElement(SCR_NameTagData data, int index)
SCR_NTStateConfigBase GetEntityStateConfig(SCR_NameTagData data)
void SetDefaults(SCR_NameTagData data, int index)
Set initial/default widget values for the element.
Nametag element state config.
Nametag icon element state config.
Nametag text element state config.
Nametag data.
Custom names nametag element config.
Custom names for nametag entity states.
Definition Types.c:486
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute