2019-12-23 14:43:58 +08: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.
|
|
|
|
|
2021-03-22 01:34:31 +08:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
2019-12-23 14:43:58 +08:00
|
|
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The head of a <see cref="DrawableHoldNote"/>.
|
|
|
|
/// </summary>
|
|
|
|
public class DrawableHoldNoteHead : DrawableNote
|
|
|
|
{
|
2020-03-31 14:39:00 +08:00
|
|
|
protected override ManiaSkinComponents Component => ManiaSkinComponents.HoldNoteHead;
|
|
|
|
|
2019-12-23 14:43:58 +08:00
|
|
|
public DrawableHoldNoteHead(DrawableHoldNote holdNote)
|
|
|
|
: base(holdNote.HitObject.Head)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-12-23 16:48:48 +08:00
|
|
|
public void UpdateResult() => base.UpdateResult(true);
|
2019-12-23 14:43:58 +08:00
|
|
|
|
2020-11-04 15:19:07 +08:00
|
|
|
protected override void UpdateInitialTransforms()
|
2020-08-18 23:05:05 +08:00
|
|
|
{
|
2020-11-04 15:19:07 +08:00
|
|
|
base.UpdateInitialTransforms();
|
|
|
|
|
2020-08-18 23:05:05 +08:00
|
|
|
// This hitobject should never expire, so this is just a safe maximum.
|
|
|
|
LifetimeEnd = LifetimeStart + 30000;
|
|
|
|
}
|
|
|
|
|
2021-03-22 01:34:31 +08:00
|
|
|
protected override void UpdateHitStateTransforms(ArmedState state)
|
|
|
|
{
|
|
|
|
// suppress the base call explicitly.
|
|
|
|
// the hold note head should never change its visual state on its own due to the "freezing" mechanic
|
|
|
|
// (when hit, it remains visible in place at the judgement line; when dropped, it will scroll past the line).
|
|
|
|
// it will be hidden along with its parenting hold note when required.
|
|
|
|
}
|
|
|
|
|
2019-12-23 16:48:48 +08:00
|
|
|
public override bool OnPressed(ManiaAction action) => false; // Handled by the hold note
|
2019-12-23 14:43:58 +08:00
|
|
|
|
2020-01-22 12:22:34 +08:00
|
|
|
public override void OnReleased(ManiaAction action)
|
|
|
|
{
|
|
|
|
}
|
2019-12-23 14:43:58 +08:00
|
|
|
}
|
|
|
|
}
|