From d9bee958dd55cd6dffcf0c4513549ae78fc2090e Mon Sep 17 00:00:00 2001 From: mk56-spn Date: Fri, 3 Feb 2023 23:56:34 +0100 Subject: [PATCH 1/2] Stop ```BPMCounter.cs```'s value from going to 0 after failing. --- osu.Game/Screens/Play/HUD/BPMCounter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/BPMCounter.cs b/osu.Game/Screens/Play/HUD/BPMCounter.cs index c07b203341..5fcac6cd04 100644 --- a/osu.Game/Screens/Play/HUD/BPMCounter.cs +++ b/osu.Game/Screens/Play/HUD/BPMCounter.cs @@ -26,6 +26,9 @@ namespace osu.Game.Screens.Play.HUD [Resolved] private IGameplayClock gameplayClock { get; set; } = null!; + [Resolved] + private Player player { get; set; } = null!; + [BackgroundDependencyLoader] private void load(OsuColour colour) { @@ -38,7 +41,7 @@ namespace osu.Game.Screens.Play.HUD base.Update(); //We don't want it going to 0 when we pause. so we block the updates - if (gameplayClock.IsPaused.Value) return; + if (gameplayClock.IsPaused.Value || player.GameplayState.HasFailed) return; // We want to check Rate every update to cover windup/down Current.Value = beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(gameplayClock.CurrentTime).BPM * gameplayClock.Rate; From 88872cf1cf9dae9c4d9147c366727506db2e4c48 Mon Sep 17 00:00:00 2001 From: mk56-spn Date: Sat, 4 Feb 2023 00:53:54 +0100 Subject: [PATCH 2/2] Use ```GetTrueGameplayRate()``` to remove need for jank --- osu.Game/Screens/Play/HUD/BPMCounter.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/BPMCounter.cs b/osu.Game/Screens/Play/HUD/BPMCounter.cs index 5fcac6cd04..500ab0169f 100644 --- a/osu.Game/Screens/Play/HUD/BPMCounter.cs +++ b/osu.Game/Screens/Play/HUD/BPMCounter.cs @@ -26,9 +26,6 @@ namespace osu.Game.Screens.Play.HUD [Resolved] private IGameplayClock gameplayClock { get; set; } = null!; - [Resolved] - private Player player { get; set; } = null!; - [BackgroundDependencyLoader] private void load(OsuColour colour) { @@ -40,11 +37,8 @@ namespace osu.Game.Screens.Play.HUD { base.Update(); - //We don't want it going to 0 when we pause. so we block the updates - if (gameplayClock.IsPaused.Value || player.GameplayState.HasFailed) return; - // We want to check Rate every update to cover windup/down - Current.Value = beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(gameplayClock.CurrentTime).BPM * gameplayClock.Rate; + Current.Value = beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(gameplayClock.CurrentTime).BPM * gameplayClock.GetTrueGameplayRate(); } protected override OsuSpriteText CreateSpriteText()