mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Rewrite hold note input handling
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
// 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.
|
||||
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
{
|
||||
/// <summary>
|
||||
@ -10,28 +8,15 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
/// </summary>
|
||||
public class DrawableHoldNoteHead : DrawableNote
|
||||
{
|
||||
private readonly DrawableHoldNote holdNote;
|
||||
|
||||
public DrawableHoldNoteHead(DrawableHoldNote holdNote)
|
||||
: base(holdNote.HitObject.Head)
|
||||
{
|
||||
this.holdNote = holdNote;
|
||||
}
|
||||
|
||||
public override bool OnPressed(ManiaAction action)
|
||||
{
|
||||
if (!base.OnPressed(action))
|
||||
return false;
|
||||
public void UpdateResult() => base.UpdateResult(true);
|
||||
|
||||
// If the key has been released too early, the user should not receive full score for the release
|
||||
if (Result.Type == HitResult.Miss)
|
||||
holdNote.HasBroken = true;
|
||||
public override bool OnPressed(ManiaAction action) => false; // Handled by the hold note
|
||||
|
||||
// The head note also handles early hits before the body, but we want accurate early hits to count as the body being held
|
||||
// The body doesn't handle these early early hits, so we have to explicitly set the holding state here
|
||||
holdNote.BeginHold();
|
||||
|
||||
return true;
|
||||
}
|
||||
public override bool OnReleased(ManiaAction action) => false; // Handled by the hold note
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user