mirror of
https://github.com/osukey/osukey.git
synced 2025-06-06 20:15:29 +09:00
Remove AsyncLoadWrapper dependence
This commit is contained in:
parent
e7654254d2
commit
be9c99ade3
@ -26,7 +26,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
|
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
|
||||||
|
|
||||||
private Drawable beatmapInfoContainer;
|
private Drawable info;
|
||||||
|
|
||||||
public BeatmapInfoWedge()
|
public BeatmapInfoWedge()
|
||||||
{
|
{
|
||||||
@ -65,29 +65,34 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
var lastContainer = beatmapInfoContainer;
|
LoadComponentAsync(new BufferedWedgeInfo(beatmap)
|
||||||
float newDepth = lastContainer?.Depth + 1 ?? 0;
|
|
||||||
|
|
||||||
Add(beatmapInfoContainer = new AsyncLoadWrapper(
|
|
||||||
new BufferedWedgeInfo(beatmap)
|
|
||||||
{
|
{
|
||||||
Shear = -Shear,
|
Shear = -Shear,
|
||||||
OnLoadComplete = d =>
|
Depth = info?.Depth + 1 ?? 0,
|
||||||
|
}, newInfo =>
|
||||||
{
|
{
|
||||||
|
// ensure we ourselves are visible if not already.
|
||||||
|
if (!IsPresent)
|
||||||
this.FadeIn(250);
|
this.FadeIn(250);
|
||||||
|
|
||||||
lastContainer?.FadeOut(250);
|
info?.FadeOut(250);
|
||||||
lastContainer?.Expire();
|
info?.Expire();
|
||||||
}
|
|
||||||
})
|
Add(info = newInfo);
|
||||||
{
|
|
||||||
Depth = newDepth,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BufferedWedgeInfo : BufferedContainer
|
public class BufferedWedgeInfo : BufferedContainer
|
||||||
{
|
{
|
||||||
|
private readonly WorkingBeatmap beatmap;
|
||||||
|
|
||||||
public BufferedWedgeInfo(WorkingBeatmap beatmap)
|
public BufferedWedgeInfo(WorkingBeatmap beatmap)
|
||||||
|
{
|
||||||
|
this.beatmap = beatmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
{
|
{
|
||||||
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
|
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
|
||||||
BeatmapMetadata metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
|
BeatmapMetadata metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
|
||||||
@ -275,7 +280,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private class DifficultyColourBar : DifficultyColouredContainer
|
private class DifficultyColourBar : DifficultyColouredContainer
|
||||||
{
|
{
|
||||||
public DifficultyColourBar(BeatmapInfo beatmap) : base(beatmap)
|
public DifficultyColourBar(BeatmapInfo beatmap)
|
||||||
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user