Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase leniency of touch notes #558

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void load()
if (DrawableSentakkiRuleset is not null)
AnimationDuration.BindTo(DrawableSentakkiRuleset?.AdjustedTouchAnimDuration);

Size = new Vector2(100);
Size = new Vector2(130);
Origin = Anchor.Centre;
Anchor = Anchor.Centre;
AddRangeInternal(new Drawable[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class TouchHoldBody : CircularContainer
public readonly TouchHoldProgressPiece ProgressPiece;
private readonly TouchHoldCentrePiece centrePiece;

public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => centrePiece.ReceivePositionalInputAt(screenSpacePos);
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => ProgressPiece.ReceivePositionalInputAt(screenSpacePos);

public TouchHoldBody()
{
Expand Down
11 changes: 8 additions & 3 deletions osu.Game.Rulesets.Sentakki/UI/Lane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions osu.Game.Rulesets.Sentakki/UI/TouchPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,14 @@ protected override void Update()

private void handlePointInput(int pointID, bool hasAction, Vector2? pointerPosition)
{
bool continueEventPropogation = true;

foreach (DrawableTouch touch in aliveTouchNotes)
{
if (hasAction && touch.ReceivePositionalInputAt(pointerPosition!.Value))
{
if (!touch.PointInteractionState[pointID])
{
touch.PointInteractionState[pointID] = true;
if (continueEventPropogation)
continueEventPropogation = !touch.OnNewPointInteraction();
touch.OnNewPointInteraction();
}
}
else
Expand Down
Loading