Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ListTooltipComponent.c
Go to the documentation of this file.
1 
5 {
6  [Attribute("{F6609064A9ECD900}UI/layouts/Menus/Tooltips/Tooltip_ListLine_NoBG_Medium.layout")]
7  protected ResourceName m_sLineLayout;
8 
9  protected VerticalLayoutWidget m_wListWrapper;
10  protected Widget m_wSeparator;
11  protected ref array<string> m_aMessages = {};
12 
13  //------------------------------------------------------------------------------------------------
14  protected override void HandlerAttached(Widget w)
15  {
16  m_wListWrapper = VerticalLayoutWidget.Cast(w.FindAnyWidget("List"));
17  if (m_wListWrapper && GetGame().InPlayMode())
18  m_wListWrapper.SetVisible(false);
19 
20  m_wSeparator = w.FindAnyWidget("Separator");
21 
22  super.HandlerAttached(w);
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  void Init(array<string> messages, bool showSeparator = false)
27  {
28  if (!m_wListWrapper)
29  return;
30 
31  m_wListWrapper.SetVisible(!messages.IsEmpty());
32  m_wSeparator.SetVisible(showSeparator);
33 
34  foreach (string message : messages)
35  {
36  if (!m_aMessages.IsEmpty() && m_aMessages.Contains(message))
37  continue;
38 
39  Widget w = GetGame().GetWorkspace().CreateWidgets(m_sLineLayout, m_wListWrapper);
40  if (!w)
41  continue;
42 
43  TextWidget text = TextWidget.Cast(w.FindAnyWidget("Text"));
44  if (text)
45  text.SetText(message);
46 
47  m_aMessages.Insert(message);
48  }
49  }
50 
51  //------------------------------------------------------------------------------------------------
52  static SCR_ListTooltipComponent FindComponent(notnull Widget w)
53  {
54  return SCR_ListTooltipComponent.Cast(w.FindHandler(SCR_ListTooltipComponent));
55  }
56 }
SCR_ListTooltipComponent
Definition: SCR_ListTooltipComponent.c:4
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7