2018-01-30 15:24:23 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|
|
|
|
{
|
|
|
|
|
public class DrawableSliderTail : DrawableOsuHitObject, IRequireTracking
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The judgement text is provided by the <see cref="DrawableSlider"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override bool DisplayJudgement => false;
|
|
|
|
|
|
|
|
|
|
public bool Tracking { get; set; }
|
|
|
|
|
|
2018-03-10 00:11:56 +08:00
|
|
|
|
public DrawableSliderTail(Slider slider, HitCircle hitCircle)
|
2018-01-30 15:24:23 +08:00
|
|
|
|
: base(hitCircle)
|
|
|
|
|
{
|
2018-02-23 19:27:05 +08:00
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
2018-01-30 15:24:23 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
2018-02-23 19:27:05 +08:00
|
|
|
|
FillMode = FillMode.Fit;
|
|
|
|
|
|
|
|
|
|
AlwaysPresent = true;
|
2018-03-10 00:11:56 +08:00
|
|
|
|
|
|
|
|
|
Position = HitObject.Position - slider.Position;
|
2018-01-30 15:24:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
|
|
|
|
{
|
|
|
|
|
if (!userTriggered && timeOffset >= 0)
|
|
|
|
|
AddJudgement(new OsuSliderTailJudgement { Result = Tracking ? HitResult.Great : HitResult.Miss });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|