From 6ce76786ede893364bd2806931df2bf5e07b270c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Sep 2025 18:06:28 +0900 Subject: [PATCH] Better document various debounce constants and split out processing debounce for clarity --- .../BeatmapTitleWedge_DifficultyDisplay.cs | 2 +- osu.Game/Screens/SelectV2/PanelBeatmap.cs | 2 +- .../Screens/SelectV2/PanelBeatmapStandalone.cs | 2 +- osu.Game/Screens/SelectV2/SongSelect.cs | 16 ++++++++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/SelectV2/BeatmapTitleWedge_DifficultyDisplay.cs b/osu.Game/Screens/SelectV2/BeatmapTitleWedge_DifficultyDisplay.cs index 0e880a740f..55ed488d87 100644 --- a/osu.Game/Screens/SelectV2/BeatmapTitleWedge_DifficultyDisplay.cs +++ b/osu.Game/Screens/SelectV2/BeatmapTitleWedge_DifficultyDisplay.cs @@ -249,7 +249,7 @@ namespace osu.Game.Screens.SelectV2 mapperText.Text = beatmap.Value.Metadata.Author.Username; } - starRatingDisplay.Current = (Bindable)difficultyCache.GetBindableDifficulty(beatmap.Value.BeatmapInfo, cancellationSource.Token, SongSelect.SELECTION_DEBOUNCE); + starRatingDisplay.Current = (Bindable)difficultyCache.GetBindableDifficulty(beatmap.Value.BeatmapInfo, cancellationSource.Token, SongSelect.DIFFICULTY_CALCULATION_DEBOUNCE); updateCountStatistics(cancellationSource.Token); updateDifficultyStatistics(); diff --git a/osu.Game/Screens/SelectV2/PanelBeatmap.cs b/osu.Game/Screens/SelectV2/PanelBeatmap.cs index 106b911606..78b2fe7590 100644 --- a/osu.Game/Screens/SelectV2/PanelBeatmap.cs +++ b/osu.Game/Screens/SelectV2/PanelBeatmap.cs @@ -250,7 +250,7 @@ namespace osu.Game.Screens.SelectV2 var beatmap = (BeatmapInfo)Item.Model; - starDifficultyBindable = difficultyCache.GetBindableDifficulty(beatmap, starDifficultyCancellationSource.Token, SongSelect.SELECTION_DEBOUNCE); + starDifficultyBindable = difficultyCache.GetBindableDifficulty(beatmap, starDifficultyCancellationSource.Token, SongSelect.DIFFICULTY_CALCULATION_DEBOUNCE); starDifficultyBindable.BindValueChanged(starDifficulty => { starRatingDisplay.Current.Value = starDifficulty.NewValue; diff --git a/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs b/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs index 87a35facbd..9e31445a87 100644 --- a/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs +++ b/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs @@ -264,7 +264,7 @@ namespace osu.Game.Screens.SelectV2 var beatmap = (BeatmapInfo)Item.Model; - starDifficultyBindable = difficultyCache.GetBindableDifficulty(beatmap, starDifficultyCancellationSource.Token, SongSelect.SELECTION_DEBOUNCE); + starDifficultyBindable = difficultyCache.GetBindableDifficulty(beatmap, starDifficultyCancellationSource.Token, SongSelect.DIFFICULTY_CALCULATION_DEBOUNCE); starDifficultyBindable.BindValueChanged(starDifficulty => { starRatingDisplay.Current.Value = starDifficulty.NewValue; diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 9346c9c4f3..dc1cede819 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -63,10 +63,21 @@ namespace osu.Game.Screens.SelectV2 [Cached(typeof(ISongSelect))] public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler, ISongSelect { - // this is intentionally slightly higher than key repeat, but low enough to not impede user experience. - // this avoids rapid churn loading when iterating the carousel using keyboard. + /// + /// A debounce that governs how long after a panel is selected before the rest of song select (and the game at large) + /// updates to show that selection. + /// + /// This is intentionally slightly higher than key repeat, but low enough to not impede user experience. + /// public const int SELECTION_DEBOUNCE = 150; + /// + /// A general "global" debounce to be applied to anything aggressive difficulty calculation at song select, + /// either after selection or after a panel comes on screen. Value should be low enough that users don't complain, + /// but otherwise as high as possible to reduce overheads. + /// + public const int DIFFICULTY_CALCULATION_DEBOUNCE = 150; + private const float logo_scale = 0.4f; private const double fade_duration = 300; @@ -1035,6 +1046,7 @@ namespace osu.Game.Screens.SelectV2 return; onlineLookupCancellation?.Cancel(); + onlineLookupCancellation = null; if (beatmapSetInfo.OnlineID < 0) {