Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BlockUIInfo.c
Go to the documentation of this file.
3 {
4  [Attribute()]
5  protected ref array<ref SCR_SubBlockUIName> m_aDescriptionBlocks;
6 
7  override bool HasDescription()
8  {
9  return super.HasDescription() || m_aDescriptionBlocks && !m_aDescriptionBlocks.IsEmpty();
10  }
11  override LocalizedString GetDescription()
12  {
13  LocalizedString description = super.GetDescription();
14  if (m_aDescriptionBlocks)
15  {
16  for (int i, count = m_aDescriptionBlocks.Count(); i < count; i++)
17  {
18  if (m_aDescriptionBlocks[i].HasName())
19  {
20  if (m_aDescriptionBlocks[i].IsInline() || description.IsEmpty())
21  description += /*" " +*/ m_aDescriptionBlocks[i].GetName();
22  else
23  description += "<br/>" + m_aDescriptionBlocks[i].GetName();
24  }
25  }
26  }
27  return description;
28  }
29 
30  //------------------------------------------------------------------------------------------------
36  LocalizedString GetUnformattedDescriptionBlockName(int index)
37  {
38  if (index > m_aDescriptionBlocks.Count())
39  return string.Empty;
40 
41  return m_aDescriptionBlocks[index].Name;
42  }
43 
44  //------------------------------------------------------------------------------------------------
51  void SetDescriptionBlockName(int index, LocalizedString text)
52  {
53  if (index > m_aDescriptionBlocks.Count())
54  return;
55 
56  Name = text;
57  }
58 
59 };
62 {
63  [Attribute()]
64  protected bool m_bInline;
65 
66  bool IsInline()
67  {
68  return m_bInline;
69  }
70 };
73 {
74  override LocalizedString GetName()
75  {
76  return "<image set='{73BAE6966DBC17CB}UI/Imagesets/Hint/Hint.imageset' name='Bullet' scale='1'/>" + " " + super.GetName(); //--- ToDo: Don't hard-code
77  }
78 };
81 {
82  override LocalizedString GetName()
83  {
84  return "<color rgba='255,255,255,160'><image set='{73BAE6966DBC17CB}UI/Imagesets/Hint/Hint.imageset' name='Tip' scale='1'/>" + " " + super.GetName() + "</color>"; //--- ToDo: Don't hard-code
85  }
86 };
89 {
90  [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum("Any", "0"), ParamEnum("Mouse & Keyboard", "1"), ParamEnum("Gamepad", "2")})]
91  protected int m_iDevice;
92 
93  override bool HasName()
94  {
95  bool isInputMatch = true;
96  switch (m_iDevice)
97  {
98  case 1: isInputMatch = GetGame().GetInputManager().IsUsingMouseAndKeyboard(); break;
99  case 2: isInputMatch = !GetGame().GetInputManager().IsUsingMouseAndKeyboard(); break;
100  }
101  return isInputMatch;
102  }
103 };
106 {
107  [Attribute()]
108  protected string m_sActionName;
109 
110  protected const string m_sDelimiter = "<br/>";
111 
112  override LocalizedString GetName()
113  {
114  //--- ToDo: Turn color conversion to general function
115  Color sRGBA = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
116 
117  return m_sDelimiter + super.GetName() + "<br/><br/>" + string.Format("<color rgba=%2><action name='%1' scale='1.7'/></color>", m_sActionName, UIColors.SRGBAFloatToInt(sRGBA)) + "</br>";
118  }
119 };
122 {
123  [Attribute()]
124  protected ref array<ref SCR_KeyBlockEntry> m_aKeys;
125 
126  protected const LocalizedString m_sHoldModifier = "#ENF-HoldModifier";
127  protected const LocalizedString m_sDoubleModifier = "#ENF-DoubleModifier";
128  protected const LocalizedString m_sComboModifier = "#ENF-ComboModifier";
129  protected const LocalizedString m_sEllipsisModifier = "..."; //--- ToDo: Localize
130  protected const LocalizedString m_sDelimiter = "<br/>"; //--- ToDo: Localize
131 
132  override LocalizedString GetName()
133  {
134  //--- ToDo: Turn color conversion to general function
135  Color sRGBA = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
136 
137  LocalizedString keys;
138  foreach (int i, SCR_KeyBlockEntry entry: m_aKeys)
139  {
140  if (i > 0)
141  {
142  switch (entry.m_iDelimiter)
143  {
144  case 0: keys += m_sComboModifier; break;
145  case 1: keys += m_sEllipsisModifier; break;
146  }
147  }
148 
149  switch (entry.m_iModifier)
150  {
151  case 1: keys += m_sHoldModifier; break;
152  case 2: keys += m_sDoubleModifier; break;
153  }
154  keys += string.Format("<%2 name='%1' scale='1.7'/>", entry.m_sKey, entry.m_Tag);
155  }
156  return m_sDelimiter + super.GetName() + "<br/>" + string.Format("<color rgba='%2'>%1</color>", keys, UIColors.SRGBAFloatToInt(sRGBA)) + "</br>";
157  }
158 };
161 {
162  [Attribute()]
163  string m_sKey;
164 
165  [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum(" + ", "0"), ParamEnum("...", "1")})]
166  int m_iDelimiter;
167 
168  [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum("None", "0"), ParamEnum("Hold", "1"), ParamEnum("Double", "2")})]
169  int m_iModifier;
170 
171  [Attribute("key", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum("key", "key"), ParamEnum("action", "action")})]
172  string m_Tag;
173 };
174 
177 {
178  [Attribute("0", uiwidget: UIWidgets.Flags, enums: { ParamEnum("<p>", "1"), ParamEnum("<b>", "2"), ParamEnum("<i>", "4"), ParamEnum("<h1>", "8"), ParamEnum("<h2>", "16") })]
179  protected int m_iTags;
180 
181  override LocalizedString GetName()
182  {
183  LocalizedString text;
184 
185  if (m_iTags & 1) text += "<p>";
186  if (m_iTags & 2) text += "<b>";
187  if (m_iTags & 4) text += "<i>";
188  if (m_iTags & 8) text += "<h1>";
189  if (m_iTags & 16) text += "<h2>";
190 
191  text += super.GetName();
192 
193  if (m_iTags & 1) text += "</p>";
194  if (m_iTags & 2) text += "</b>";
195  if (m_iTags & 4) text += "</i>";
196  if (m_iTags & 8) text += "</h1>";
197  if (m_iTags & 16) text += "</h2>";
198 
199  return text;
200  }
201  override bool IsInline()
202  {
203  return super.IsInline() || m_iTags & 1; //--- <p> is always inline, we don't want extra <br/> there
204  }
205 };
206 
209 {
210  [Attribute(params: "imageset", uiwidget: UIWidgets.ResourcePickerThumbnail)]
211  protected ResourceName m_sImageSet;
212 
213  [Attribute(desc: "This defines name of the image in the set.")]
214  protected string m_sImage;
215 
216  [Attribute(desc: "Defines the scale of the Icon.", defvalue: "1")]
217  protected float m_fScale;
218 
219  [Attribute(defvalue: "1 1 1 1")]
220  protected ref Color m_fColor;
221 
222  override LocalizedString GetName()
223  {
224  LocalizedString text;
225 
226  if (m_sImage == string.Empty)
227  {
228  Print("HINT SYSTEM: No Icon name defined! Check 'Image'!", LogLevel.WARNING);
229  return "";
230  }
231 
232  return "</br>" + string.Format("<color rgba=%1><image set='%2' name='%3' scale='%4'/></color>", UIColors.SRGBAFloatToInt(m_fColor), m_sImageSet, m_sImage, m_fScale) + "</br>";
233  }
234 };
235 
236 /*
237 [BaseContainerProps(), SCR_BaseContainerLocalizedTitleField("Name")]
238 class SCR_TagBlockUIName: SCR_SubBlockUIName
239 {
240  [Attribute()]
241  protected ref array<ref SCR_BaseTagBlockEntry> m_aTags;
242 
243  override LocalizedString GetName()
244  {
245  LocalizedString text;
246  int tagCount = m_aTags.Count();
247  for (int i; i < tagCount; i++)
248  {
249  text += m_aTags[i].GetStart();
250  }
251 
252  text += super.GetName();
253 
254  for (int i; i < tagCount; i++)
255  {
256  text += m_aTags[i].GetEnd();
257  }
258  return text;
259  }
260 };
261 
262 [BaseContainerProps()]
263 class SCR_BaseTagBlockEntry
264 {
265  string GetStart();
266  string GetEnd();
267 };
268 [BaseContainerProps()]
269 class SCR_CustomTagBlockEntry: SCR_BaseTagBlockEntry
270 {
271  [Attribute()]
272  protected string m_sStart;
273 
274  [Attribute()]
275  protected string m_sEnd;
276 
277  override string GetStart() { return m_sStart; }
278  override string GetEnd() { return m_sEnd; }
279 };
280 [BaseContainerProps()]
281 class SCR_BoldTagBlockEntry: SCR_BaseTagBlockEntry
282 {
283  override string GetStart() { return "<b>"; }
284  override string GetEnd() { return "</b>"; }
285 };
286 [BaseContainerProps()]
287 class SCR_ItalicTagBlockEntry: SCR_BaseTagBlockEntry
288 {
289  override string GetStart() { return "<i>"; }
290  override string GetEnd() { return "</i>"; }
291 };
292 [BaseContainerProps()]
293 class SCR_HeaderTagBlockEntry: SCR_BaseTagBlockEntry
294 {
295  override string GetStart() { return "<h1>"; }
296  override string GetEnd() { return "</h1>"; }
297 };
298 [BaseContainerProps()]
299 class SCR_SubHeaderTagBlockEntry: SCR_BaseTagBlockEntry
300 {
301  override string GetStart() { return "<h2>"; }
302  override string GetEnd() { return "</h2>"; }
303 };
304 */
SCR_SimpleTagBlockUIName
Definition: SCR_BlockUIInfo.c:176
SCR_UIName
Definition: SCR_UIName.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseContainerLocalizedTitleField
SCR_TabViewComponent SCR_ScriptedWidgetComponent SCR_BaseContainerLocalizedTitleField("m_sTabButtonContent")
Definition: SCR_TabViewComponent.c:963
m_sActionName
protected string m_sActionName
Definition: SCR_ActionsRadialMenuEditorComponent.c:24
SCR_TipBlockUIName
Definition: SCR_BlockUIInfo.c:80
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_ActionBlockUIName
Definition: SCR_BlockUIInfo.c:105
SCR_BulletPointBlockUIName
Definition: SCR_BlockUIInfo.c:72
SCR_DeviceBlockUIName
Definition: SCR_BlockUIInfo.c:88
SCR_BlockUIInfo
Definition: SCR_BlockUIInfo.c:2
m_sImageSet
ResourceName m_sImageSet
Definition: SCR_MapToolMenuUI.c:8
Attribute
typedef Attribute
Post-process effect of scripted camera.
UIColors
Definition: Constants.c:16
SCR_SubBlockUIName
Definition: SCR_BlockUIInfo.c:61
SCR_KeyBlockEntry
Definition: SCR_BlockUIInfo.c:160
SCR_UIInfo
Definition: SCR_UIInfo.c:7
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_ImageBlockUIName
Definition: SCR_BlockUIInfo.c:208
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
m_fScale
float m_fScale
Definition: ForestGeneratorObjects.c:65
LocalizedString
Definition: LocalizedString.c:21
SCR_KeyBlockUIName
Definition: SCR_BlockUIInfo.c:121
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