From 6c6b454759b31fb274974da9b54d1e37bc4b94bd Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Wed, 21 Feb 2024 17:27:40 +0100 Subject: [PATCH] Expand lane sensor radius outside the ring --- osu.Game.Rulesets.Sentakki/UI/Lane.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/UI/Lane.cs b/osu.Game.Rulesets.Sentakki/UI/Lane.cs index f935ce996..c24dae8c8 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Lane.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Lane.cs @@ -65,9 +65,12 @@ private void load() #region Input Handling - private const float receptor_angle_range = 45 * 1.4f; + private const float receptor_angle_range = 45; private const float receptor_angle_range_mid = receptor_angle_range / 2; + private const float receptor_angle_range_inner = receptor_angle_range * 1.4f; + private const float receptor_angle_range_inner_mid = receptor_angle_range_inner / 2; + private SentakkiInputManager sentakkiActionInputManager = null!; internal SentakkiInputManager SentakkiActionInputManager => sentakkiActionInputManager ??= (SentakkiInputManager)GetContainingInputManager(); @@ -78,10 +81,12 @@ public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) var localPos = ToLocalSpace(screenSpacePos); float distance = Vector2.DistanceSquared(Vector2.Zero, localPos); - if (distance is < (200 * 200) or > (400 * 400)) return false; + if (distance is < (200 * 200) or > (600 * 600)) return false; + + float targetAngleRangeMid = distance > 400 ? receptor_angle_range_mid : receptor_angle_range_inner_mid; float angleDelta = SentakkiExtensions.GetDeltaAngle(0, Vector2.Zero.GetDegreesFromPosition(localPos)); - if (Math.Abs(angleDelta) > receptor_angle_range_mid) return false; + if (Math.Abs(angleDelta) > targetAngleRangeMid) return false; return true; }