Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ServerInfoUIComponent.c
Go to the documentation of this file.
2{
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
24 m_ServerInfoManager.GetOnReceive().Insert(OnReceive);
25 }
26
27 //------------------------------------------------------------------------------------------------
28 override void HandlerDeattached(Widget w)
29 {
31 m_ServerInfoManager.GetOnReceive().Remove(OnReceive);
32 }
33}
override void HandlerAttached(Widget w)
override void HandlerDeattached(Widget w)
SCR_ServerInfoEditorComponent m_ServerInfoManager
void OnReceive(int fps, int memoryKB, int tickCount)