Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_StatsPanel_FPS.c
Go to the documentation of this file.
6
8{
9 [Attribute(SCR_Enum.GetDefault(EStatsPanelFPS.LOCAL), UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EStatsPanelFPS))]
10 EStatsPanelFPS m_eFPSLocality;
11
12 SCR_NetworkedStatsComponent m_StatsComponent;
13 int m_iFPS;
14
15 //------------------------------------------------------------------------------------------------
16 override bool DisplayStartDrawInit(IEntity owner)
17 {
18 if (!super.DisplayStartDrawInit(owner))
19 return false;
20
21 /*
22 if (SCR_Global.IsEditMode())
23 return false;
24 */
25
26 m_StatsComponent = SCR_NetworkedStatsComponent.Cast(m_PlayerController.FindComponent(SCR_NetworkedStatsComponent));
27 m_StatsComponent.GetNetworkedStatPrefabData().GetOnStatsChanged(true).Insert(OnStatUpdate);
28
29 return true;
30 }
31
32 void OnStatUpdate(SCR_BaseNetworkedStat stat)
33 {
34 SCR_FPSNetworkedStat fpsStat = SCR_FPSNetworkedStat.Cast(stat);
35
36 if (!fpsStat)
37 return;
38
39 if (m_eFPSLocality == EStatsPanelFPS.LOCAL)
40 {
41 m_iFPS = fpsStat.GetLastCheckedLocalFPS();
42 }
43 else
44 {
45 m_iFPS = fpsStat.GetLastCheckedAuthorityFPS();
46 }
47 }
48
49 //------------------------------------------------------------------------------------------------
50 override protected float GetValue()
51 {
52 #ifdef DEBUG_STATS_PANELS
53 return Math.RandomInt(10,80);
54 #endif
55
56 return m_iFPS;
57 }
58}
SCR_FastTravelComponentClass m_PlayerController
EStatsPanelFPS
@ SERVER
Definition Math.c:13
SCR_FieldOfViewSettings Attribute
@ LOCAL
Entity is not a legit editable entity, but merely a light-weight preview posing as an editable entity...