Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ServerInfoUIComponent.c
Go to the documentation of this file.
1 class SCR_ServerInfoUIComponent : ScriptedWidgetComponent
2 {
3  protected SCR_ServerInfoEditorComponent m_ServerInfoManager;
4 
5  protected TextWidget m_Text;
6 
7  //------------------------------------------------------------------------------------------------
8  protected void OnReceive(int fps, int memoryKB, int tickCount)
9  {
10  int memoryMB = memoryKB / 1024;
11  string uptime = SCR_FormatHelper.GetTimeFormatting(tickCount * 0.001);
12 
13  m_Text.SetTextFormat("FPS: %1<br />Uptime: %2<br />Memory: %3 MB", fps, uptime, memoryMB);
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override void HandlerAttached(Widget w)
18  {
19  m_Text = TextWidget.Cast(w);
20  m_Text.SetText(string.Empty);
21 
23  if (m_ServerInfoManager)
24  m_ServerInfoManager.GetOnReceive().Insert(OnReceive);
25  }
26 
27  //------------------------------------------------------------------------------------------------
28  override void HandlerDeattached(Widget w)
29  {
30  if (m_ServerInfoManager)
31  m_ServerInfoManager.GetOnReceive().Remove(OnReceive);
32  }
33 }
SCR_FormatHelper
Definition: SCR_FormatHelper.c:1
SCR_ServerInfoEditorComponent
Definition: SCR_ServerInfoEditorComponent.c:5
SCR_ServerInfoUIComponent
Definition: SCR_ServerInfoUIComponent.c:1