Skip to content

Commit

Permalink
Revert "Block input to objects lying under already-hit hitcircles whe…
Browse files Browse the repository at this point in the history
…n classic note lock is active"

This reverts commit 03c61a5.

The goal here was to handle an edge case discovered during work on note
lock, wherein it was determined that on stable hit circles would block
input from reaching objects underneath them. However, the change
mentioned above did that _too_ hard and caused overlaps to also be
blocked even long past a hit circle has been faded out.

Revert the change pending further (and more careful) investigation.
  • Loading branch information
bdach authored and peppy committed Sep 8, 2023
1 parent 299f95d commit cdb003e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
3 changes: 1 addition & 2 deletions osu.Game.Rulesets.Osu.Tests/TestSceneLegacyHitPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ public void TestAutopilotReducesHittableRange()
}

[Test]
[Ignore("Currently broken, first attempt at fixing broke even harder. See https://github.com/ppy/osu/issues/24743.")]
public void TestInputDoesNotFallThroughOverlappingSliders()
{
const double time_first_slider = 1000;
Expand Down Expand Up @@ -549,8 +550,6 @@ public void TestInputDoesNotFallThroughOverlappingSliders()
addJudgementOffsetAssert("first slider head", () => ((Slider)hitObjects[0]).HeadCircle, 0);
addJudgementAssert(hitObjects[1], HitResult.Miss);
// the slider head of the first slider prevents the second slider's head from being hit, so the judgement offset should be very late.
// this is not strictly done by the hit policy implementation itself (see `OsuModClassic.blockInputToUnderlyingObjects()`),
// but we're testing this here anyways to just keep everything related to input handling and note lock in one place.
addJudgementOffsetAssert("second slider head", () => ((Slider)hitObjects[1]).HeadCircle, referenceHitWindows.WindowFor(HitResult.Meh));
addClickActionAssert(0, ClickAction.Hit);
}
Expand Down
23 changes: 0 additions & 23 deletions osu.Game.Rulesets.Osu/Mods/OsuModClassic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ public void ApplyToDrawableHitObject(DrawableHitObject obj)
head.TrackFollowCircle = !NoSliderHeadMovement.Value;
if (FadeHitCircleEarly.Value && !usingHiddenFading)
applyEarlyFading(head);

if (ClassicNoteLock.Value)
blockInputToUnderlyingObjects(head);

break;

case DrawableSliderTail tail:
Expand All @@ -87,29 +83,10 @@ public void ApplyToDrawableHitObject(DrawableHitObject obj)
case DrawableHitCircle circle:
if (FadeHitCircleEarly.Value && !usingHiddenFading)
applyEarlyFading(circle);

if (ClassicNoteLock.Value)
blockInputToUnderlyingObjects(circle);

break;
}
}

/// <summary>
/// On stable, hitcircles that have already been hit block input from reaching objects that may be underneath them.
/// The purpose of this method is to restore that behaviour.
/// In order to avoid introducing yet another confusing config option, this behaviour is roped into the general notion of "note lock".
/// </summary>
private static void blockInputToUnderlyingObjects(DrawableHitCircle circle)
{
var oldHitAction = circle.HitArea.Hit;
circle.HitArea.Hit = () =>
{
oldHitAction?.Invoke();
return true;
};
}

private void applyEarlyFading(DrawableHitCircle circle)
{
circle.ApplyCustomUpdateState += (dho, state) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public bool OnPressed(KeyBindingPressEvent<OsuAction> e)
case OsuAction.RightButton:
if (IsHovered && (Hit?.Invoke() ?? false))
{
HitAction ??= e.Action;
HitAction = e.Action;
return true;
}

Expand Down

0 comments on commit cdb003e

Please sign in to comment.