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

Ignore Touch hit attempts before the early Perfect window #472

Merged
merged 3 commits into from
Aug 16, 2023
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
12 changes: 7 additions & 5 deletions osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class DrawableTouch : DrawableSentakkiHitObject
public override bool HandlePositionalInput => true;

// This HitObject uses a completely different offset
protected override double InitialLifetimeOffset => base.InitialLifetimeOffset + HitObject.HitWindows.WindowFor(HitResult.Ok);
protected override double InitialLifetimeOffset => base.InitialLifetimeOffset + HitObject.HitWindows.WindowFor(HitResult.Great);

// Similar to IsHovered for mouse, this tracks whether a pointer (touch or mouse) is interacting with this drawable
// Interaction == (IsHovered && ActionPressed) || (OnTouch && TouchPointerInBounds)
Expand Down Expand Up @@ -80,11 +80,11 @@ protected override void UpdateInitialTransforms()
{
base.UpdateInitialTransforms();
double fadeIn = AdjustedAnimationDuration / 2;
double moveTo = HitObject.HitWindows.WindowFor(HitResult.Ok);
double moveTo = HitObject.HitWindows.WindowFor(HitResult.Great);

TouchBody.FadeIn(fadeIn);

using (BeginDelayedSequence(AdjustedAnimationDuration))
using (BeginAbsoluteSequence(HitObject.StartTime - moveTo))
{
TouchBody.ResizeTo(90, moveTo, Easing.InCirc);
TouchBody.BorderContainer.Delay(moveTo).FadeIn();
Expand All @@ -108,11 +108,13 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)

var result = HitObject.HitWindows.ResultFor(timeOffset);

// This is hit before any hit window
if (result == HitResult.None)
return;

if (timeOffset < 0)
result = Result.Judgement.MaxResult;
// Hit before the early Great window
if (timeOffset < 0 && result is not HitResult.Great)
return;

ApplyResult(result);
}
Expand Down
19 changes: 6 additions & 13 deletions osu.Game.Rulesets.Sentakki/UI/SentakkiHitObjectLifetimeEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ namespace osu.Game.Rulesets.Sentakki.UI
{
public class SentakkiHitObjectLifetimeEntry : HitObjectLifetimeEntry
{
protected override double InitialLifetimeOffset => initialLifetimeOffsetFor(HitObject);
protected override double InitialLifetimeOffset
=> HitObject switch
{
Touch => AdjustedAnimationDuration + HitObject.HitWindows.WindowFor(HitResult.Great),
_ => AdjustedAnimationDuration
};

private readonly DrawableSentakkiRuleset drawableRuleset;

Expand Down Expand Up @@ -43,17 +48,5 @@ private void bindAnimationDuration()
break;
}
}

private double initialLifetimeOffsetFor(HitObject hitObject)
{
switch (hitObject)
{
case Touch:
return AdjustedAnimationDuration + HitObject.HitWindows.WindowFor(HitResult.Ok);

default:
return AdjustedAnimationDuration;
}
}
}
}
Loading