// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE 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; namespace osu.Game.Modes.Taiko.UI { /// /// Text that is shown as judgement when a hit object is hit or missed. /// public class JudgementText : DrawableJudgementInfo { /// /// Creates a new judgement text. /// /// The judgement to visualise. public JudgementText(TaikoJudgementInfo judgement) : base(judgement) { } [BackgroundDependencyLoader] private void load(OsuColour colours) { switch (Judgement.Result) { case HitResult.Hit: switch (Judgement.TaikoResult) { case TaikoHitResult.Good: Colour = colours.Green; break; case TaikoHitResult.Great: Colour = colours.Blue; break; } break; } } protected override void LoadComplete() { base.LoadComplete(); if (Judgement.Result == HitResult.Hit) { MoveToY(-100, 500); Delay(250); FadeOut(250); } Expire(); } } }