From 9b360e5ea98d5f77607b367c0249105b8e5590d3 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Tue, 12 Aug 2025 11:05:13 +0300 Subject: [PATCH] Adjust offset text and fix incorrect display in certain scenarios --- .../Play/PlayerSettings/BeatmapOffsetControl.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index d876f6223d..de8de8af24 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -266,11 +266,15 @@ namespace osu.Game.Screens.Play.PlayerSettings if (config.Get(OsuSetting.AutomaticallyAdjustBeatmapOffset)) { - applySuggestedOffset(proportionalToUnstableRate: true); + bool offsetChanged = applySuggestedOffset(proportionalToUnstableRate: true); + calibrateFromLastPlayButton.Hide(); - offsetText.AddText($"Beatmap offset has automatically been adjusted to {Current.Value.ToStandardFormattedString(1)} ms.", t => t.Font = OsuFont.Style.Caption1); - offsetText.NewParagraph(); + if (offsetChanged) + { + offsetText.AddText($"Beatmap offset was adjusted to {Current.Value.ToStandardFormattedString(1)} ms.", t => t.Font = OsuFont.Style.Caption1); + offsetText.NewParagraph(); + } } offsetText.AddText("You can also ", t => t.Font = OsuFont.Style.Caption2); @@ -278,7 +282,7 @@ namespace osu.Game.Screens.Play.PlayerSettings offsetText.AddText(" based off this play.", t => t.Font = OsuFont.Style.Caption2); } - private void applySuggestedOffset(bool proportionalToUnstableRate) + private bool applySuggestedOffset(bool proportionalToUnstableRate) { const double ur_adjustment_cutoff = 90; const double exponential_factor = -0.0116; @@ -292,6 +296,8 @@ namespace osu.Game.Screens.Play.PlayerSettings Current.Value = lastPlayBeatmapOffset - offsetAdjustment; lastAppliedScore.Value = lastValidScore; + + return Math.Abs(Current.Value - lastPlayBeatmapOffset) > Current.Precision; } [Resolved]