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;
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;
12 [
Attribute(
"", UIWidgets.Object,
"Faction color default settings",
"")]
13 ref array<ref SCR_FactionColorDefaults> m_aFactionColors;
15 [
Attribute(
"", UIWidgets.Object,
"Descriptor default settings",
"")]
16 ref array<ref SCR_DescriptorDefaultsBase> m_aDescriptorDefaults;
30 [
Attribute(
"0", UIWidgets.ComboBox,
"Faction",
"", ParamEnumArray.FromEnum(EFactionMapID))]
33 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
desc:
"Icon color")]
34 ref Color m_vColorIcon;
36 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
desc:
"Text color")]
37 ref Color m_vColorText;
43 props.SetFrontColor(m_vColorIcon);
44 props.SetTextColor(m_vColorText);
54 int m_iDescriptorType;
56 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"Priority in displaying the Descriptor",
"0 inf 1")]
59 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"imageset Index, determines to which imageset should be referred for its image",
"0 100 1")]
62 [
Attribute(defvalue:
"0", uiwidget: UIWidgets.CheckBox,
desc:
"Faction based colorization")]
63 bool m_bUseFactionColors;
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;
69 int m_iDescriptorGroupType;
71 [
Attribute(
"1.0", UIWidgets.EditBox,
desc:
"Group scale factor",
"0.1 10.0 0.01")]
74 static int s_iImageSetIconSize;
75 static float s_fReferencePPU;
79 static void SetGlobals(
int size,
float refPPU)
81 s_iImageSetIconSize = size;
82 s_fReferencePPU = refPPU;
89 props.SetGroupType(m_iDescriptorGroupType);
90 props.SetGroupScale(m_fGroupScale);
93 if (m_bIsDefaultInvisible)
94 props.SetVisible(
false);
111 super.SetDefaults(props);
113 props.SetIconVisible(
false);
114 props.SetTextVisible(
false);
126 [
Attribute(
"32", UIWidgets.EditBox,
desc:
"icon size in pixels when pixel per unit ratio = 1")]
129 [
Attribute(
"0.75", UIWidgets.EditBox,
desc:
"icon minimum scale, multiplier of the size",
params:
"0.01 1")]
130 float m_fIconMinScale;
132 [
Attribute(
"1.5", UIWidgets.EditBox,
desc:
"icon maximum scale, multiplier of the size",
params:
"1 100")]
133 float m_fIconMaxScale;
135 [
Attribute(defvalue:
"0", uiwidget: UIWidgets.CheckBox,
desc:
"Align icon with parent entity")]
136 bool m_bAlignWithParent;
138 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
desc:
"Front color")]
144 super.SetDefaults(props);
146 float scale = (m_iIconSize / s_iImageSetIconSize) / s_fReferencePPU;
147 float minScale = m_fIconMinScale * scale;
148 float maxScale = m_fIconMaxScale * scale;
150 props.SetImageDef(m_sImageQuad);
151 props.SetIconSize(scale,minScale,maxScale);
152 props.SetAlignWithParent(m_bAlignWithParent);
158 props.SetFrontColor(m_vColor);
167 [
Attribute(
"", UIWidgets.ResourceNamePicker,
desc:
"Specific font that will be used for this descriptor",
params:
"fnt")]
168 ResourceName m_TextFont;
170 [
Attribute(
"25", UIWidgets.EditBox,
desc:
"text size",
"1 1000 1")]
173 [
Attribute(
"0.75", UIWidgets.EditBox,
desc:
"text minimum scale, multiplier of the size",
params:
"0.01 1")]
174 float m_fTextMinScale;
176 [
Attribute(
"1.5", UIWidgets.EditBox,
desc:
"text maximum scale, multiplier of the size",
params:
"1 100")]
177 float m_fTextMaxScale;
182 [
Attribute(
"0", UIWidgets.CheckBox,
desc:
"Use italic text")]
185 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"text percentage X offset based on length",
"-2.0 2.0 0.1")]
186 float m_fTextOffsetX;
188 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"text percentage Y offset based on height",
"-2.0 2.0 0.1")]
189 float m_fTextOffsetY;
191 [
Attribute(
"-1", UIWidgets.EditBox,
desc:
"text percentage horizontal alignment with icon",
"-2.0 2.0 0.1")]
192 float m_fIconTextAlignH;
194 [
Attribute(
"0.5", UIWidgets.EditBox,
desc:
"text percentage vertical alignment with icon",
"-2.0 2.0 0.1")]
195 float m_fIconTextAlignV;
197 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
desc:
"Text color")]
198 ref Color m_vTextColor;
203 super.SetDefaults(props);
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);
216 props.SetTextItalic();
222 super.SetColors(props);
224 props.SetTextColor(m_vTextColor);
233 [
Attribute(
"", UIWidgets.ResourceNamePicker,
desc:
"Specific font that will be used for this descriptor",
params:
"fnt")]
234 ResourceName m_TextFont;
237 [
Attribute(
"25", UIWidgets.EditBox,
desc:
"text size",
"1 1000 1")]
240 [
Attribute(
"0.75", UIWidgets.EditBox,
desc:
"text minimum scale, multiplier of the size",
params:
"0.01 1")]
241 float m_fTextMinScale;
243 [
Attribute(
"1.5", UIWidgets.EditBox,
desc:
"text maximum scale, multiplier of the size",
params:
"1 100")]
244 float m_fTextMaxScale;
249 [
Attribute(
"0", UIWidgets.CheckBox,
desc:
"Use italic text")]
252 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"text rotation angle",
"-359.0 359.0 0.0")]
255 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"text percentage X offset based on length",
"-2.0 2.0 0.1")]
256 float m_fTextOffsetX;
258 [
Attribute(
"0", UIWidgets.EditBox,
desc:
"text percentage Y offset based on height",
"-2.0 2.0 0.1")]
259 float m_fTextOffsetY;
261 [
Attribute(
"-1", UIWidgets.EditBox,
desc:
"text percentage horizontal alignment with icon",
"-2.0 2.0 0.1")]
262 float m_fIconTextAlignH;
264 [
Attribute(
"0.5", UIWidgets.EditBox,
desc:
"text percentage vertical alignment with icon",
"-2.0 2.0 0.1")]
265 float m_fIconTextAlignV;
267 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
desc:
"Text color")]
273 super.SetDefaults(props);
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);
286 props.SetTextItalic();
288 props.SetTextAngle(m_fTextAngle);
290 props.SetIconVisible(
false);
296 props.SetTextColor(m_vColor);
305 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
308 source.Get(
"m_iFaction",
type);
309 title =
typename.EnumToString(EFactionMapID,
type);