Fix selection not being reset correct when changing between rulesets

Carousels filtered to results with no maps visible were not being handled correctly in a few different ways. This covers all those scenarios.
This commit is contained in:
Dean Herbert 2017-07-20 15:12:20 +09:00
parent 8417e59de3
commit a59557f039
2 changed files with 8 additions and 8 deletions

View File

@ -133,7 +133,7 @@ namespace osu.Game.Screens.Select
public void SelectNext(int direction = 1, bool skipDifficulties = true)
{
if (groups.Count == 0)
if (groups.Count == 0 || groups.All(g => g.State == BeatmapGroupState.Hidden))
{
selectedGroup = null;
selectedPanel = null;

View File

@ -229,6 +229,13 @@ namespace osu.Game.Screens.Select
changeBackground(Beatmap.Value);
};
selectionChangedDebounce?.Cancel();
if (beatmap?.Equals(beatmapNoDebounce) == true)
return;
beatmapNoDebounce = beatmap;
if (beatmap == null)
{
if (!Beatmap.IsDefault)
@ -236,18 +243,11 @@ namespace osu.Game.Screens.Select
}
else
{
selectionChangedDebounce?.Cancel();
if (beatmap.Equals(beatmapNoDebounce))
return;
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
sampleChangeBeatmap.Play();
beatmapNoDebounce = beatmap;
if (beatmap == Beatmap.Value.BeatmapInfo)
performLoad();
else