mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Changed to LoadComponentAsync call instead of adding an AsyncLoadWrapper instance.
This commit is contained in:
parent
7c65048ae5
commit
a033eb46d3
@ -146,18 +146,17 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
loading = true;
|
||||
|
||||
Add(new AsyncLoadWrapper(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3")
|
||||
{
|
||||
OnLoadComplete = d =>
|
||||
LoadComponentAsync(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3"),
|
||||
d =>
|
||||
{
|
||||
// we may have been replaced by another loader
|
||||
// We may have been replaced by another loader
|
||||
if (trackLoader != d) return;
|
||||
|
||||
Preview = (d as TrackLoader)?.Preview;
|
||||
Playing.TriggerChange();
|
||||
loading = false;
|
||||
},
|
||||
}));
|
||||
Add(trackLoader);
|
||||
});
|
||||
}
|
||||
|
||||
private class TrackLoader : Drawable
|
||||
|
@ -316,18 +316,18 @@ namespace osu.Game.Overlays.Profile
|
||||
|
||||
private void loadUser()
|
||||
{
|
||||
coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user)
|
||||
LoadComponentAsync(new UserCoverBackground(user)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(200)
|
||||
})
|
||||
},
|
||||
ucb =>
|
||||
{
|
||||
Masking = true,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Depth = float.MaxValue
|
||||
ucb.Depth = float.MaxValue;
|
||||
coverContainer.Add(ucb);
|
||||
});
|
||||
|
||||
if (user.IsSupporter) supporterTag.Show();
|
||||
|
@ -228,16 +228,19 @@ namespace osu.Game.Screens.Multiplayer
|
||||
if (value != null)
|
||||
{
|
||||
coverContainer.FadeIn(transition_duration);
|
||||
coverContainer.Children = new[]
|
||||
|
||||
LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
}) { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
},
|
||||
bsc =>
|
||||
{
|
||||
bsc.RelativeSizeAxes = Axes.Both;
|
||||
coverContainer.Add(bsc);
|
||||
});
|
||||
|
||||
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
||||
beatmapDash.Text = @" - ";
|
||||
|
@ -329,17 +329,20 @@ namespace osu.Game.Screens.Multiplayer
|
||||
if (value != null)
|
||||
{
|
||||
coverContainer.FadeIn(transition_duration);
|
||||
coverContainer.Children = new[]
|
||||
|
||||
LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
}) { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
},
|
||||
bsc =>
|
||||
{
|
||||
bsc.RelativeSizeAxes = Axes.Both;
|
||||
coverContainer.Add(bsc);
|
||||
});
|
||||
|
||||
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
||||
beatmapDash.Text = @" - ";
|
||||
|
@ -248,7 +248,8 @@ namespace osu.Game.Screens.Play
|
||||
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
|
||||
storyboard.Masking = true;
|
||||
|
||||
storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard);
|
||||
if (asyncLoad) LoadComponentAsync(storyboard, s => storyboardContainer.Add(s));
|
||||
else storyboardContainer.Add((Drawable)storyboard);
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
|
Loading…
Reference in New Issue
Block a user