diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 28ff4b4cdf..6cf353eaf2 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -72,6 +72,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 1 ? end : start; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 0 ? end : start; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index fae56dcce2..6f3bb34a89 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -73,12 +73,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddNested(InitialCircle); - var repeatDuration = s.Curve.Distance / s.Velocity; + var spanDuration = s.Curve.Distance / s.Velocity; foreach (var tick in s.NestedHitObjects.OfType()) { - var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = repeatStartTime + repeatDuration; + var spanStartTime = s.StartTime + tick.SpanIndex * spanDuration; + var fadeInTime = spanStartTime + (tick.StartTime - spanStartTime) / 2 - (tick.SpanIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); + var fadeOutTime = spanStartTime + spanDuration; var drawableTick = new DrawableSliderTick(tick) { @@ -93,9 +93,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var repeatPoint in s.NestedHitObjects.OfType()) { - var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration; + var repeatStartTime = s.StartTime + (repeatPoint.RepeatIndex + 1) * spanDuration; var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = repeatStartTime + repeatDuration; + var fadeOutTime = repeatStartTime + spanDuration; var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this) { diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index c49fbce16d..35635788f2 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Osu.Objects AddNested(new SliderTick { - RepeatIndex = span, + SpanIndex = span, StartTime = spanStartTime + timeProgress * spanDuration, Position = Curve.PositionAt(distanceProgress), StackHeight = StackHeight, @@ -148,19 +148,19 @@ namespace osu.Game.Rulesets.Osu.Objects { var repeatDuration = Distance / Velocity; - for (var repeat = 1; repeat <= RepeatCount; repeat++) + for (int repeatIndex = 0, repeat = 1; repeatIndex < RepeatCount; repeatIndex++, repeat++) { var repeatStartTime = StartTime + repeat * repeatDuration; AddNested(new RepeatPoint { - RepeatIndex = repeat, + RepeatIndex = repeatIndex, StartTime = repeatStartTime, Position = Curve.PositionAt(repeat % 2), StackHeight = StackHeight, Scale = Scale, ComboColour = ComboColour, - Samples = new List(RepeatSamples[repeat]) + Samples = new List(RepeatSamples[repeatIndex]) }); } } diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs index e6955b48e7..5f9a978902 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs @@ -5,6 +5,6 @@ namespace osu.Game.Rulesets.Osu.Objects { public class SliderTick : OsuHitObject { - public int RepeatIndex { get; set; } + public int SpanIndex { get; set; } } }