Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MultiTextTooltipUIComponent.c
Go to the documentation of this file.
1 class SCR_MultiTextTooltipUIComponent : ScriptedWidgetComponent
2 {
3  [Attribute(defvalue: "1 1 1 1", desc: "Color of Text.")]
4  protected ref Color m_cTextColor;
5 
6  [Attribute("")]
7  protected ResourceName m_TextPrefab;
8 
9  protected Widget m_wRoot;
10 
11  //------------------------------------------------------------------------------------------------
13  void ClearAllText()
14  {
15  if (!m_wRoot)
16  return;
17 
18  Widget child = m_wRoot.GetChildren();
19  Widget childtemp;
20  while (child)
21  {
22  childtemp = child;
23  child = child.GetSibling();
24  childtemp.RemoveFromHierarchy();
25  }
26  }
27 
28  //------------------------------------------------------------------------------------------------
30  void SetInitTextColor(Color color)
31  {
32  m_cTextColor = color;
33  }
34 
35  //------------------------------------------------------------------------------------------------
43  TextWidget AddText(string text, string param1 = string.Empty, string param2 = string.Empty, string param3 = string.Empty, string param4 = string.Empty)
44  {
45  if (!m_wRoot)
46  return null;
47 
48  Widget newWidget = GetGame().GetWorkspace().CreateWidgets(m_TextPrefab, m_wRoot);
49  if (!newWidget)
50  return null;
51 
52  TextWidget textWidget = TextWidget.Cast(newWidget);
53  if (!textWidget)
54  return null;
55 
56  textWidget.SetColor(m_cTextColor);
57  textWidget.SetTextFormat(text, param1, param2, param3, param4);
58  return textWidget;
59  }
60 
61  //------------------------------------------------------------------------------------------------
62  override void HandlerAttached(Widget w)
63  {
64  m_wRoot = w;
65  }
66 }
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_MultiTextTooltipUIComponent
Definition: SCR_MultiTextTooltipUIComponent.c:1