1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-09 23:14:52 +08:00

Revert "Ensure DrawableMedal loading doesn't ever block on online resources"

This reverts commit 8585327858.
This commit is contained in:
Dean Herbert
2024-11-26 17:41:00 +09:00
Unverified
parent 1e6c04e98b
commit 98044c108e
+6 -28
View File
@@ -28,14 +28,16 @@ namespace osu.Game.Overlays.MedalSplash
[CanBeNull]
public event Action<DisplayState> StateChanged;
private readonly Medal medal;
private readonly Container medalContainer;
private readonly Sprite medalGlow;
private readonly Sprite medalSprite, medalGlow;
private readonly OsuSpriteText unlocked, name;
private readonly TextFlowContainer description;
private DisplayState state;
public DrawableMedal(Medal medal)
{
this.medal = medal;
Position = new Vector2(0f, MedalAnimation.DISC_SIZE / 2);
FillFlowContainer infoFlow;
@@ -49,7 +51,7 @@ namespace osu.Game.Overlays.MedalSplash
Alpha = 0f,
Children = new Drawable[]
{
new DelayedLoadWrapper(() => new MedalOnlineSprite(medal), 0)
medalSprite = new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@@ -120,8 +122,9 @@ namespace osu.Game.Overlays.MedalSplash
}
[BackgroundDependencyLoader]
private void load(OsuColour colours, TextureStore textures)
private void load(OsuColour colours, TextureStore textures, LargeTextureStore largeTextures)
{
medalSprite.Texture = largeTextures.Get(medal.ImageUrl);
medalGlow.Texture = textures.Get(@"MedalSplash/medal-glow");
description.Colour = colours.BlueLight;
}
@@ -188,31 +191,6 @@ namespace osu.Game.Overlays.MedalSplash
break;
}
}
private partial class MedalOnlineSprite : Sprite
{
private readonly Medal medal;
public MedalOnlineSprite(Medal medal)
{
this.medal = medal;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours, TextureStore textures, LargeTextureStore largeTextures)
{
Texture = largeTextures.Get(medal.ImageUrl);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
}
protected override void LoadComplete()
{
base.LoadComplete();
this.FadeInFromZero(150, Easing.OutQuint);
}
}
}
public enum DisplayState