Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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
13 {
14 LocalizedString description = super.GetDescription();
15 if (!description.IsEmpty())
16 description += "<br/>";
17
19 {
20 for (int i, count = m_aDescriptionBlocks.Count(); i < count; i++)
21 {
23 {
24 if (m_aDescriptionBlocks[i].IsInline() || description.IsEmpty())
25 description += m_aDescriptionBlocks[i].GetName() + "<br/>";
26 else
27 description += "<br/>" + m_aDescriptionBlocks[i].GetName();
28 }
29 }
30 }
31 return description + "<br/>";
32 }
33
34 //------------------------------------------------------------------------------------------------
41 {
42 if (index > m_aDescriptionBlocks.Count())
43 return string.Empty;
44
45 return m_aDescriptionBlocks[index].Name;
46 }
47
48 //------------------------------------------------------------------------------------------------
56 {
57 if (index > m_aDescriptionBlocks.Count())
58 return;
59
60 Name = text;
61 }
62};
65{
66 [Attribute()]
67 protected bool m_bInline;
68
69 bool IsInline()
70 {
71 return m_bInline;
72 }
73};
76{
77 override LocalizedString GetName()
78 {
79 return "<image set='{73BAE6966DBC17CB}UI/Imagesets/Hint/Hint.imageset' name='Bullet' scale='1'/>" + " " + super.GetName(); //--- ToDo: Don't hard-code
80 }
81};
84{
85 override LocalizedString GetName()
86 {
87 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
88 }
89};
92{
93 [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum("Any", "0"), ParamEnum("Mouse & Keyboard", "1"), ParamEnum("Gamepad", "2")})]
94 protected int m_iDevice;
95
96 override bool HasName()
97 {
98 bool isInputMatch = true;
99 switch (m_iDevice)
100 {
101 case 1: isInputMatch = GetGame().GetInputManager().IsUsingMouseAndKeyboard(); break;
102 case 2: isInputMatch = !GetGame().GetInputManager().IsUsingMouseAndKeyboard(); break;
103 }
104 return isInputMatch;
105 }
106};
109{
110 [Attribute()]
111 protected string m_sActionName;
112
113 protected const string m_sDelimiter = "<br/>";
114
116 {
117 //--- ToDo: Turn color conversion to general function
118 Color sRGBA = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
119
120 return super.GetName() + m_sDelimiter + m_sDelimiter + string.Format("<color rgba=%2><action name='%1' scale='1.7'/></color>", m_sActionName, UIColors.FormatColor(sRGBA)) + m_sDelimiter;
121 }
122};
125{
126 [Attribute()]
127 protected ref array<ref SCR_KeyBlockEntry> m_aKeys;
128
129 protected const LocalizedString m_sHoldModifier = "#ENF-HoldModifier";
130 protected const LocalizedString m_sDoubleModifier = "#ENF-DoubleModifier";
131 protected const LocalizedString m_sComboModifier = "#ENF-ComboModifier";
132 protected const LocalizedString m_sEllipsisModifier = "..."; //--- ToDo: Localize
133 protected const LocalizedString m_sDelimiter = "<br/>"; //--- ToDo: Localize
134
136 {
137 //--- ToDo: Turn color conversion to general function
138 Color sRGBA = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
139
140 LocalizedString keys;
141 foreach (int i, SCR_KeyBlockEntry entry: m_aKeys)
142 {
143 if (i > 0)
144 {
145 switch (entry.m_iDelimiter)
146 {
147 case 0: keys += m_sComboModifier; break;
148 case 1: keys += m_sEllipsisModifier; break;
149 }
150 }
151
152 switch (entry.m_iModifier)
153 {
154 case 1: keys += m_sHoldModifier; break;
155 case 2: keys += m_sDoubleModifier; break;
156 }
157 keys += string.Format("<%2 name='%1' scale='1.7'/>", entry.m_sKey, entry.m_Tag);
158 }
159 return super.GetName() + m_sDelimiter + m_sDelimiter + string.Format("<color rgba='%2'>%1</color>", keys, UIColors.FormatColor(sRGBA)) + m_sDelimiter;
160 }
161};
164{
165 [Attribute()]
166 string m_sKey;
167
168 [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum(" + ", "0"), ParamEnum("...", "1")})]
169 int m_iDelimiter;
170
171 [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum("None", "0"), ParamEnum("Hold", "1"), ParamEnum("Double", "2")})]
172 int m_iModifier;
173
174 [Attribute("key", uiwidget: UIWidgets.ComboBox, enums: { ParamEnum("key", "key"), ParamEnum("action", "action")})]
175 string m_Tag;
176};
177
180{
181 [Attribute("0", uiwidget: UIWidgets.Flags, enums: { ParamEnum("<p>", "1"), ParamEnum("<b>", "2"), ParamEnum("<i>", "4"), ParamEnum("<h1>", "8"), ParamEnum("<h2>", "16") })]
182 protected int m_iTags;
183
185 {
186 LocalizedString text;
187
188 if (m_iTags & 1) text += "<p>";
189 if (m_iTags & 2) text += "<b>";
190 if (m_iTags & 4) text += "<i>";
191 if (m_iTags & 8) text += "<h1>";
192 if (m_iTags & 16) text += "<h2>";
193
194 text += super.GetName();
195
196 if (m_iTags & 1) text += "</p>";
197 if (m_iTags & 2) text += "</b>";
198 if (m_iTags & 4) text += "</i>";
199 if (m_iTags & 8) text += "</h1>";
200 if (m_iTags & 16) text += "</h2>";
201
202 return text;
203 }
204
205 override bool IsInline()
206 {
207 return super.IsInline() || m_iTags & 1; //--- <p> is always inline, we don't want extra <br/> there
208 }
209};
210
213{
214 [Attribute(params: "imageset", uiwidget: UIWidgets.ResourcePickerThumbnail)]
216
217 [Attribute(desc: "This defines name of the image in the set.")]
218 protected string m_sImage;
219
220 [Attribute(desc: "Defines the scale of the Icon.", defvalue: "1")]
221 protected float m_fScale;
222
223 [Attribute(defvalue: "1 1 1 1")]
224 protected ref Color m_fColor;
225
226 //------------------------------------------------------------------------------------------------
228 {
229 if (m_sImage == string.Empty)
230 {
231 Print("HINT SYSTEM: No Icon name defined! Check 'Image'!", LogLevel.WARNING);
232 return string.Empty;
233 }
234
235 return string.Format("<color rgba=%1><image set='%2' name='%3' scale='%4'/></color>", UIColors.FormatColor(m_fColor), m_sImageSet, m_sImage, m_fScale) + "</br>";
236 }
237}
238
239/*
240[BaseContainerProps(), SCR_BaseContainerLocalizedTitleField("Name")]
241class SCR_TagBlockUIName: SCR_SubBlockUIName
242{
243 [Attribute()]
244 protected ref array<ref SCR_BaseTagBlockEntry> m_aTags;
245
246 override LocalizedString GetName()
247 {
248 LocalizedString text;
249 int tagCount = m_aTags.Count();
250 for (int i; i < tagCount; i++)
251 {
252 text += m_aTags[i].GetStart();
253 }
254
255 text += super.GetName();
256
257 for (int i; i < tagCount; i++)
258 {
259 text += m_aTags[i].GetEnd();
260 }
261 return text;
262 }
263}
264
265[BaseContainerProps()]
266class SCR_BaseTagBlockEntry
267{
268 string GetStart();
269 string GetEnd();
270}
271[BaseContainerProps()]
272class SCR_CustomTagBlockEntry: SCR_BaseTagBlockEntry
273{
274 [Attribute()]
275 protected string m_sStart;
276
277 [Attribute()]
278 protected string m_sEnd;
279
280 override string GetStart() { return m_sStart; }
281 override string GetEnd() { return m_sEnd; }
282}
283[BaseContainerProps()]
284class SCR_BoldTagBlockEntry: SCR_BaseTagBlockEntry
285{
286 override string GetStart() { return "<b>"; }
287 override string GetEnd() { return "</b>"; }
288}
289[BaseContainerProps()]
290class SCR_ItalicTagBlockEntry: SCR_BaseTagBlockEntry
291{
292 override string GetStart() { return "<i>"; }
293 override string GetEnd() { return "</i>"; }
294}
295[BaseContainerProps()]
296class SCR_HeaderTagBlockEntry: SCR_BaseTagBlockEntry
297{
298 override string GetStart() { return "<h1>"; }
299 override string GetEnd() { return "</h1>"; }
300}
301[BaseContainerProps()]
302class SCR_SubHeaderTagBlockEntry: SCR_BaseTagBlockEntry
303{
304 override string GetStart() { return "<h2>"; }
305 override string GetEnd() { return "</h2>"; }
306}
307*/
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_PlayerCommandingConfigActionPair Managed SCR_BaseContainerLocalizedTitleField("m_sCommandName")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
override LocalizedString GetName()
LocalizedString GetUnformattedDescriptionBlockName(int index)
override LocalizedString GetDescription()
override bool HasDescription()
void SetDescriptionBlockName(int index, LocalizedString text)
ref array< ref SCR_SubBlockUIName > m_aDescriptionBlocks
override bool HasName()
override LocalizedString GetName()
const LocalizedString m_sComboModifier
override LocalizedString GetName()
const LocalizedString m_sHoldModifier
const LocalizedString m_sDelimiter
const LocalizedString m_sEllipsisModifier
ref array< ref SCR_KeyBlockEntry > m_aKeys
const LocalizedString m_sDoubleModifier
override LocalizedString GetName()
LocalizedString Name
Definition SCR_UIName.c:8
bool HasName()
Definition SCR_UIName.c:39
LocalizedString GetName()
Definition SCR_UIName.c:31
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute