Actually load a beatmap for TestCaseEditorTimingTimeline

This commit is contained in:
smoogipooo 2017-09-20 15:40:42 +09:00
parent 01c3818ea0
commit 252121968d
1 changed files with 15 additions and 0 deletions

View File

@ -34,6 +34,21 @@ public TestCaseEditorTimingTimeline()
});
}
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame, BeatmapManager beatmaps)
{
BeatmapSetInfo setInfo = null;
var sets = beatmaps.GetAllUsableBeatmapSets(false);
if (sets.Count > 0)
setInfo = beatmaps.QueryBeatmapSet(s => s.ID == sets[RNG.Next(0, sets.Count - 1)].ID);
if (setInfo == null)
return;
osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
}
private class TimingTimeline : CompositeDrawable
{
private const float corner_radius = 5;