Refactor BeatmapInfoWedge to be async.

This commit is contained in:
Dean Herbert
2016-11-24 13:48:48 +09:00
parent 1eb04ff11e
commit ece3bc0e01
5 changed files with 56 additions and 39 deletions

View File

@ -156,38 +156,17 @@ namespace osu.Game.Beatmaps.Drawables
[BackgroundDependencyLoader]
private void load(OsuGameBase game)
{
{
new BeatmapBackgroundSprite(working)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
}.Preload(game, (bg) =>
{
Add(bg);
ForceRedraw();
});
}
class BeatmapBackground : Sprite
{
private readonly WorkingBeatmap working;
public BeatmapBackground(WorkingBeatmap working)
{
this.working = working;
}
[BackgroundDependencyLoader]
private void load(OsuGameBase game)
{
Texture = working.Background;
}
protected override void LoadComplete()
{
base.LoadComplete();
Scale = new Vector2(1366 / (Texture?.Width ?? 1) * 0.6f);
}
}
}
}