2019-01-24 16:43:03 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2020-11-17 13:59:34 +08:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2020-11-18 18:34:00 +08:00
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.UI
|
|
|
|
{
|
2018-05-22 04:24:10 +08:00
|
|
|
public class DrawableManiaJudgement : DrawableJudgement
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2018-08-02 19:36:54 +08:00
|
|
|
public DrawableManiaJudgement(JudgementResult result, DrawableHitObject judgedObject)
|
|
|
|
: base(result, judgedObject)
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-07-29 15:41:10 +08:00
|
|
|
public DrawableManiaJudgement()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-11-18 18:34:00 +08:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2019-03-12 18:41:33 +08:00
|
|
|
protected override void ApplyHitAnimations()
|
2019-03-12 18:23:24 +08:00
|
|
|
{
|
2019-03-12 18:41:33 +08:00
|
|
|
JudgementBody.ScaleTo(0.8f);
|
|
|
|
JudgementBody.ScaleTo(1, 250, Easing.OutElastic);
|
2019-03-12 18:23:24 +08:00
|
|
|
|
2020-11-18 14:39:02 +08:00
|
|
|
JudgementBody.Delay(50)
|
|
|
|
.ScaleTo(0.75f, 250)
|
|
|
|
.FadeOut(200);
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
2020-11-17 13:59:34 +08:00
|
|
|
|
2020-11-18 18:34:00 +08:00
|
|
|
protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultManiaJudgementPiece(result);
|
2020-11-17 13:59:34 +08:00
|
|
|
|
2020-11-18 18:34:00 +08:00
|
|
|
private class DefaultManiaJudgementPiece : DefaultJudgementPiece
|
2020-11-17 13:59:34 +08:00
|
|
|
{
|
2020-11-18 18:34:00 +08:00
|
|
|
public DefaultManiaJudgementPiece(HitResult result)
|
2020-11-17 14:43:54 +08:00
|
|
|
: base(result)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-11-17 13:59:34 +08:00
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
2020-11-17 14:43:54 +08:00
|
|
|
|
2020-11-17 13:59:34 +08:00
|
|
|
JudgementText.Font = JudgementText.Font.With(size: 25);
|
|
|
|
}
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|