mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 21:13:22 +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:
commit
afa1815d13
@ -312,7 +312,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
createSongSelect();
|
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);
|
addRulesetImportStep(0);
|
||||||
|
|
||||||
checkMusicPlaying(true);
|
checkMusicPlaying(true);
|
||||||
@ -321,6 +323,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
AddStep("manual pause", () => music.TogglePause());
|
AddStep("manual pause", () => music.TogglePause());
|
||||||
checkMusicPlaying(false);
|
checkMusicPlaying(false);
|
||||||
|
|
||||||
|
// Track should not have changed, so music should still not be playing.
|
||||||
AddStep("select next difficulty", () => songSelect!.Carousel.SelectNext(skipDifficulties: false));
|
AddStep("select next difficulty", () => songSelect!.Carousel.SelectNext(skipDifficulties: false));
|
||||||
checkMusicPlaying(false);
|
checkMusicPlaying(false);
|
||||||
|
|
||||||
|
@ -525,7 +525,11 @@ namespace osu.Game.Screens.Select
|
|||||||
if (beatmapInfoNoDebounce == null)
|
if (beatmapInfoNoDebounce == null)
|
||||||
run();
|
run();
|
||||||
else
|
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)
|
if (beatmap?.Equals(beatmapInfoPrevious) != true)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user