From 502940ddf3cb372457de78d2bb6d532e7ef2e2d6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 14 Oct 2017 05:05:38 +0300 Subject: [PATCH] Fix deleting last visible beatmap doesn't trigger selecting null beatmap --- osu.Game/Screens/Select/BeatmapCarousel.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 245dfb091c..326b632630 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -181,13 +181,18 @@ namespace osu.Game.Screens.Select public Action HideDifficultyRequested; + private void selectNullBeatmap() + { + selectedGroup = null; + selectedPanel = null; + SelectionChanged?.Invoke(null); + } + public void SelectNext(int direction = 1, bool skipDifficulties = true) { if (groups.All(g => g.State == BeatmapGroupState.Hidden)) { - selectedGroup = null; - selectedPanel = null; - SelectionChanged?.Invoke(null); + selectNullBeatmap(); return; } @@ -376,7 +381,12 @@ namespace osu.Game.Screens.Select return; if (selectedGroup == group) - SelectNext(); + { + if (getVisibleGroups().Count() == 1) + selectNullBeatmap(); + else + SelectNext(); + } groups.Remove(group); panels.Remove(group.Header);