Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FormatUIInfo.c
Go to the documentation of this file.
3{
4 [Attribute()]
5 protected ref array<ref SCR_BaseFormatParam> m_aParams;
6
7 //------------------------------------------------------------------------------------------------
8 override bool SetNameTo(TextWidget textWidget)
9 {
10 if (!textWidget)
11 return false;
12
13 if (m_aParams && !m_aParams.IsEmpty())
14 textWidget.SetTextFormat(GetName(), Param(0), Param(1), Param(2), Param(3), Param(4), Param(5), Param(6), Param(7), Param(8));
15 else
16 textWidget.SetText(GetName());
17 return true;
18 }
19
20 //------------------------------------------------------------------------------------------------
21 override bool SetDescriptionTo(TextWidget textWidget)
22 {
23 if (!textWidget)
24 return false;
25
26 if (m_aParams && !m_aParams.IsEmpty())
27 textWidget.SetTextFormat(GetDescription(), Param(0), Param(1), Param(2), Param(3), Param(4), Param(5), Param(6), Param(7), Param(8));
28 else
29 textWidget.SetText(GetDescription());
30
31 return true;
32 }
33
34 //------------------------------------------------------------------------------------------------
38 protected string Param(int index)
39 {
40 if (index < m_aParams.Count())
41 return m_aParams[index].GetParam();
42 else
43 return string.Empty;
44 }
45}
46
48class SCR_BaseFormatParam
50 //------------------------------------------------------------------------------------------------
51 string GetParam();
53
54[BaseContainerProps(), SCR_BaseContainerCustomTitleField("m_sActionName", "Action: '%1'")]
55class SCR_ActionFormatParam: SCR_BaseFormatParam
56{
57 [Attribute()]
58 protected string m_sActionName;
59
60 //[Attribute("0.760 0.384 0.08 1")]
61 //protected ref Color m_Color;
62
63 //------------------------------------------------------------------------------------------------
64 override string GetParam()
65 {
66 // TODO: Turn color conversion to a general method
67 Color sRGBA = Color.FromIntSRGB(UIColors.CONTRAST_COLOR.PackToInt());
68
69 //--- Convert to sRGBA format for rich text
70 sRGBA.LinearToSRGB();
71
72 //--- Convert to ints, no fractions allowed in rich text
73 int colorR = sRGBA.R() * 255;
74 int colorG = sRGBA.G() * 255;
75 int colorB = sRGBA.B() * 255;
76 int colorA = sRGBA.A() * 255;
77
78 return string.Format("<color rgba='%2,%3,%4,%5'><action name='%1' scale='1.25'/></color>", m_sActionName, colorR, colorG, colorB, colorA);
79 }
80}
81
82[BaseContainerProps(), SCR_BaseContainerCustomTitleResourceName("m_ImageSet", true, "ImageSet: '%1'")]
83class SCR_ImageSetFormatParam : SCR_BaseFormatParam
84{
85 [Attribute(uiwidget: UIWidgets.ResourceNamePicker, params: "imageset")]
86 protected ResourceName m_ImageSet;
87
88 [Attribute(desc: "")]
89 protected string m_sName;
90
91 //------------------------------------------------------------------------------------------------
92 override string GetParam()
93 {
94 return string.Format("<image set='%1' name='%2'/>", m_ImageSet, m_sName);
95 }
96}
ResourceName m_ImageSet
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_Faction ScriptedFaction SCR_BaseContainerCustomTitleField("m_sCallsign")
override string GetParam()
SCR_ActionFormatParam SCR_BaseFormatParam SCR_BaseContainerCustomTitleResourceName("m_ImageSet", true, "ImageSet: '%1'")
SCR_FormatUIInfo SCR_BlockUIInfo BaseContainerProps()] class SCR_BaseFormatParam
LocalizedString m_sName
string m_sActionName
SCR_PlayerCommandingConfigActionPair Managed SCR_BaseContainerLocalizedTitleField("m_sCommandName")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
override string GetParam()
override LocalizedString GetDescription()
string Param(int index)
ref array< ref SCR_BaseFormatParam > m_aParams
override bool SetDescriptionTo(TextWidget textWidget)
override bool SetNameTo(TextWidget textWidget)
LocalizedString GetName()
Definition SCR_UIName.c:31
SCR_FieldOfViewSettings Attribute