Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ToolbarItemNotificationEditorUIComponent.c
Go to the documentation of this file.
1 class SCR_ToolbarItemNotificationEditorUIComponent : ScriptedWidgetComponent
2 {
3  [Attribute("Icon")]
4  protected string m_sIconWidgetName;
5 
6  [Attribute("Number")]
7  protected string m_sNumberWidgetName;
8 
9  [Attribute()]
10  protected ResourceName m_sDefaultIcon;
11 
12  protected Widget m_root;
13  protected ImageWidget m_IconWidget;
14  protected TextWidget m_NumberWidget;
15 
16  //------------------------------------------------------------------------------------------------
19  void SetNotification(int number, SCR_UIInfo info = null)
20  {
21  //Hide
22  if (number <= 0)
23  {
24  m_root.SetVisible(false);
25  }
26  //Custom image if one notification
27  else if (number == 1 && info && info.SetIconTo(m_IconWidget))
28  {
29  m_NumberWidget.SetVisible(false);
30  m_root.SetVisible(true);
31  }
32  //Default icon
33  else
34  {
35  m_IconWidget.LoadImageTexture(0, m_sDefaultIcon);
36  m_IconWidget.SetImage(0);
37  m_NumberWidget.SetText(number.ToString());
38  m_NumberWidget.SetVisible(true);
39  m_root.SetVisible(true);
40  }
41  }
42 
43  //------------------------------------------------------------------------------------------------
44  override void HandlerAttached(Widget w)
45  {
46  m_root = w;
47  m_IconWidget = ImageWidget.Cast(w.FindAnyWidget(m_sIconWidgetName));
48  m_NumberWidget = TextWidget.Cast(w.FindAnyWidget(m_sNumberWidgetName));
49  m_root.SetVisible(false);
50  }
51 }
m_sIconWidgetName
protected string m_sIconWidgetName
Definition: SCR_GroupEditableEntityUIComponent.c:6
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_UIInfo
Definition: SCR_UIInfo.c:7
SCR_ToolbarItemNotificationEditorUIComponent
Definition: SCR_ToolbarItemNotificationEditorUIComponent.c:1