1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:07:24 +08:00

Add stable-like animation legacy rank display

Just substituting the sprite felt pretty terrible.
This commit is contained in:
Bartłomiej Dach 2024-06-07 09:54:27 +02:00
parent 199d31c0f4
commit 72890bb9ac
No known key found for this signature in database

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Scoring;
using osuTK;
namespace osu.Game.Skinning
{
@ -25,12 +26,38 @@ namespace osu.Game.Skinning
{
AutoSizeAxes = Axes.Both;
AddInternal(rank = new Sprite());
AddInternal(rank = new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
}
protected override void LoadComplete()
{
scoreProcessor.Rank.BindValueChanged(v => rank.Texture = source.GetTexture($"ranking-{v.NewValue}-small"), true);
scoreProcessor.Rank.BindValueChanged(v =>
{
var texture = source.GetTexture($"ranking-{v.NewValue}-small");
rank.Texture = texture;
if (texture != null)
{
var transientRank = new Sprite
{
Texture = texture,
Blending = BlendingParameters.Additive,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
BypassAutoSizeAxes = Axes.Both,
};
AddInternal(transientRank);
transientRank.FadeOutFromOne(1200, Easing.Out)
.ScaleTo(new Vector2(1.625f), 1200, Easing.Out)
.Expire();
}
}, true);
FinishTransforms(true);
}
}
}
}