1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:33:21 +08:00

Fix osu! judgements getting scaled twice over different durations

This commit is contained in:
Dean Herbert 2021-09-02 16:31:43 +09:00
parent aadef41182
commit b907c2f4f6
4 changed files with 39 additions and 11 deletions

View File

@ -37,12 +37,11 @@ namespace osu.Game.Rulesets.Mania.UI
public override void PlayAnimation() public override void PlayAnimation()
{ {
base.PlayAnimation();
switch (Result) switch (Result)
{ {
case HitResult.None: case HitResult.None:
case HitResult.Miss: case HitResult.Miss:
base.PlayAnimation();
break; break;
default: default:
@ -52,6 +51,8 @@ namespace osu.Game.Rulesets.Mania.UI
this.Delay(50) this.Delay(50)
.ScaleTo(0.75f, 250) .ScaleTo(0.75f, 250)
.FadeOut(200); .FadeOut(200);
// osu!mania uses a custom fade length, so the base call is intentionally omitted.
break; break;
} }
} }

View File

@ -74,10 +74,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override void PlayAnimation() public override void PlayAnimation()
{ {
base.PlayAnimation();
if (Result != HitResult.Miss) if (Result != HitResult.Miss)
JudgementText.ScaleTo(new Vector2(0.8f, 1)).Then().ScaleTo(new Vector2(1.2f, 1), 1800, Easing.OutQuint); {
JudgementText
.ScaleTo(new Vector2(0.8f, 1))
.ScaleTo(new Vector2(1.2f, 1), 1800, Easing.OutQuint);
}
base.PlayAnimation();
} }
} }
} }

View File

@ -3,6 +3,7 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.UI namespace osu.Game.Rulesets.Taiko.UI
{ {
@ -16,5 +17,26 @@ namespace osu.Game.Rulesets.Taiko.UI
this.MoveToY(-100, 500); this.MoveToY(-100, 500);
base.ApplyHitAnimations(); base.ApplyHitAnimations();
} }
protected override Drawable CreateDefaultJudgement(HitResult result) => new TaikoJudgementPiece(result);
private class TaikoJudgementPiece : DefaultJudgementPiece
{
public TaikoJudgementPiece(HitResult result)
: base(result)
{
}
public override void PlayAnimation()
{
if (Result != HitResult.Miss)
{
JudgementText.ScaleTo(0.9f);
JudgementText.ScaleTo(1, 500, Easing.OutElastic);
}
base.PlayAnimation();
}
}
} }
} }

View File

@ -47,6 +47,13 @@ namespace osu.Game.Rulesets.Judgements
}; };
} }
/// <summary>
/// Plays the default animation for this judgement piece.
/// </summary>
/// <remarks>
/// The base implementation only handles fade (for all result types) and misses.
/// Individual rulesets are recommended to implement their appropriate hit animations.
/// </remarks>
public virtual void PlayAnimation() public virtual void PlayAnimation()
{ {
switch (Result) switch (Result)
@ -60,12 +67,6 @@ namespace osu.Game.Rulesets.Judgements
this.RotateTo(0); this.RotateTo(0);
this.RotateTo(40, 800, Easing.InQuint); this.RotateTo(40, 800, Easing.InQuint);
break;
default:
this.ScaleTo(0.9f);
this.ScaleTo(1, 500, Easing.OutElastic);
break; break;
} }