6 [
Attribute(
"AR-MapMarker_Military",
desc:
"Description in selection menu")]
7 protected string m_sMenuDescription;
9 [
Attribute(
"{3262679C50EF4F01}UI/Textures/Icons/icons_wrapperUI.imageset", UIWidgets.ResourcePickerThumbnail,
desc:
"Imageset resource",
params:
"imageset")]
10 protected ResourceName m_sMenuImageset;
13 protected string m_sMenuIcon;
16 protected ref array<ref SCR_MarkerMilitaryFactionEntry> m_aMilitaryFactionEntries;
19 protected ref array<ref SCR_MarkerMilitaryDimension> m_aMilitaryDimensions;
22 protected ref array<ref SCR_MarkerMilitaryType> m_aMilitaryTypes;
24 const int FACTION_DETERMINATOR = 100;
25 const float DIMENSION_DETERMINATOR = 0.01;
28 string GetMenuDescription()
34 ResourceName GetMenuImageset()
46 array<ref SCR_MarkerMilitaryFactionEntry> GetMilitaryFactionEntries()
52 SCR_MarkerMilitaryFactionEntry GetFactionEntry(
int i)
65 if (entry.GetFactionIdentity() == faction)
73 array<ref SCR_MarkerMilitaryDimension> GetMilitaryDimensions()
79 SCR_MarkerMilitaryDimension GetDimensionEntry(
int i)
92 if (entry.GetDimension() == dimension)
100 array<ref SCR_MarkerMilitaryType> GetMilitaryTypes()
106 SCR_MarkerMilitaryType GetTypeEntry(
int i)
123 super.InitClientSettings(marker, widgetComp);
125 widgetComp.SetEventListening(
true);
126 widgetComp.SetMilitarySymbolMode(
true);
128 array<ref SCR_MarkerMilitaryFactionEntry> milFactionEntries = GetMilitaryFactionEntries();
129 array<ref SCR_MarkerMilitaryDimension> milDimensions = GetMilitaryDimensions();
130 array<ref SCR_MarkerMilitaryType> milTypes = GetMilitaryTypes();
135 if (!milFactionEntries.IsIndexValid(factionID) || !milDimensions.IsIndexValid(dimensionID))
139 SCR_MarkerMilitaryFactionEntry factionEntry = milFactionEntries[factionID];
140 milSymbol.SetIdentity(factionEntry.GetFactionIdentity());
141 milSymbol.SetDimension(milDimensions[dimensionID].GetDimension());
142 milSymbol.SetIcons(marker.GetFlags());
144 widgetComp.UpdateMilitarySymbol(milSymbol);
145 widgetComp.SetColor(factionEntry.GetColor());
146 widgetComp.SetText(marker.GetCustomText());
149 widgetComp.SetTypeIcon(1, milDimensions[dimensionID].GetTranslation());
151 int typeFlags = marker.GetFlags();
156 foreach (SCR_MarkerMilitaryType
type : milTypes)
158 if (typeFlags &
type.GetType())
162 widgetComp.SetTypeIcon(3,
type.GetTranslation());
167 widgetComp.SetTypeIcon(2,
type.GetTranslation());
168 if (typeFlags ==
type.GetType())
182 widgetComp.SetTextVisible(
false);
186 widgetComp.SetTextVisible(
true);
194 class SCR_MarkerMilitaryDimension
200 protected string m_sTranslation;
209 string GetTranslation()
211 return m_sTranslation;
219 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
223 source.Get(
"m_eDimension", symbol);
234 class SCR_MarkerMilitaryType
240 protected string m_sTranslation;
249 string GetTranslation()
251 return m_sTranslation;
259 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
263 source.Get(
"m_eType", symbol);
274 class SCR_MarkerMilitaryFactionEntry
280 protected ref Color m_FactionColor;
282 [
Attribute(
"{3262679C50EF4F01}UI/Textures/Icons/icons_wrapperUI.imageset", UIWidgets.ResourcePickerThumbnail,
desc:
"Imageset resource",
params:
"imageset")]
283 protected ResourceName m_sIconImageset;
286 protected string m_sIconImagesetQuad;
289 protected string m_sTranslation;
294 return m_FactionIdentity;
300 return Color.FromInt(m_FactionColor.PackToInt());
304 void GetIconResource(out ResourceName imageset, out
string imageQuad)
306 imageset = m_sIconImageset;
307 imageQuad = m_sIconImagesetQuad;
311 string GetTranslation()
313 return m_sTranslation;
321 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
324 source.Get(
"m_FactionIdentity", faction);