Fix deleting last visible beatmap doesn't trigger selecting null beatmap

This commit is contained in:
EVAST9919
2017-10-14 05:05:38 +03:00
parent c5de97a06f
commit 502940ddf3

View File

@ -181,13 +181,18 @@ namespace osu.Game.Screens.Select
public Action<BeatmapInfo> HideDifficultyRequested; public Action<BeatmapInfo> HideDifficultyRequested;
public void SelectNext(int direction = 1, bool skipDifficulties = true) private void selectNullBeatmap()
{
if (groups.All(g => g.State == BeatmapGroupState.Hidden))
{ {
selectedGroup = null; selectedGroup = null;
selectedPanel = null; selectedPanel = null;
SelectionChanged?.Invoke(null); SelectionChanged?.Invoke(null);
}
public void SelectNext(int direction = 1, bool skipDifficulties = true)
{
if (groups.All(g => g.State == BeatmapGroupState.Hidden))
{
selectNullBeatmap();
return; return;
} }
@ -376,7 +381,12 @@ namespace osu.Game.Screens.Select
return; return;
if (selectedGroup == group) if (selectedGroup == group)
{
if (getVisibleGroups().Count() == 1)
selectNullBeatmap();
else
SelectNext(); SelectNext();
}
groups.Remove(group); groups.Remove(group);
panels.Remove(group.Header); panels.Remove(group.Header);