mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 05:53:10 +08:00
Add FPS display toggling.
Kinda temporary but better than nothing.
This commit is contained in:
parent
a036b059e8
commit
489f586887
@ -53,6 +53,8 @@ namespace osu.Game.Configuration
|
||||
|
||||
// Graphics
|
||||
|
||||
Set(OsuConfig.ShowFpsDisplay, false);
|
||||
|
||||
Set(OsuConfig.MenuParallax, true);
|
||||
|
||||
Set(OsuConfig.SnakingInSliders, true);
|
||||
@ -99,6 +101,7 @@ namespace osu.Game.Configuration
|
||||
DisplayStarsMinimum,
|
||||
DisplayStarsMaximum,
|
||||
SnakingInSliders,
|
||||
SnakingOutSliders
|
||||
SnakingOutSliders,
|
||||
ShowFpsDisplay
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -4,6 +4,8 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Options.Sections.Graphics
|
||||
{
|
||||
@ -12,7 +14,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
|
||||
protected override string Header => "Renderer";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager config)
|
||||
private void load(FrameworkConfigManager config, OsuConfigManager osuConfig)
|
||||
{
|
||||
// NOTE: Compatability mode omitted
|
||||
Children = new Drawable[]
|
||||
@ -23,6 +25,11 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
|
||||
LabelText = "Frame limiter",
|
||||
Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync)
|
||||
},
|
||||
new OsuCheckbox
|
||||
{
|
||||
LabelText = "Show FPS",
|
||||
Bindable = osuConfig.GetBindable<bool>(OsuConfig.ShowFpsDisplay)
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user