osu/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgementInfo.cs

59 lines
1.8 KiB
C#
Raw Normal View History

2017-03-21 07:40:37 +00:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-03-21 07:33:25 +00:00
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Objects.Drawables;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Modes.Judgements;
2017-03-21 07:33:25 +00:00
namespace osu.Game.Modes.Taiko.UI
{
2017-03-21 09:16:14 +00:00
/// <summary>
/// Text that is shown as judgement when a hit object is hit or missed.
/// </summary>
public class DrawableTaikoJudgementInfo : DrawableJudgementInfo<TaikoJudgementInfo>
2017-03-21 07:33:25 +00:00
{
2017-03-21 09:16:14 +00:00
/// <summary>
/// Creates a new judgement text.
2017-03-21 09:16:14 +00:00
/// </summary>
/// <param name="judgement">The judgement to visualise.</param>
public DrawableTaikoJudgementInfo(TaikoJudgementInfo judgement)
: base(judgement)
2017-03-21 07:33:25 +00:00
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
switch (Judgement.Result)
{
case HitResult.Hit:
2017-03-21 16:42:40 +00:00
switch (Judgement.TaikoResult)
2017-03-21 07:33:25 +00:00
{
2017-03-21 16:42:40 +00:00
case TaikoHitResult.Good:
Colour = colours.GreenLight;
2017-03-21 07:33:25 +00:00
break;
2017-03-21 16:42:40 +00:00
case TaikoHitResult.Great:
Colour = colours.BlueLight;
2017-03-21 07:33:25 +00:00
break;
}
break;
}
}
protected override void LoadComplete()
{
base.LoadComplete();
if (Judgement.Result == HitResult.Hit)
{
MoveToY(-100, 500);
Delay(250);
FadeOut(250);
}
2017-03-21 07:33:25 +00:00
Expire();
}
}
}