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