Rewrite hold note input handling

This commit is contained in:
smoogipoo
2019-12-23 17:48:48 +09:00
parent 42853b5af6
commit 7ac6f68de8
4 changed files with 41 additions and 59 deletions

View File

@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
this.holdNote = holdNote;
}
public void UpdateResult() => base.UpdateResult(true);
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
Debug.Assert(HitObject.HitWindows != null);
@ -54,21 +56,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
});
}
public override bool OnPressed(ManiaAction action) => false; // Tail doesn't handle key down
public override bool OnPressed(ManiaAction action) => false; // Handled by the hold note
public override bool OnReleased(ManiaAction action)
{
// Make sure that the user started holding the key during the hold note
if (!holdNote.HoldStartTime.HasValue)
return false;
if (action != Action.Value)
return false;
UpdateResult(true);
// Handled by the hold note, which will set holding = false
return false;
}
public override bool OnReleased(ManiaAction action) => false; // Handled by the hold note
}
}