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

Fix sample playback position issues #581

Merged
merged 1 commit into from
Apr 30, 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 @@ -25,7 +25,7 @@ public bool Auto
// Used for the animation update
protected readonly Bindable<double> AnimationDuration = new Bindable<double>(1000);

protected override float SamplePlaybackPosition => Position.X / (SentakkiPlayfield.INTERSECTDISTANCE * 2);
protected override float SamplePlaybackPosition => (Position.X / (SentakkiPlayfield.INTERSECTDISTANCE * 2)) + 0.5f;

public DrawableSentakkiHitObject()
: this(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables
{
public partial class DrawableSlideBody : DrawableSentakkiLanedHitObject
{
private new DrawableSlide ParentHitObject => (DrawableSlide)base.ParentHitObject;
public new DrawableSlide ParentHitObject => (DrawableSlide)base.ParentHitObject;
public new SlideBody HitObject => (SlideBody)base.HitObject;

// This slide body can only be interacted with iff the slidetap associated with this slide is judged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Sentakki.UI;

namespace osu.Game.Rulesets.Sentakki.Objects.Drawables
{
Expand All @@ -20,6 +21,7 @@ public partial class DrawableSlideCheckpoint : DrawableSentakkiHitObject
public override bool DisplayResult => false;

private new DrawableSlideBody ParentHitObject => (DrawableSlideBody)base.ParentHitObject;
private int slideOriginLane => ParentHitObject.ParentHitObject.HitObject.Lane;

// Used to determine the node order
public int ThisIndex;
Expand All @@ -37,6 +39,8 @@ public partial class DrawableSlideCheckpoint : DrawableSentakkiHitObject

private Container<DrawableSlideCheckpointNode> nodes = null!;

protected override float SamplePlaybackPosition => (SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, slideOriginLane).X / (SentakkiPlayfield.INTERSECTDISTANCE * 2)) + .5f;

public DrawableSlideCheckpoint()
: this(null)
{
Expand Down Expand Up @@ -70,7 +74,7 @@ protected override void OnApply()

protected override void CheckForResult(bool userTriggered, double timeOffset)
{
// Counting hit notes manually to avoid LINQ alloc overhead
// Counting hit notes manually to avoid LINQ alloc overhead
int hitNotes = 0;

foreach (var node in nodes)
Expand Down
Loading