Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_StatsPanel_FPS.c
Go to the documentation of this file.
2 {
5 };
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_Enum
Definition: SCR_Enum.c:1
SERVER
@ SERVER
Definition: SCR_StatsPanel_FPS.c:4
EStatsPanelFPS
EStatsPanelFPS
Definition: SCR_StatsPanel_FPS.c:1
SCR_FPSNetworkedStat
Definition: SCR_ServerFPSNetworkedStat.c:2
LOCAL
@ LOCAL
Definition: SCR_StatsPanel_FPS.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_StatsPanelBase
Definition: SCR_StatsPanelBase.c:18
m_PlayerController
SCR_CampaignNetworkComponentClass m_PlayerController
Takes care of Campaign-specific server <> client communication and requests.
SCR_BaseNetworkedStat
Definition: SCR_BaseNetworkedStat.c:2
SCR_StatsPanel_FPS
Definition: SCR_StatsPanel_FPS.c:7