Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_StatsPanel_ServerName.c
Go to the documentation of this file.
2{
3 protected string m_sServerName;
4 protected const float OPACITY = 0.5;
5 protected ServerInfo m_ServerInfo = GetGame().GetServerInfo();
6
7 //------------------------------------------------------------------------------------------------
8 override bool DisplayStartDrawInit(IEntity owner)
9 {
10 super.DisplayStartDrawInit(owner);
11
12 if (m_ServerInfo != null)
13 m_sServerName = m_ServerInfo.GetName();
14
15 return !m_sServerName.IsEmpty();
16 }
17
18 //------------------------------------------------------------------------------------------------
19 override void DisplayStartDraw(IEntity owner)
20 {
21 if (!m_wRoot)
22 return;
23
25 m_Widgets.Init(m_wRoot);
26
27 Update(0);
28
29 m_Widgets.m_wLabel.SetText(m_sServerName);
30 }
31
32 //------------------------------------------------------------------------------------------------
33 override void DisplayUpdate(IEntity owner, float timeSlice)
34 {
35 //~ No need to update as server name is only set once
36 }
37
38 //------------------------------------------------------------------------------------------------
39 override protected void Update(float value)
40 {
41 // Get visialization attributes based on the new state
42 Color color = GUIColors.DEFAULT;
43 Color colorGlow = GUIColors.DEFAULT_GLOW;
44 string icon = m_sIconOK;
45
46 // Set global color & opacity
47 m_Widgets.m_wColorOpacity.SetOpacity(OPACITY);
48 m_Widgets.m_wColorOpacity.SetColor(color);
49
50 // Set icon & glow
51 m_Widgets.m_wIcon.LoadImageFromSet(0, UIConstants.ICONS_IMAGE_SET, icon);
52 m_Widgets.m_wIconGlow.LoadImageFromSet(0, UIConstants.ICONS_GLOW_IMAGE_SET, icon);
53 m_Widgets.m_wIconGlow.SetColor(colorGlow);
54
55 OverlayWidget textWidget = OverlayWidget.Cast(m_wRoot.FindAnyWidget("Text"));
56 textWidget.SetVisible(false);
57 }
58}
ArmaReforgerScripted GetGame()
Definition game.c:1398
Widget m_wRoot
Definition Color.c:13
override void DisplayStartDraw(IEntity owner)
override bool DisplayStartDrawInit(IEntity owner)
override void DisplayUpdate(IEntity owner, float timeSlice)
ref SCR_StatsPanelWidgets m_Widgets