From efae00c1494dd66582a3c3872826da5fdcb0dc0c Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Tue, 23 Jan 2018 04:31:37 -0600 Subject: [PATCH 01/11] make repeat points look better --- .../Objects/Drawables/DrawableRepeatPoint.cs | 18 ++++++++++++++---- .../Objects/Drawables/DrawableSlider.cs | 2 ++ .../Objects/Drawables/Pieces/SliderBody.cs | 10 +++++----- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 6cf353eaf2..b6a07aa4e3 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -15,6 +16,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; + private bool isEndRepeat => repeatPoint.RepeatIndex % 2 == 0; public double FadeInTime; public double FadeOutTime; @@ -25,17 +27,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables this.repeatPoint = repeatPoint; this.drawableSlider = drawableSlider; - Size = new Vector2(32 * repeatPoint.Scale); + Size = new Vector2(45 * repeatPoint.Scale); Blending = BlendingMode.Additive; Origin = Anchor.Centre; - + Children = new Drawable[] { new SpriteIcon { RelativeSizeAxes = Axes.Both, - Icon = FontAwesome.fa_eercast + Icon = FontAwesome.fa_chevron_right } }; } @@ -72,6 +74,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 0 ? end : start; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) + { + Position = isEndRepeat ? end : start; + var curve = drawableSlider.CurrentCurve; + if (curve.Count < 3 || curve.All(p => p == Position)) + return; + var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position) - 1 : curve.LastIndexOf(Position) + 1]; + Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X)); + } } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 6f3bb34a89..8deb31db2a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container ticks; private readonly Container repeatPoints; + public List CurrentCurve => Body.CurrentCurve; + public readonly SliderBody Body; public readonly SliderBall Ball; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 6fe1fda8eb..901d1c568d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces // We want the container to have the same size as the slider, // and to be positioned such that the slider head is at (0,0). container.Size = path.Size; - container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - currentCurve[0]); + container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - CurrentCurve[0]); container.ForceRedraw(); } @@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces path.Texture = texture; } - private readonly List currentCurve = new List(); + public readonly List CurrentCurve = new List(); private bool updateSnaking(double p0, double p1) { if (SnakedStart == p0 && SnakedEnd == p1) return false; @@ -156,11 +156,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces SnakedStart = p0; SnakedEnd = p1; - slider.Curve.GetPathToProgress(currentCurve, p0, p1); + slider.Curve.GetPathToProgress(CurrentCurve, p0, p1); path.ClearVertices(); - foreach (Vector2 p in currentCurve) - path.AddVertex(p - currentCurve[0]); + foreach (Vector2 p in CurrentCurve) + path.AddVertex(p - CurrentCurve[0]); return true; } From cee8bb50c927668e81c629cacb709cda88cab0f9 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 24 Jan 2018 15:34:52 -0600 Subject: [PATCH 02/11] Fix reference points being wrongly selected --- .../Objects/Drawables/DrawableRepeatPoint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index b6a07aa4e3..adf5350996 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Blending = BlendingMode.Additive; Origin = Anchor.Centre; - + Children = new Drawable[] { new SpriteIcon @@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables var curve = drawableSlider.CurrentCurve; if (curve.Count < 3 || curve.All(p => p == Position)) return; - var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position) - 1 : curve.LastIndexOf(Position) + 1]; + var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1]; Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X)); } } From 1f51149da86a35639a7020d43124acf998b32128 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 24 Jan 2018 15:41:51 -0600 Subject: [PATCH 03/11] Add xmldoc --- .../Objects/Drawables/DrawableRepeatPoint.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index adf5350996..077e97aa95 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -16,7 +16,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; - private bool isEndRepeat => repeatPoint.RepeatIndex % 2 == 0; + + /// + /// Are we located in the last ControlPoint of our + /// + private bool isRepeatAtEnd => repeatPoint.RepeatIndex % 2 == 0; public double FadeInTime; public double FadeOutTime; @@ -76,11 +80,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public void UpdateSnakingPosition(Vector2 start, Vector2 end) { - Position = isEndRepeat ? end : start; + Position = isRepeatAtEnd ? end : start; var curve = drawableSlider.CurrentCurve; if (curve.Count < 3 || curve.All(p => p == Position)) return; - var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1]; + var referencePoint = curve[isRepeatAtEnd ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1]; Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X)); } } From 8eef81e24d4b1eededb42cf076879ad460a1def3 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 24 Jan 2018 16:16:46 -0600 Subject: [PATCH 04/11] Add more cases to TestCase --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 114 ++++++++++++++++-- 1 file changed, 104 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index ddf24cc405..c9ab39e0b9 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -16,6 +16,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Tests @@ -41,7 +42,6 @@ namespace osu.Game.Rulesets.Osu.Tests public TestCaseSlider() { base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 })); - AddStep("Big Single", () => testSimpleBig()); AddStep("Medium Single", () => testSimpleMedium()); AddStep("Small Single", () => testSimpleSmall()); @@ -64,8 +64,22 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("Fast Short Slider 1 Repeat", () => testShortHighSpeed(1)); AddStep("Fast Short Slider 2 Repeats", () => testShortHighSpeed(2)); - AddStep("Perfect Curve", testCurve); - // TODO more curve types? + AddStep("Perfect Curve", () => testPerfect()); + AddStep("Perfect Curve 1 Repeat", () => testPerfect(1)); + AddStep("Perfect Curve 2 Repeats", () => testPerfect(2)); + + AddStep("Linear Slider", () => testLinear()); + AddStep("Linear Slider 1 Repeat", () => testLinear(1)); + AddStep("Linear Slider 2 Repeats", () => testLinear(2)); + + AddStep("Beizer Slider", () => testBeizer()); + AddStep("Beizer Slider 1 Repeat", () => testBeizer(1)); + AddStep("Beizer Slider 2 Repeats", () => testBeizer(2)); + + AddStep("Linear Overlaping", () => testLinearOverlaping()); + AddStep("Linear Overlaping 1 Repeat", () => testLinearOverlaping(1)); + AddStep("Linear Overlaping 2 Repeats", () => testLinearOverlaping(2)); + // TODO add catmull } private void testSimpleBig(int repeats = 0) => createSlider(2, repeats: repeats); @@ -84,10 +98,6 @@ namespace osu.Game.Rulesets.Osu.Tests private void createSlider(float circleSize = 2, float distance = 400, int repeats = 0, double speedMultiplier = 2) { - var repeatSamples = new List>(); - for (int i = 0; i < repeats; i++) - repeatSamples.Add(new List()); - var slider = new Slider { StartTime = Time.Current + 1000, @@ -100,13 +110,13 @@ namespace osu.Game.Rulesets.Osu.Tests }, Distance = distance, RepeatCount = repeats, - RepeatSamples = repeatSamples + RepeatSamples = createEmptySamples(repeats) }; addSlider(slider, circleSize, speedMultiplier); } - private void testCurve() + private void testPerfect(int repeats = 0) { var slider = new Slider { @@ -119,12 +129,96 @@ namespace osu.Game.Rulesets.Osu.Tests new Vector2(0, 200), new Vector2(200, 0) }, - Distance = 600 + Distance = 600, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) }; addSlider(slider, 2, 3); } + private void testLinear(int repeats = 0) + { + var slider = new Slider + { + CurveType = CurveType.Linear, + StartTime = Time.Current + 1000, + Position = new Vector2(-200, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(-200, 0), + new Vector2(-50, 75), + new Vector2(0, 100), + new Vector2(100, -200), + new Vector2(200, 0), + new Vector2(230, 0) + }, + Distance = 793.4417, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) + }; + + addSlider(slider, 2, 3); + } + + private void testBeizer(int repeats = 0) + { + var slider = new Slider + { + CurveType = CurveType.Bezier, + StartTime = Time.Current + 1000, + Position = new Vector2(-200, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(-200, 0), + new Vector2(-50, 75), + new Vector2(0, 100), + new Vector2(100, -200), + new Vector2(230, 0) + }, + Distance = 480, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) + }; + + addSlider(slider, 2, 3); + } + + private void testLinearOverlaping(int repeats = 0) + { + var slider = new Slider + { + CurveType = CurveType.Linear, + StartTime = Time.Current + 1000, + Position = new Vector2(0, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(0, 0), + new Vector2(-200, 0), + new Vector2(0, 0), + new Vector2(0, -200), + new Vector2(-200, -200), + new Vector2(0, -200) + }, + Distance = 1000, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) + }; + + addSlider(slider, 2, 3); + } + + private List> createEmptySamples(int repeats) + { + var repeatSamples = new List>(); + for (int i = 0; i < repeats; i++) + repeatSamples.Add(new List()); + return repeatSamples; + } + private void addSlider(Slider slider, float circleSize, double speedMultiplier) { var cpi = new ControlPointInfo(); From b656858ee68929f4cfde511f831885d44d14eaa8 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 31 Jan 2018 21:32:10 -0600 Subject: [PATCH 05/11] Fix typos --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index d747dfc2e9..990a932f46 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -73,13 +73,13 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("Linear Slider 1 Repeat", () => testLinear(1)); AddStep("Linear Slider 2 Repeats", () => testLinear(2)); - AddStep("Beizer Slider", () => testBeizer()); - AddStep("Beizer Slider 1 Repeat", () => testBeizer(1)); - AddStep("Beizer Slider 2 Repeats", () => testBeizer(2)); + AddStep("Bezier Slider", () => testBeizer()); + AddStep("Bezier Slider 1 Repeat", () => testBeizer(1)); + AddStep("Bezier Slider 2 Repeats", () => testBeizer(2)); - AddStep("Linear Overlaping", () => testLinearOverlaping()); - AddStep("Linear Overlaping 1 Repeat", () => testLinearOverlaping(1)); - AddStep("Linear Overlaping 2 Repeats", () => testLinearOverlaping(2)); + AddStep("Linear Overlapping", () => testLinearOverlaping()); + AddStep("Linear Overlapping 1 Repeat", () => testLinearOverlaping(1)); + AddStep("Linear Overlapping 2 Repeats", () => testLinearOverlaping(2)); // TODO add catmull } From 2e3ee79975442f9f2a53bee1e8bc3fe9ee58f19c Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Sun, 4 Feb 2018 00:02:32 -0600 Subject: [PATCH 06/11] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 90bf49a2df..d89e6cd631 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 90bf49a2df3dbad5994d922df63e4891c622dbc3 +Subproject commit d89e6cd63140c2b73631b79ff83b130a2b9958ed diff --git a/osu-resources b/osu-resources index 266965f0d7..92ec3d10b1 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 266965f0d795b94a126e2da302bd2c10eadd642a +Subproject commit 92ec3d10b12c5e9bfc1d3b05d3db174a506efd6d From 60fb78e49d35cf98f09afd122e9d08998e80f093 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 17:46:45 +0900 Subject: [PATCH 07/11] Simplify iteration code --- .../Objects/Drawables/DrawableRepeatPoint.cs | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index daa017477f..c8c90830a7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -80,25 +79,24 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public void UpdateSnakingPosition(Vector2 start, Vector2 end) { Position = isRepeatAtEnd ? end : start; + var curve = drawableSlider.Body.CurrentCurve; - if (curve.Count < 3 || curve.All(p => p == Position)) + + if (curve.Count < 2) return; - int referenceIndex; - //We are looking for the next point in the curve different than our position - //Since there can be more than one point equal to our position, we iterate until one is found - if (isRepeatAtEnd) + + int searchStart = isRepeatAtEnd ? curve.Count - 1 : 0; + int direction = isRepeatAtEnd ? -1 : 1; + + // find the next vector2 in the curve which is not equal to our current position to infer a rotation. + for (int i = searchStart; i >= 0 && i < curve.Count; i += direction) { - referenceIndex = curve.Count - 1; - while (curve[referenceIndex] == Position) - referenceIndex--; + if (curve[i] == Position) + continue; + + Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(curve[i].Y - Position.Y, curve[i].X - Position.X)); + break; } - else - { - referenceIndex = 0; - while (curve[referenceIndex] == Position) - referenceIndex++; - } - Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(curve[referenceIndex].Y - Position.Y, curve[referenceIndex].X - Position.X)); } } } From e417aaa23ff55bbf556f58a5a590ecc9a0f05562 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 17:46:56 +0900 Subject: [PATCH 08/11] Adjust scale out effect --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index c8c90830a7..dc3660ba5e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; case ArmedState.Hit: this.FadeOut(animDuration, Easing.OutQuint) - .ScaleTo(Scale * 1.5f, animDuration, Easing.OutQuint); + .ScaleTo(Scale * 1.5f, animDuration, Easing.Out); break; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index c616d15de3..8b3c361945 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; case ArmedState.Hit: this.FadeOut(anim_duration, Easing.OutQuint) - .ScaleTo(Scale * 1.5f, anim_duration, Easing.OutQuint); + .ScaleTo(Scale * 1.5f, anim_duration, Easing.Out); break; } } From 27fd42fb17d2b54bba4acd4d9c0b91c48a1963ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 18:10:15 +0900 Subject: [PATCH 09/11] Adjust appear animations of repeats and ticks --- .../Objects/Drawables/DrawableRepeatPoint.cs | 7 ++++--- .../Objects/Drawables/DrawableSliderTick.cs | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index dc3660ba5e..dcd191214a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -54,9 +54,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { animDuration = Math.Min(150, repeatPoint.SpanDuration / 2); - this.FadeIn(animDuration).ScaleTo(1.2f, animDuration / 2) - .Then() - .ScaleTo(1, animDuration / 2, Easing.Out); + this.Animate( + d => d.FadeIn(animDuration), + d => d.ScaleTo(0.5f).ScaleTo(1f, animDuration * 4, Easing.OutElasticHalf) + ); } protected override void UpdateCurrentState(ArmedState state) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 8b3c361945..41d73a745a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -52,9 +52,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { this.Animate( d => d.FadeIn(anim_duration), - d => d.ScaleTo(0.5f).ScaleTo(1.2f, anim_duration / 2) - ).Then( - d => d.ScaleTo(1, anim_duration / 2, Easing.Out) + d => d.ScaleTo(0.5f).ScaleTo(1f, anim_duration * 4, Easing.OutElasticHalf) ); } From 3d0ef8b3bd03ee3a2f5b1a01e252758b709961a3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 18:14:08 +0900 Subject: [PATCH 10/11] Move property back to local variable Never used elsewhere --- .../Objects/Drawables/DrawableRepeatPoint.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index dcd191214a..79a4714e33 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -16,11 +17,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; - /// - /// Whether this repeat point is at the end of the slider's curve. - /// - private bool isRepeatAtEnd => repeatPoint.RepeatIndex % 2 == 0; - private double animDuration; public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) @@ -79,9 +75,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public void UpdateSnakingPosition(Vector2 start, Vector2 end) { - Position = isRepeatAtEnd ? end : start; + bool isRepeatAtEnd = repeatPoint.RepeatIndex % 2 == 0; + List curve = drawableSlider.Body.CurrentCurve; - var curve = drawableSlider.Body.CurrentCurve; + Position = isRepeatAtEnd ? end : start; if (curve.Count < 2) return; From 62547dba5178f215d5f5bb772a32f43d1502d879 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 18:15:21 +0900 Subject: [PATCH 11/11] Remove redundant test method --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index ba555efb8e..93085df975 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -126,9 +126,7 @@ namespace osu.Game.Rulesets.Osu.Tests addSlider(slider, circleSize, speedMultiplier); } - private void testPerfect(int repeats = 0) => createPerfect(repeats); - - private void createPerfect(int repeats) + private void testPerfect(int repeats = 0) { var slider = new Slider {