mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Refactor BeatmapInfoWedge to be async.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user