Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MapDescriptorDefaults.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
2[BaseContainerProps(configRoot: true)]
4class SCR_MapDescriptorDefaults
5{
6 [Attribute("128", UIWidgets.EditBox, desc: "Size of icons in imageset, it is important for internal size calculations!", params: "16 256")]
7 int m_iImagesetIconSize;
8
9 [Attribute("1", UIWidgets.EditBox, desc: "Sets the reference PixPerUnit for setting sizes which by default is = 1 \n", params: "0.01 10")]
10 float m_fReferencePixPerUnit;
11
12 [Attribute("", UIWidgets.Object, "Faction color default settings", "")]
13 ref array<ref SCR_FactionColorDefaults> m_aFactionColors;
14
15 [Attribute("", UIWidgets.Object, "Descriptor default settings", "")]
16 ref array<ref SCR_DescriptorDefaultsBase> m_aDescriptorDefaults;
17
18 //------------------------------------------------------------------------------------------------
19 void SCR_MapDescriptorDefaults()
20 {
21 SCR_DescriptorDefaultsBase.SetGlobals(m_iImagesetIconSize, m_fReferencePixPerUnit);
22 }
23};
24
25//------------------------------------------------------------------------------------------------
29{
30 [Attribute("0", UIWidgets.ComboBox, "Faction", "", ParamEnumArray.FromEnum(EFactionMapID))]
31 int m_iFaction;
32
33 [Attribute("1 1 1 1", UIWidgets.ColorPicker, desc: "Icon color")]
34 ref Color m_vColorIcon;
35
36 [Attribute("1 1 1 1", UIWidgets.ColorPicker, desc: "Text color")]
37 ref Color m_vColorText;
38
39 //------------------------------------------------------------------------------------------------
41 void SetColors(MapDescriptorProps props)
42 {
43 props.SetFrontColor(m_vColorIcon);
44 props.SetTextColor(m_vColorText);
45 }
46};
47
48//------------------------------------------------------------------------------------------------
52{
53 [Attribute("0", UIWidgets.ComboBox, "Descriptor type", "", ParamEnumArray.FromEnum(EMapDescriptorType))]
54 int m_iDescriptorType;
55
56 [Attribute("0", UIWidgets.EditBox, desc: "Priority in displaying the Descriptor", "0 inf 1")]
57 int m_iPriority;
58
59 [Attribute("0", UIWidgets.EditBox, desc: "imageset Index, determines to which imageset should be referred for its image", "0 100 1")]
60 int m_iImageSetIndex;
61
62 [Attribute(defvalue: "0", uiwidget: UIWidgets.CheckBox, desc: "Faction based colorization")]
63 bool m_bUseFactionColors;
64
65 [Attribute(defvalue: "0", uiwidget: UIWidgets.CheckBox, desc: "This descriptor is configured but not visible without being activated by something else")]
66 bool m_bIsDefaultInvisible;
67
68 [Attribute("0", UIWidgets.ComboBox, "Descriptor group type", "", ParamEnumArray.FromEnum(EMapDescriptorGroup))]
69 int m_iDescriptorGroupType;
70
71 [Attribute("1.0", UIWidgets.EditBox, desc: "Group scale factor", "0.1 10.0 0.01")]
72 float m_fGroupScale;
73
74 static int s_iImageSetIconSize; // real icon size in imageset
75 static float s_fReferencePPU; // refernce PixelPerUnit value for setting size
76
77 //------------------------------------------------------------------------------------------------
79 static void SetGlobals(int size, float refPPU)
80 {
81 s_iImageSetIconSize = size;
82 s_fReferencePPU = refPPU;
83 }
84
85 //------------------------------------------------------------------------------------------------
87 void SetDefaults(MapDescriptorProps props)
88 {
89 props.SetGroupType(m_iDescriptorGroupType);
90 props.SetGroupScale(m_fGroupScale);
91 props.SetPriority(m_iPriority);
92
93 if (m_bIsDefaultInvisible)
94 props.SetVisible(false);
95 }
96
97 //------------------------------------------------------------------------------------------------
99 void SetColors(MapDescriptorProps props)
100 {}
101};
102
103//------------------------------------------------------------------------------------------------
107{
108 //------------------------------------------------------------------------------------------------
109 override void SetDefaults(MapDescriptorProps props)
110 {
111 super.SetDefaults(props);
112
113 props.SetIconVisible(false);
114 props.SetTextVisible(false);
115 }
116};
117
118//------------------------------------------------------------------------------------------------
122{
123 [Attribute("", UIWidgets.EditBox, desc: "imageset quad")]
124 string m_sImageQuad;
125
126 [Attribute("32", UIWidgets.EditBox, desc: "icon size in pixels when pixel per unit ratio = 1")]
127 int m_iIconSize;
128
129 [Attribute("0.75", UIWidgets.EditBox, desc: "icon minimum scale, multiplier of the size", params: "0.01 1")]
130 float m_fIconMinScale;
131
132 [Attribute("1.5", UIWidgets.EditBox, desc: "icon maximum scale, multiplier of the size", params: "1 100")]
133 float m_fIconMaxScale;
134
135 [Attribute(defvalue: "0", uiwidget: UIWidgets.CheckBox, desc: "Align icon with parent entity")]
136 bool m_bAlignWithParent;
137
138 [Attribute("1 1 1 1", UIWidgets.ColorPicker, desc: "Front color")]
139 ref Color m_vColor;
140
141 //------------------------------------------------------------------------------------------------
142 override void SetDefaults(MapDescriptorProps props)
143 {
144 super.SetDefaults(props);
145
146 float scale = (m_iIconSize / s_iImageSetIconSize) / s_fReferencePPU; // unscaled vals
147 float minScale = m_fIconMinScale * scale;
148 float maxScale = m_fIconMaxScale * scale;
149
150 props.SetImageDef(m_sImageQuad);
151 props.SetIconSize(scale,minScale,maxScale);
152 props.SetAlignWithParent(m_bAlignWithParent);
153 }
154
155 //------------------------------------------------------------------------------------------------
156 override void SetColors(MapDescriptorProps props)
157 {
158 props.SetFrontColor(m_vColor);
159 }
160};
161
162//------------------------------------------------------------------------------------------------
166{
167 [Attribute("", UIWidgets.ResourceNamePicker, desc: "Specific font that will be used for this descriptor", params: "fnt")]
168 ResourceName m_TextFont;
169
170 [Attribute("25", UIWidgets.EditBox, desc: "text size", "1 1000 1")]
171 float m_fTextSize;
172
173 [Attribute("0.75", UIWidgets.EditBox, desc: "text minimum scale, multiplier of the size", params: "0.01 1")]
174 float m_fTextMinScale;
175
176 [Attribute("1.5", UIWidgets.EditBox, desc: "text maximum scale, multiplier of the size", params: "1 100")]
177 float m_fTextMaxScale;
178
179 [Attribute("0", UIWidgets.CheckBox, desc: "Use bold text")]
180 bool m_bBoldText;
181
182 [Attribute("0", UIWidgets.CheckBox, desc: "Use italic text")]
183 bool m_bItalicText;
184
185 [Attribute("0", UIWidgets.EditBox, desc: "text percentage X offset based on length", "-2.0 2.0 0.1")]
186 float m_fTextOffsetX;
187
188 [Attribute("0", UIWidgets.EditBox, desc: "text percentage Y offset based on height", "-2.0 2.0 0.1")]
189 float m_fTextOffsetY;
190
191 [Attribute("-1", UIWidgets.EditBox, desc: "text percentage horizontal alignment with icon", "-2.0 2.0 0.1")]
192 float m_fIconTextAlignH;
193
194 [Attribute("0.5", UIWidgets.EditBox, desc: "text percentage vertical alignment with icon", "-2.0 2.0 0.1")]
195 float m_fIconTextAlignV;
196
197 [Attribute("1 1 1 1", UIWidgets.ColorPicker, desc: "Text color")]
198 ref Color m_vTextColor;
199
200 //------------------------------------------------------------------------------------------------
201 override void SetDefaults(MapDescriptorProps props)
202 {
203 super.SetDefaults(props);
204
205 props.SetFont(m_TextFont);
206 props.SetTextSize(m_fTextSize, m_fTextMinScale * m_fTextSize, m_fTextMaxScale * m_fTextSize);
207 props.SetTextOffsetX(m_fTextOffsetX);
208 props.SetTextOffsetY(m_fTextOffsetY);
209 props.SetIconTextAlignH(m_fIconTextAlignH);
210 props.SetIconTextAlignV(m_fIconTextAlignV);
211
212 if (m_bBoldText)
213 props.SetTextBold();
214
215 if (m_bItalicText)
216 props.SetTextItalic();
217 }
218
219 //------------------------------------------------------------------------------------------------
220 override void SetColors(MapDescriptorProps props)
221 {
222 super.SetColors(props);
223
224 props.SetTextColor(m_vTextColor);
225 }
226};
227
228//------------------------------------------------------------------------------------------------
232{
233 [Attribute("", UIWidgets.ResourceNamePicker, desc: "Specific font that will be used for this descriptor", params: "fnt")]
234 ResourceName m_TextFont;
235
236
237 [Attribute("25", UIWidgets.EditBox, desc: "text size", "1 1000 1")]
238 float m_fTextSize;
239
240 [Attribute("0.75", UIWidgets.EditBox, desc: "text minimum scale, multiplier of the size", params: "0.01 1")]
241 float m_fTextMinScale;
242
243 [Attribute("1.5", UIWidgets.EditBox, desc: "text maximum scale, multiplier of the size", params: "1 100")]
244 float m_fTextMaxScale;
245
246 [Attribute("0", UIWidgets.CheckBox, desc: "Use bold text")]
247 bool m_bBoldText;
248
249 [Attribute("0", UIWidgets.CheckBox, desc: "Use italic text")]
250 bool m_bItalicText;
251
252 [Attribute("0", UIWidgets.EditBox, desc: "text rotation angle", "-359.0 359.0 0.0")]
253 float m_fTextAngle;
254
255 [Attribute("0", UIWidgets.EditBox, desc: "text percentage X offset based on length", "-2.0 2.0 0.1")]
256 float m_fTextOffsetX;
257
258 [Attribute("0", UIWidgets.EditBox, desc: "text percentage Y offset based on height", "-2.0 2.0 0.1")]
259 float m_fTextOffsetY;
260
261 [Attribute("-1", UIWidgets.EditBox, desc: "text percentage horizontal alignment with icon", "-2.0 2.0 0.1")]
262 float m_fIconTextAlignH;
263
264 [Attribute("0.5", UIWidgets.EditBox, desc: "text percentage vertical alignment with icon", "-2.0 2.0 0.1")]
265 float m_fIconTextAlignV;
266
267 [Attribute("1 1 1 1", UIWidgets.ColorPicker, desc: "Text color")]
268 ref Color m_vColor;
269
270 //------------------------------------------------------------------------------------------------
271 override void SetDefaults(MapDescriptorProps props)
272 {
273 super.SetDefaults(props);
274
275 props.SetFont(m_TextFont);
276 props.SetTextSize(m_fTextSize, m_fTextMinScale * m_fTextSize, m_fTextMaxScale * m_fTextSize);
277 props.SetTextOffsetX(m_fTextOffsetX);
278 props.SetTextOffsetY(m_fTextOffsetY);
279 props.SetIconTextAlignH(m_fIconTextAlignH);
280 props.SetIconTextAlignV(m_fIconTextAlignV);
281
282 if (m_bBoldText)
283 props.SetTextBold();
284
285 if (m_bItalicText)
286 props.SetTextItalic();
287
288 props.SetTextAngle(m_fTextAngle);
289
290 props.SetIconVisible(false);
291 }
292
293 //------------------------------------------------------------------------------------------------
294 override void SetColors(MapDescriptorProps props)
295 {
296 props.SetTextColor(m_vColor);
297 }
298};
299
300//------------------------------------------------------------------------------------------------
303{
304 //------------------------------------------------------------------------------------------------
305 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
306 {
307 int type;
308 source.Get("m_iFaction", type);
309 title = typename.EnumToString(EFactionMapID, type);
310
311 return true;
312 }
313};
vector scale
int size
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EDamageType type
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
Descriptor icon type defaults.
Descriptor icon with text type defaults.
Descriptor invisible type, for cursor interaction logic support while UI is handled by another system...
Descriptor text type defaults.
Configuration of descriptor defaults.
Custom names for defined zones to make config setup easier.
Configuration of descriptor defaults.
Custom names for defined zones to make config setup easier.
SCR_FieldOfViewSettings Attribute
EMapDescriptorType
EMapDescriptorGroup