Add FPS display toggling.

Kinda temporary but better than nothing.
This commit is contained in:
Dean Herbert
2017-05-03 20:34:53 +09:00
parent a036b059e8
commit 489f586887
3 changed files with 24 additions and 2 deletions

View File

@ -19,6 +19,7 @@ using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.Processing;
using osu.Game.Online.API;
using SQLite.Net;
using osu.Framework.Graphics.Performance;
namespace osu.Game
{
@ -44,6 +45,8 @@ namespace osu.Game
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
private Bindable<bool> fpsDisplayVisible;
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName { Version = new Version() };
public bool IsDeployedBuild => AssemblyName.Version.Major > 0;
@ -160,6 +163,15 @@ namespace osu.Game
},
}
});
// TODO: This is temporary until we reimplement the local FPS display.
// It's just to allow end-users to access the framework FPS display without knowing the shortcut key.
fpsDisplayVisible = LocalConfig.GetBindable<bool>(OsuConfig.ShowFpsDisplay);
fpsDisplayVisible.ValueChanged += val =>
{
FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None;
};
fpsDisplayVisible.TriggerChange();
}
public override void SetHost(GameHost host)