-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGameStats.cs
More file actions
27 lines (25 loc) · 868 Bytes
/
GameStats.cs
File metadata and controls
27 lines (25 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace AlweStats {
public static class GameStats {
private static Block gameBlock = null;
public static Block Start() {
gameBlock = new Block(
"GameStats",
Main.gameStatsColor.Value,
Main.gameStatsSize.Value,
Main.gameStatsPosition.Value,
Main.gameStatsMargin.Value,
Main.gameStatsAlign.Value
);
return gameBlock;
}
public static void Update() {
if (gameBlock != null) {
ConnectPanel.instance.UpdateFps();
float fps = float.Parse(ConnectPanel.instance.m_fps.text);
if (fps != 9999f) {
gameBlock.SetText(string.Format(Main.gameStatsFormat.Value, $"{fps:0}"));
}
}
}
}
}