mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Fix repeat points not following slider snaking correctly
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
@ -11,7 +12,7 @@ using osu.Game.Rulesets.Scoring;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableRepeatPoint : DrawableOsuHitObject
|
public class DrawableRepeatPoint : DrawableOsuHitObject, ITrackSnaking
|
||||||
{
|
{
|
||||||
private readonly RepeatPoint repeatPoint;
|
private readonly RepeatPoint repeatPoint;
|
||||||
private readonly DrawableSlider drawableSlider;
|
private readonly DrawableSlider drawableSlider;
|
||||||
@ -71,5 +72,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex / 2 == 0 ? end : start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
public readonly DrawableHitCircle InitialCircle;
|
public readonly DrawableHitCircle InitialCircle;
|
||||||
|
|
||||||
private readonly List<ISliderProgress> components = new List<ISliderProgress>();
|
private readonly List<Drawable> components = new List<Drawable>();
|
||||||
|
|
||||||
private readonly Container<DrawableSliderTick> ticks;
|
private readonly Container<DrawableSliderTick> ticks;
|
||||||
private readonly Container<DrawableRepeatPoint> repeatPoints;
|
private readonly Container<DrawableRepeatPoint> repeatPoints;
|
||||||
@ -101,6 +101,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
};
|
};
|
||||||
|
|
||||||
repeatPoints.Add(drawableRepeatPoint);
|
repeatPoints.Add(drawableRepeatPoint);
|
||||||
|
components.Add(drawableRepeatPoint);
|
||||||
AddNested(drawableRepeatPoint);
|
AddNested(drawableRepeatPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,7 +127,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
if (!InitialCircle.Judgements.Any(j => j.IsHit))
|
if (!InitialCircle.Judgements.Any(j => j.IsHit))
|
||||||
InitialCircle.Position = slider.Curve.PositionAt(progress);
|
InitialCircle.Position = slider.Curve.PositionAt(progress);
|
||||||
|
|
||||||
foreach (var c in components) c.UpdateProgress(progress, repeat);
|
foreach (var c in components.OfType<ISliderProgress>()) c.UpdateProgress(progress, repeat);
|
||||||
|
foreach (var c in components.OfType<ITrackSnaking>()) c.UpdateSnakingPosition(slider.Curve.PositionAt(Body.SnakedStart ?? 0), slider.Curve.PositionAt(Body.SnakedEnd ?? 0));
|
||||||
foreach (var t in ticks.Children) t.Tracking = Ball.Tracking;
|
foreach (var t in ticks.Children) t.Tracking = Ball.Tracking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
Normal file
12
osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A component which tracks the current end snaking position of a slider.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITrackSnaking
|
||||||
|
{
|
||||||
|
void UpdateSnakingPosition(Vector2 start, Vector2 end);
|
||||||
|
}
|
||||||
|
}
|
@ -71,6 +71,7 @@
|
|||||||
<Compile Include="Objects\Drawables\Connections\FollowPointRenderer.cs" />
|
<Compile Include="Objects\Drawables\Connections\FollowPointRenderer.cs" />
|
||||||
<Compile Include="Judgements\OsuJudgement.cs" />
|
<Compile Include="Judgements\OsuJudgement.cs" />
|
||||||
<Compile Include="Objects\Drawables\DrawableRepeatPoint.cs" />
|
<Compile Include="Objects\Drawables\DrawableRepeatPoint.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\ITrackSnaking.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\ApproachCircle.cs" />
|
<Compile Include="Objects\Drawables\Pieces\ApproachCircle.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\SpinnerBackground.cs" />
|
<Compile Include="Objects\Drawables\Pieces\SpinnerBackground.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\CirclePiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\CirclePiece.cs" />
|
||||||
|
Reference in New Issue
Block a user