Don't bail on no beatmaps in database.

This commit is contained in:
Dean Herbert 2016-10-14 13:32:08 +09:00 committed by Drew DeVault
parent 9b88798274
commit 9a66d766e9

View File

@ -51,6 +51,9 @@ namespace osu.Game.GameModes.Play
private void addBeatmapSets()
{
var sets = beatmaps.GetBeatmapSets();
if (sets.Length == 0) return;
foreach (var beatmapSet in sets)
addBeatmapSet(beatmapSet);
}
@ -112,9 +115,12 @@ namespace osu.Game.GameModes.Play
beatmaps = (game as OsuGameBase).Beatmaps;
beatmaps.BeatmapSetAdded += bset => Scheduler.Add(() => addBeatmapSet(bset));
addBeatmapSets();
var first = setList.Children.First() as BeatmapGroup;
first.Collapsed = false;
selectedBeatmapSet = first.BeatmapSet;
var first = setList.Children.FirstOrDefault() as BeatmapGroup;
if (first != null)
{
first.Collapsed = false;
selectedBeatmapSet = first.BeatmapSet;
}
}
protected override void Dispose(bool isDisposing)