2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2017-09-11 08:53:27 +00:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2020-11-17 05:59:34 +00:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2017-09-11 08:53:27 +00:00
|
|
|
namespace osu.Game.Rulesets.Mania.UI
|
|
|
|
{
|
2018-05-21 20:24:10 +00:00
|
|
|
public partial class DrawableManiaJudgement : DrawableJudgement
|
2017-09-11 08:53:27 +00:00
|
|
|
{
|
2020-11-18 10:34:00 +00:00
|
|
|
protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultManiaJudgementPiece(result);
|
2020-11-17 05:59:34 +00:00
|
|
|
|
2020-11-18 10:34:00 +00:00
|
|
|
private partial class DefaultManiaJudgementPiece : DefaultJudgementPiece
|
2020-11-17 05:59:34 +00:00
|
|
|
{
|
2020-11-18 10:34:00 +00:00
|
|
|
public DefaultManiaJudgementPiece(HitResult result)
|
2020-11-17 06:43:54 +00:00
|
|
|
: base(result)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-11-17 05:59:34 +00:00
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
2020-11-17 06:43:54 +00:00
|
|
|
|
2020-11-17 05:59:34 +00:00
|
|
|
JudgementText.Font = JudgementText.Font.With(size: 25);
|
|
|
|
}
|
2020-12-14 04:07:55 +00:00
|
|
|
|
|
|
|
public override void PlayAnimation()
|
|
|
|
{
|
|
|
|
switch (Result)
|
|
|
|
{
|
|
|
|
case HitResult.None:
|
|
|
|
case HitResult.Miss:
|
2021-09-02 07:31:43 +00:00
|
|
|
base.PlayAnimation();
|
2020-12-14 04:07:55 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
this.ScaleTo(0.8f);
|
|
|
|
this.ScaleTo(1, 250, Easing.OutElastic);
|
|
|
|
|
|
|
|
this.Delay(50)
|
|
|
|
.ScaleTo(0.75f, 250)
|
|
|
|
.FadeOut(200);
|
2021-09-02 07:31:43 +00:00
|
|
|
|
|
|
|
// osu!mania uses a custom fade length, so the base call is intentionally omitted.
|
2020-12-14 04:07:55 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-11-17 05:59:34 +00:00
|
|
|
}
|
2017-09-11 08:53:27 +00:00
|
|
|
}
|
|
|
|
}
|