osu/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs

61 lines
1.7 KiB
C#
Raw Normal View History

// 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 09:19:50 +00:00
using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Rulesets.Mania.UI
{
2018-05-21 20:24:10 +00:00
public class DrawableManiaJudgement : DrawableJudgement
2018-04-13 09:19:50 +00:00
{
public DrawableManiaJudgement(JudgementResult result, DrawableHitObject judgedObject)
: base(result, judgedObject)
2018-04-13 09:19:50 +00:00
{
}
2020-07-29 07:41:10 +00:00
public DrawableManiaJudgement()
{
}
protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultManiaJudgementPiece(result);
private class DefaultManiaJudgementPiece : DefaultJudgementPiece
{
public DefaultManiaJudgementPiece(HitResult result)
2020-11-17 06:43:54 +00:00
: base(result)
{
}
protected override void LoadComplete()
{
base.LoadComplete();
2020-11-17 06:43:54 +00:00
JudgementText.Font = JudgementText.Font.With(size: 25);
}
public override void PlayAnimation()
{
base.PlayAnimation();
switch (Result)
{
case HitResult.None:
case HitResult.Miss:
break;
default:
this.ScaleTo(0.8f);
this.ScaleTo(1, 250, Easing.OutElastic);
this.Delay(50)
.ScaleTo(0.75f, 250)
.FadeOut(200);
break;
}
}
}
2018-04-13 09:19:50 +00:00
}
}