mirror of
https://github.com/ppy/osu
synced 2024-12-18 04:46:09 +00:00
Merge pull request #1934 from peppy/fix-repeat-point-snaking
Fix repeat points not following slider snaking correctly
This commit is contained in:
commit
66c1568fd2
@ -11,7 +11,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 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 1 ? 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
Normal file
15
osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
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" />
|
||||||
|
Loading…
Reference in New Issue
Block a user