From 09adb23591fb4b393dde7ca84d919c0ff3c8aaa7 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Wed, 24 May 2017 02:22:30 +0200 Subject: [PATCH 1/4] Fix scheduled task not being canceled --- osu.Game/Screens/Select/SongSelect.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index e9ead7c9c0..eb5fb6d258 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -319,7 +319,10 @@ namespace osu.Game.Screens.Select bool beatmapSetChange = false; if (beatmap.Equals(Beatmap?.BeatmapInfo)) + { + selectionChangedDebounce?.Cancel(); return; + } if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID) sampleChangeDifficulty.Play(); @@ -330,7 +333,7 @@ namespace osu.Game.Screens.Select } selectionChangeNoBounce = beatmap; - + selectionChangedDebounce?.Cancel(); selectionChangedDebounce = Scheduler.AddDelayed(delegate { From 0616256bd06f32b6199a6e883afca839505eff57 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Wed, 24 May 2017 02:23:52 +0200 Subject: [PATCH 2/4] CI fix --- osu.Game/Screens/Select/SongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index eb5fb6d258..7c45738d59 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -333,7 +333,7 @@ namespace osu.Game.Screens.Select } selectionChangeNoBounce = beatmap; - + selectionChangedDebounce?.Cancel(); selectionChangedDebounce = Scheduler.AddDelayed(delegate { From 67774192dd5635c9777c103afc5da6b475cc778f Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Wed, 24 May 2017 02:30:32 +0200 Subject: [PATCH 3/4] Formatting fixes --- osu.Game/Screens/Select/SongSelect.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 7c45738d59..d0c5e1adfd 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -316,13 +316,12 @@ namespace osu.Game.Screens.Select /// private void selectionChanged(BeatmapInfo beatmap) { - bool beatmapSetChange = false; + selectionChangedDebounce?.Cancel(); if (beatmap.Equals(Beatmap?.BeatmapInfo)) - { - selectionChangedDebounce?.Cancel(); return; - } + + bool beatmapSetChange = false; if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID) sampleChangeDifficulty.Play(); @@ -334,7 +333,6 @@ namespace osu.Game.Screens.Select selectionChangeNoBounce = beatmap; - selectionChangedDebounce?.Cancel(); selectionChangedDebounce = Scheduler.AddDelayed(delegate { Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); From 24f64c881556e46ef210c76f38d883aed9a79b51 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Wed, 24 May 2017 02:38:05 +0200 Subject: [PATCH 4/4] More formatting --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 2d6d212130..130642b9c7 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -170,8 +170,8 @@ namespace osu.Game.Screens.Select List visibleGroups = groups.Where(selectGroup => selectGroup.State != BeatmapGroupState.Hidden).ToList(); if (visibleGroups.Count < 1) return; - BeatmapGroup group = visibleGroups[RNG.Next(visibleGroups.Count)]; + BeatmapGroup group = visibleGroups[RNG.Next(visibleGroups.Count)]; BeatmapPanel panel = group.BeatmapPanels[RNG.Next(group.BeatmapPanels.Count)]; selectGroup(group, panel); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index d0c5e1adfd..41fa53e8a3 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -322,7 +322,6 @@ namespace osu.Game.Screens.Select return; bool beatmapSetChange = false; - if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID) sampleChangeDifficulty.Play(); else