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

Actually load a beatmap for TestCaseEditorTimingTimeline

This commit is contained in:
smoogipooo 2017-09-20 15:40:42 +09:00
parent 01c3818ea0
commit 252121968d

View File

@ -34,6 +34,21 @@ namespace osu.Game.Tests.Visual
});
}
[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;