Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_WidgetHintComponent.c
Go to the documentation of this file.
1 /*
2 Widget component for short message suggesting what needs to be done with widget.
3 */
4 
5 //------------------------------------------------------------------------------------------------
7 {
8  [Attribute("Icon", UIWidgets.EditBox, "Widget name to find icon")]
9  protected string m_sWidgetIcon;
10 
11  [Attribute("Message", UIWidgets.EditBox, "Widget name to find message text widget")]
12  protected string m_sWidgetMessage;
13 
14  [Attribute("Bumper", UIWidgets.EditBox, "Widget name to find message text widget")]
15  protected string m_sWidgetBumper;
16 
17  [Attribute("", UIWidgets.EditBox, "Default message to display")]
18  protected string m_sDefaultMessage;
19 
20  [Attribute("0", UIWidgets.EditBox, "True will set bumper widget to visible which will offest the message")]
21  protected bool m_bUseBumber;
22 
23  protected ImageWidget m_wIcon;
24  protected TextWidget m_wMessage;
25  protected Widget m_wBumper;
26 
27  //------------------------------------------------------------------------------------------------
28  override void HandlerAttached(Widget w)
29  {
30  super.HandlerAttached(w);
31 
32  m_wIcon = ImageWidget.Cast(w.FindAnyWidget(m_sWidgetIcon));
33  m_wMessage = TextWidget.Cast(w.FindAnyWidget(m_sWidgetMessage));
34  m_wBumper = w.FindAnyWidget(m_sWidgetBumper);
35 
36  UseDefaultMessage();
37 
38  if (m_wBumper)
39  m_wBumper.SetVisible(m_bUseBumber);
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  override void SetVisible(bool visible, bool animate = true)
44  {
45  if (animate)
46  {
47  if (!visible || m_wRoot.GetOpacity() == 0)
48  {
49  m_wRoot.SetVisible(visible);
50  return;
51  }
52  else if (visible || m_wRoot.GetOpacity() == 1)
53  {
54  m_wRoot.SetVisible(visible);
55  return;
56  }
57  }
58 
59  super.SetVisible(visible, animate);
60  }
61 
62  //-----------------------------------------------------------/-------------------------------------
63  // API
64  //------------------------------------------------------------------------------------------------
65 
66  //------------------------------------------------------------------------------------------------
67  void SetMessage(string message)
68  {
69  if (m_wMessage)
70  m_wMessage.SetText(message);
71  }
72 
73  //------------------------------------------------------------------------------------------------
74  string GetMessage()
75  {
76  return m_wMessage.GetText();
77  }
78 
79  //------------------------------------------------------------------------------------------------
80  void UseDefaultMessage()
81  {
82  if (m_wMessage)
83  m_wMessage.SetText(m_sDefaultMessage);
84  }
85 }
m_wIcon
protected ImageWidget m_wIcon
Definition: SCR_InventoryHitZonePointUI.c:374
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_WLibComponentBase
Base class for all final Reforger interactive elements.
Definition: SCR_WLibComponentBase.c:4
SCR_WidgetHintComponent
Definition: SCR_WidgetHintComponent.c:6
m_wMessage
protected RichTextWidget m_wMessage
Definition: SCR_BrowserHoverTooltipComponent.c:24
Attribute
typedef Attribute
Post-process effect of scripted camera.