1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:42:54 +08:00

Merge pull request #24929 from peppy/reduce-song-select-debounce

Reduce delay before loading beatmap after selection change at song select
This commit is contained in:
Bartłomiej Dach 2023-09-28 10:45:43 +02:00 committed by GitHub
commit afa1815d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -312,7 +312,9 @@ namespace osu.Game.Tests.Visual.SongSelect
{
createSongSelect();
addRulesetImportStep(0);
// We need to use one real beatmap to trigger the "same-track-transfer" logic that we're looking to test here.
// See `SongSelect.ensurePlayingSelected` and `WorkingBeatmap.TryTransferTrack`.
AddStep("import test beatmap", () => manager.Import(new ImportTask(TestResources.GetTestBeatmapForImport())).WaitSafely());
addRulesetImportStep(0);
checkMusicPlaying(true);
@ -321,6 +323,8 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("manual pause", () => music.TogglePause());
checkMusicPlaying(false);
// Track should not have changed, so music should still not be playing.
AddStep("select next difficulty", () => songSelect!.Carousel.SelectNext(skipDifficulties: false));
checkMusicPlaying(false);

View File

@ -525,7 +525,11 @@ namespace osu.Game.Screens.Select
if (beatmapInfoNoDebounce == null)
run();
else
selectionChangedDebounce = Scheduler.AddDelayed(run, 200);
{
// Intentionally slightly higher than repeat_tick_rate to avoid loading songs when holding left / right arrows.
// See https://github.com/ppy/osu-framework/blob/master/osu.Framework/Input/InputManager.cs#L44
selectionChangedDebounce = Scheduler.AddDelayed(run, 80);
}
if (beatmap?.Equals(beatmapInfoPrevious) != true)
{