1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 06:52:53 +08:00

Merge pull request #1035 from peppy/fix-empty-carousel

Fix selection not being reset correct when changing between rulesets
This commit is contained in:
Thomas Müller 2017-07-20 21:50:19 +02:00 committed by GitHub
commit 31ac083408
2 changed files with 9 additions and 7 deletions

View File

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

View File

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