Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MilitarySymbolConfig.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot: true)]
3 {
4  [Attribute()]
5  protected ref array<ref SCR_MilitarySymbolLayout> m_aLayouts;
6 
12  void CreateWidgets(notnull SCR_MilitarySymbol symbol, notnull Widget parentWidget)
13  {
14  foreach (SCR_MilitarySymbolLayout layout: m_aLayouts)
15  {
16  layout.CreateLayout(symbol, parentWidget);
17  }
18  }
19 };
22 {
23  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolIdentity))]
24  protected EMilitarySymbolIdentity m_Identity;
25 
26  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolDimension))]
27  protected ref array<ref EMilitarySymbolDimension> m_aDimensions;
28 
29  [Attribute(uiwidget: UIWidgets.ResourceNamePicker, params: "layout")]
30  protected ResourceName m_Layout;
31 
32  [Attribute()]
33  protected ref array<ref SCR_MilitarySymbolArea> m_aAreas;
34 
35  void CreateLayout(notnull SCR_MilitarySymbol symbol, notnull Widget parentWidget)
36  {
37  if (m_Identity != symbol.GetIdentity() || !m_aDimensions.Contains(symbol.GetDimension()))
38  return;
39 
40  if (!m_Layout)
41  {
42  Print(string.Format("Layout not defined for %1!", typename.EnumToString(EMilitarySymbolIdentity, m_Identity)), LogLevel.WARNING);
43  return;
44  }
45 
46  Widget widget = GetGame().GetWorkspace().CreateWidgets(m_Layout, parentWidget);
47 
48  foreach (SCR_MilitarySymbolArea area: m_aAreas)
49  {
50  area.CreateArea(symbol, widget);
51  }
52  }
53 };
54 [BaseContainerProps(), BaseContainerCustomTitleField("m_sAreaWidgetName")]
56 {
57  [Attribute()]
58  protected string m_sAreaWidgetName;
59 
60  [Attribute(uiwidget: UIWidgets.ResourceNamePicker, params: "layout")]
61  ResourceName m_Layout;
62 
63  void CreateArea(notnull SCR_MilitarySymbol symbol, notnull Widget parentWidget);
64 };
65 [BaseContainerProps(), BaseContainerCustomTitleField("m_sAreaWidgetName")]
67 {
68  [Attribute()]
69  protected ref array<ref SCR_MilitarySymbol_TextureBase> m_aTextures;
70 
71  override void CreateArea(notnull SCR_MilitarySymbol symbol, notnull Widget parentWidget)
72  {
73  if (!m_Layout)
74  {
75  Print("Layout not defined!", LogLevel.WARNING);
76  return;
77  }
78 
79  if (m_sAreaWidgetName)
80  parentWidget = parentWidget.FindAnyWidget(m_sAreaWidgetName);
81 
82  ImageWidget imageWidget;
83  foreach (SCR_MilitarySymbol_TextureBase texture: m_aTextures)
84  {
85  if (!texture.IsCompatible(symbol))
86  continue;
87 
88  imageWidget = ImageWidget.Cast(GetGame().GetWorkspace().CreateWidgets(m_Layout, parentWidget));
89  if (!imageWidget)
90  continue;
91 
92  imageWidget.LoadImageTexture(0, texture.GetTexture());
93  }
94  }
95 };
96 [BaseContainerProps(), BaseContainerCustomTitleField("m_sAreaWidgetName")]
98 {
99  [Attribute(uiwidget: UIWidgets.ResourceNamePicker, params: "imageset")]
100  protected ResourceName m_ImageSet;
101 
102  [Attribute("%1")]
103  protected string m_sTextureSetFormat;
104 
105  [Attribute()]
106  protected ref array<ref SCR_MilitarySymbol_QuadBase> m_aQuads;
107 
108  override void CreateArea(notnull SCR_MilitarySymbol symbol, notnull Widget parentWidget)
109  {
110  if (!m_Layout)
111  {
112  Print("Layout not defined!", LogLevel.WARNING);
113  return;
114  }
115 
116  if (m_sAreaWidgetName)
117  parentWidget = parentWidget.FindAnyWidget(m_sAreaWidgetName);
118 
119  ImageWidget imageWidget;
120  string textureSetName;
121  foreach (SCR_MilitarySymbol_QuadBase quad: m_aQuads)
122  {
123  if (!quad.IsCompatible(symbol))
124  continue;
125 
126  imageWidget = ImageWidget.Cast(GetGame().GetWorkspace().CreateWidgets(m_Layout, parentWidget));
127  if (!imageWidget)
128  continue;
129 
130  textureSetName = string.Format(m_sTextureSetFormat, quad.GetImageSetName());
131  imageWidget.LoadImageFromSet(0, m_ImageSet, textureSetName);
132  }
133  }
134 };
135 [BaseContainerProps(), BaseContainerCustomTitleField("m_sAreaWidgetName")]
137 {
138 
139  [Attribute("%1")]
140  protected string m_sTextureSetFormat;
141 
142  [Attribute()]
143  protected ref array<ref SCR_MilitarySymbol_QuadBase> m_aQuads;
144 
145  override void CreateArea(notnull SCR_MilitarySymbol symbol, notnull Widget parentWidget)
146  {
147  if (!m_Layout)
148  {
149  Print("Layout not defined!", LogLevel.WARNING);
150  return;
151  }
152 
153  if (m_sAreaWidgetName)
154  parentWidget = parentWidget.FindAnyWidget(m_sAreaWidgetName);
155 
156  ImageWidget imageWidget;
157  string textureSetName;
158  foreach (SCR_MilitarySymbol_QuadBase quad: m_aQuads)
159  {
160  if (!quad.IsCompatible(symbol))
161  continue;
162 
163  imageWidget = ImageWidget.Cast(GetGame().GetWorkspace().CreateWidgets(m_Layout, parentWidget));
164  if (!imageWidget)
165  continue;
166  textureSetName = string.Format(m_sTextureSetFormat, quad.GetImageSetName());
167  imageWidget.LoadImageTexture(0, quad.GetImageSetName());
168  }
169  }
170 };
173 {
174  [Attribute()]
175  protected string m_sTextureSetName;
176 
177  string GetImageSetName()
178  {
179  return m_sTextureSetName;
180  }
181 
182  bool IsCompatible(notnull SCR_MilitarySymbol symbol);
183 };
186 {
187  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolIcon))]
188  protected EMilitarySymbolIcon m_Icon;
189 
190  override bool IsCompatible(notnull SCR_MilitarySymbol symbol)
191  {
192  return symbol.HasIcon(m_Icon);
193  }
194 };
197 {
198  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolAmplifier))]
199  protected EMilitarySymbolAmplifier m_Amplifier;
200 
201  override bool IsCompatible(notnull SCR_MilitarySymbol symbol)
202  {
203  return m_Amplifier == symbol.GetAmplifier();
204  }
205 };
208 {
209  [Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail, params: "imageset")]
210  protected ResourceName m_Texture;
211 
212  ResourceName GetTexture()
213  {
214  return m_Texture;
215  }
216 
217  bool IsCompatible(notnull SCR_MilitarySymbol symbol);
218 };
221 {
222  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolIcon))]
223  protected EMilitarySymbolIcon m_Icon;
224 
225  override bool IsCompatible(notnull SCR_MilitarySymbol symbol)
226  {
227  return symbol.HasIcon(m_Icon);
228  }
229 };
232 {
233  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolAmplifier))]
234  protected EMilitarySymbolAmplifier m_Amplifier;
235 
236  override bool IsCompatible(notnull SCR_MilitarySymbol symbol)
237  {
238  return m_Amplifier == symbol.GetAmplifier();
239  }
240 };
241 
242 class SCR_BaseContainerMilitaryLayout: BaseContainerCustomTitle
243 {
244  override bool _WB_GetCustomTitle(BaseContainer source, out string title)
245  {
246  EMilitarySymbolIdentity identity;
247  source.Get("m_Identity", identity);
248  title = typename.EnumToString(EMilitarySymbolIdentity, identity);
249 
250  array<EMilitarySymbolDimension> dimensions = {};
251  source.Get("m_aDimensions", dimensions);
252  int count = dimensions.Count();
253  if (count > 0)
254  {
255  title += ": ";
256  for (int i = 0; i < count; i++)
257  {
258  if (i > 0)
259  title += " & ";
260 
261  title += typename.EnumToString(EMilitarySymbolDimension, dimensions[i]);
262  }
263  }
264 
265  return true;
266  }
267 };
m_ImageSet
ResourceName m_ImageSet
Definition: SCR_ButtonEffectImage.c:3
SCR_MilitarySymbol
Definition: SCR_MilitarySymbol.c:2
SCR_MilitarySymbol_QuadIcon
Definition: SCR_MilitarySymbolConfig.c:185
SCR_MilitarySymbolAreaConflict
Definition: SCR_MilitarySymbolConfig.c:136
SCR_MilitarySymbolConfig
Definition: SCR_MilitarySymbolConfig.c:2
SCR_BaseContainerCustomTitleEnum
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
Definition: SCR_CampaignHintStorage.c:22
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_MilitarySymbol_TextureIcon
Definition: SCR_MilitarySymbolConfig.c:220
m_Layout
ResourceName m_Layout
Definition: SCR_ActionsToolbarEditorUIComponent.c:6
SCR_BaseContainerMilitaryLayout
Definition: SCR_MilitarySymbolConfig.c:242
m_aAreas
ref array< SCR_ScenarioFrameworkArea > m_aAreas
Definition: SCR_GameModeSFManager.c:65
SCR_MilitarySymbol_QuadAmplifier
Definition: SCR_MilitarySymbolConfig.c:196
BaseContainerCustomTitleField
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition: SCR_KeyBindingMenuConfig.c:113
SCR_MilitarySymbolLayout
Definition: SCR_MilitarySymbolConfig.c:21
EMilitarySymbolIdentity
EMilitarySymbolIdentity
Definition: EMilitarySymbol.c:1
SCR_MilitarySymbolAreaImageSet
Definition: SCR_MilitarySymbolConfig.c:97
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseContainerMilitaryLayout
SCR_GroupEditableEntityUIComponent SCR_BaseEditableEntityUIComponent SCR_BaseContainerMilitaryLayout()] class SCR_GroupEditableEntityTextureUIComponent
Definition: SCR_GroupEditableEntityUIComponent.c:88
SCR_MilitarySymbol_TextureBase
Definition: SCR_MilitarySymbolConfig.c:207
SCR_MilitarySymbol_QuadBase
Definition: SCR_MilitarySymbolConfig.c:172
EMilitarySymbolAmplifier
EMilitarySymbolAmplifier
Definition: EMilitarySymbol.c:63
layout
UI layouts HUD CampaignMP CampaignMainHUD layout
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:20
SCR_MilitarySymbolArea
Definition: SCR_MilitarySymbolConfig.c:55
EMilitarySymbolDimension
EMilitarySymbolDimension
Definition: EMilitarySymbol.c:14
SCR_MilitarySymbol_TextureAmplifier
Definition: SCR_MilitarySymbolConfig.c:231
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_MilitarySymbolAreaTextures
Definition: SCR_MilitarySymbolConfig.c:66
EMilitarySymbolIcon
EMilitarySymbolIcon
Definition: EMilitarySymbol.c:29
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468