1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Add legacy spinner approach circle implementation

This commit is contained in:
Salman Ahmed 2021-06-17 04:38:55 +03:00
parent 044ff9d1d2
commit 9d9892e99e

View File

@ -32,6 +32,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
protected DrawableSpinner DrawableSpinner { get; private set; }
private Drawable approachCircle;
private Sprite spin;
private Sprite clear;
@ -57,8 +59,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
Depth = float.MinValue,
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
Children = new[]
{
approachCircle = getSpinnerApproachCircle(source),
spin = new Sprite
{
Anchor = Anchor.TopCentre,
@ -101,6 +104,25 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
}.With(s => s.Font = s.Font.With(fixedWidth: false)),
}
});
static Drawable getSpinnerApproachCircle(ISkinSource source)
{
var spinnerProvider = source.FindProvider(s =>
s.GetTexture("spinner-circle") != null ||
s.GetTexture("spinner-top") != null);
if (spinnerProvider is DefaultLegacySkin)
return Empty();
return new Sprite
{
Anchor = Anchor.TopCentre,
Origin = Anchor.Centre,
Texture = source.GetTexture("spinner-approachcircle"),
Scale = new Vector2(SPRITE_SCALE * 1.86f),
Y = SPINNER_Y_CENTRE,
};
}
}
private IBindable<double> gainedBonus;
@ -175,6 +197,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
spmCounter.MoveToOffset(new Vector2(0, -spm_hide_offset), d.HitObject.TimeFadeIn, Easing.Out);
}
using (BeginAbsoluteSequence(d.HitObject.StartTime))
approachCircle.ScaleTo(SPRITE_SCALE * 1.86f).ScaleTo(SPRITE_SCALE * 0.1f, d.HitObject.Duration);
double spinFadeOutLength = Math.Min(400, d.HitObject.Duration);
using (BeginAbsoluteSequence(drawableHitObject.HitStateUpdateTime - spinFadeOutLength, true))