Fix mania misses not correctly animating (temporary solution)

This commit is contained in:
Dean Herbert 2020-11-18 19:34:00 +09:00
parent 1fd582d333
commit 20bb64c627
2 changed files with 29 additions and 4 deletions

View File

@ -24,7 +24,10 @@ public TestSceneDrawableJudgement()
if (hitWindows.IsHitResultAllowed(result)) if (hitWindows.IsHitResultAllowed(result))
{ {
AddStep("Show " + result.GetDescription(), () => SetContents(() => AddStep("Show " + result.GetDescription(), () => SetContents(() =>
new DrawableManiaJudgement(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null) new DrawableManiaJudgement(new JudgementResult(new HitObject
{
StartTime = Time.Current
}, new Judgement()) { Type = result }, null)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -5,6 +5,7 @@
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osuTK;
namespace osu.Game.Rulesets.Mania.UI namespace osu.Game.Rulesets.Mania.UI
{ {
@ -19,6 +20,27 @@ public DrawableManiaJudgement()
{ {
} }
protected override void ApplyMissAnimations()
{
if (!(JudgementBody.Drawable is DefaultManiaJudgementPiece))
{
// this is temporary logic until mania's skin transformer returns IAnimatableJudgements
JudgementBody.ScaleTo(1.6f);
JudgementBody.ScaleTo(1, 100, Easing.In);
JudgementBody.MoveTo(Vector2.Zero);
JudgementBody.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
JudgementBody.RotateTo(0);
JudgementBody.RotateTo(40, 800, Easing.InQuint);
JudgementBody.FadeOutFromOne(800);
LifetimeEnd = JudgementBody.LatestTransformEndTime;
}
base.ApplyMissAnimations();
}
protected override void ApplyHitAnimations() protected override void ApplyHitAnimations()
{ {
JudgementBody.ScaleTo(0.8f); JudgementBody.ScaleTo(0.8f);
@ -29,11 +51,11 @@ protected override void ApplyHitAnimations()
.FadeOut(200); .FadeOut(200);
} }
protected override Drawable CreateDefaultJudgement(HitResult result) => new ManiaJudgementPiece(result); protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultManiaJudgementPiece(result);
private class ManiaJudgementPiece : DefaultJudgementPiece private class DefaultManiaJudgementPiece : DefaultJudgementPiece
{ {
public ManiaJudgementPiece(HitResult result) public DefaultManiaJudgementPiece(HitResult result)
: base(result) : base(result)
{ {
} }