5 protected ref array<ref SCR_MilitarySymbolLayout> m_aLayouts;
16 layout.CreateLayout(symbol, parentWidget);
27 protected ref array<ref EMilitarySymbolDimension> m_aDimensions;
30 protected ResourceName m_Layout;
33 protected ref array<ref SCR_MilitarySymbolArea> m_aAreas;
37 if (m_Identity != symbol.GetIdentity() || !m_aDimensions.Contains(symbol.GetDimension()))
42 Print(
string.Format(
"Layout not defined for %1!",
typename.EnumToString(
EMilitarySymbolIdentity, m_Identity)), LogLevel.WARNING);
46 Widget widget =
GetGame().GetWorkspace().CreateWidgets(
m_Layout, parentWidget);
50 area.CreateArea(symbol, widget);
58 protected string m_sAreaWidgetName;
61 ResourceName m_Layout;
69 protected ref array<ref SCR_MilitarySymbol_TextureBase> m_aTextures;
71 override void CreateArea(notnull
SCR_MilitarySymbol symbol, notnull Widget parentWidget)
75 Print(
"Layout not defined!", LogLevel.WARNING);
79 if (m_sAreaWidgetName)
80 parentWidget = parentWidget.FindAnyWidget(m_sAreaWidgetName);
82 ImageWidget imageWidget;
85 if (!texture.IsCompatible(symbol))
88 imageWidget = ImageWidget.Cast(
GetGame().GetWorkspace().CreateWidgets(
m_Layout, parentWidget));
92 imageWidget.LoadImageTexture(0, texture.GetTexture());
100 protected ResourceName m_ImageSet;
103 protected string m_sTextureSetFormat;
106 protected ref array<ref SCR_MilitarySymbol_QuadBase> m_aQuads;
108 override void CreateArea(notnull
SCR_MilitarySymbol symbol, notnull Widget parentWidget)
112 Print(
"Layout not defined!", LogLevel.WARNING);
116 if (m_sAreaWidgetName)
117 parentWidget = parentWidget.FindAnyWidget(m_sAreaWidgetName);
119 ImageWidget imageWidget;
120 string textureSetName;
123 if (!quad.IsCompatible(symbol))
126 imageWidget = ImageWidget.Cast(
GetGame().GetWorkspace().CreateWidgets(
m_Layout, parentWidget));
130 textureSetName =
string.Format(m_sTextureSetFormat, quad.GetImageSetName());
131 imageWidget.LoadImageFromSet(0,
m_ImageSet, textureSetName);
140 protected string m_sTextureSetFormat;
143 protected ref array<ref SCR_MilitarySymbol_QuadBase> m_aQuads;
145 override void CreateArea(notnull
SCR_MilitarySymbol symbol, notnull Widget parentWidget)
149 Print(
"Layout not defined!", LogLevel.WARNING);
153 if (m_sAreaWidgetName)
154 parentWidget = parentWidget.FindAnyWidget(m_sAreaWidgetName);
156 ImageWidget imageWidget;
157 string textureSetName;
160 if (!quad.IsCompatible(symbol))
163 imageWidget = ImageWidget.Cast(
GetGame().GetWorkspace().CreateWidgets(
m_Layout, parentWidget));
166 textureSetName =
string.Format(m_sTextureSetFormat, quad.GetImageSetName());
167 imageWidget.LoadImageTexture(0, quad.GetImageSetName());
175 protected string m_sTextureSetName;
177 string GetImageSetName()
179 return m_sTextureSetName;
192 return symbol.HasIcon(m_Icon);
203 return m_Amplifier == symbol.GetAmplifier();
209 [
Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail,
params:
"imageset")]
210 protected ResourceName m_Texture;
212 ResourceName GetTexture()
227 return symbol.HasIcon(m_Icon);
238 return m_Amplifier == symbol.GetAmplifier();
244 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
247 source.Get(
"m_Identity", identity);
250 array<EMilitarySymbolDimension> dimensions = {};
251 source.Get(
"m_aDimensions", dimensions);
252 int count = dimensions.Count();
256 for (
int i = 0; i < count; i++)