Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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 
48 class SCR_BaseFormatParam
49 {
50  //------------------------------------------------------------------------------------------------
51  string GetParam();
52 }
53 
54 [BaseContainerProps(), SCR_BaseContainerCustomTitleField("m_sActionName", "Action: '%1'")]
55 class 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'")]
83 class 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 }
GetParam
override string GetParam()
Definition: SCR_FormatUIInfo.c:9
m_ImageSet
ResourceName m_ImageSet
Definition: SCR_ButtonEffectImage.c:3
GetName
string GetName()
Definition: SCR_ScenarioFrameworkLayerBase.c:85
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_FormatUIInfo
Definition: SCR_FormatUIInfo.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_BaseContainerCustomTitleResourceName
SCR_ActionFormatParam SCR_BaseFormatParam SCR_BaseContainerCustomTitleResourceName("m_ImageSet", true, "ImageSet: '%1'")
Definition: SCR_FormatUIInfo.c:82
SCR_BlockUIInfo
Definition: SCR_BlockUIInfo.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
UIColors
Definition: Constants.c:16
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_BaseContainerCustomTitleField
SCR_Faction ScriptedFaction SCR_BaseContainerCustomTitleField("m_sCallsign")
Definition: SCR_Faction.c:672
m_aParams
protected ref array< ref SCR_BaseFormatParam > m_aParams
Definition: SCR_FormatUIInfo.c:3
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_ActionFormatParam
Definition: SCR_FormatUIInfo.c:55
m_sName
protected LocalizedString m_sName
Definition: SCR_GroupIdentityComponent.c:19
BaseContainerProps
SCR_FormatUIInfo SCR_BlockUIInfo BaseContainerProps()] class SCR_BaseFormatParam
Definition: SCR_FormatUIInfo.c:47