2019-12-23 15:43:58 +09: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.
|
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2021-05-12 16:35:05 +09:00
|
|
|
using osu.Framework.Graphics;
|
2021-09-16 18:26:12 +09:00
|
|
|
using osu.Framework.Input.Events;
|
2021-03-21 18:34:31 +01:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
2019-12-23 15:43:58 +09:00
|
|
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The head of a <see cref="DrawableHoldNote"/>.
|
|
|
|
/// </summary>
|
|
|
|
public partial class DrawableHoldNoteHead : DrawableNote
|
|
|
|
{
|
2020-03-31 15:39:00 +09:00
|
|
|
protected override ManiaSkinComponents Component => ManiaSkinComponents.HoldNoteHead;
|
|
|
|
|
2021-05-12 16:35:05 +09:00
|
|
|
public DrawableHoldNoteHead()
|
|
|
|
: this(null)
|
2019-12-23 15:43:58 +09:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-05-12 16:35:05 +09:00
|
|
|
public DrawableHoldNoteHead(HeadNote headNote)
|
|
|
|
: base(headNote)
|
|
|
|
{
|
|
|
|
Anchor = Anchor.TopCentre;
|
|
|
|
Origin = Anchor.TopCentre;
|
|
|
|
}
|
|
|
|
|
2021-08-24 19:05:45 +09:00
|
|
|
public bool UpdateResult() => base.UpdateResult(true);
|
2019-12-23 15:43:58 +09:00
|
|
|
|
2021-03-21 18:34:31 +01: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.
|
2022-10-06 19:46:10 +09:00
|
|
|
|
|
|
|
// Set `LifetimeEnd` explicitly to a non-`double.MaxValue` because otherwise this DHO is automatically expired.
|
|
|
|
LifetimeEnd = double.PositiveInfinity;
|
2021-03-21 18:34:31 +01:00
|
|
|
}
|
|
|
|
|
2021-09-16 18:26:12 +09:00
|
|
|
public override bool OnPressed(KeyBindingPressEvent<ManiaAction> e) => false; // Handled by the hold note
|
2019-12-23 15:43:58 +09:00
|
|
|
|
2021-09-16 18:26:12 +09:00
|
|
|
public override void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
|
2020-01-22 13:22:34 +09:00
|
|
|
{
|
|
|
|
}
|
2019-12-23 15:43:58 +09:00
|
|
|
}
|
|
|
|
}
|