From d94c3139478783c6becd135ec1c27f1145c2c737 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 3 Jan 2018 08:13:58 +0100 Subject: [PATCH 1/8] fix slider follow circle instantly disappearing on slider ends --- .../Objects/Drawables/Pieces/SliderBall.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 2068ad9205..e38ff4ac49 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -108,6 +108,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces base.ClearTransforms(false, targetMember); } + public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) + { + // Same reasoning as in ClearTransforms. + base.ClearTransformsAfter(time, false, targetMember); + } + private bool tracking; public bool Tracking { @@ -141,4 +147,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces Position = slider.Curve.PositionAt(progress); } } -} \ No newline at end of file +} From 1ce6219293b9998af892af3147edeb3974ddb5da Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 3 Jan 2018 13:55:24 +0100 Subject: [PATCH 2/8] remove unnecessary override --- .../Objects/Drawables/Pieces/SliderBall.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index e38ff4ac49..78001e4516 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -101,16 +101,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces // If the current time is between the start and end of the slider, we should track mouse input regardless of the cursor position. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => canCurrentlyTrack || base.ReceiveMouseInputAt(screenSpacePos); - public override void ClearTransforms(bool propagateChildren = false, string targetMember = null) + public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { // Consider the case of rewinding - children's transforms are handled internally, so propagating down // any further will cause weirdness with the Tracking bool below. Let's not propagate further at this point. - base.ClearTransforms(false, targetMember); - } - - public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) - { - // Same reasoning as in ClearTransforms. base.ClearTransformsAfter(time, false, targetMember); } From bde957940dd030e134cade0da20e17d64ff1b119 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 20:09:58 +0900 Subject: [PATCH 3/8] Disallow SliderBall from contracting after EndTime --- .../Objects/Drawables/Pieces/SliderBall.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 78001e4516..864251b47b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -129,11 +129,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { base.Update(); - // Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. - Tracking = canCurrentlyTrack - && lastState != null - && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) - && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); + if (Time.Current < slider.EndTime) + { + // Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. + Tracking = canCurrentlyTrack + && lastState != null + && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) + && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); + } } public void UpdateProgress(double progress, int repeat) From ffc7f7ecf432755b1b4f59bfd9f180c9a23c97d9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 20:10:13 +0900 Subject: [PATCH 4/8] Add a better slider "hit" state fade out animation --- .../Objects/Drawables/DrawableSlider.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 5a8bcae277..2a7a42a5a5 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -161,11 +161,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables using (BeginDelayedSequence(slider.Duration, true)) { - Body.FadeOut(160); - Ball.FadeOut(160); + Body.FadeOut(450, Easing.OutQuint); + Ball.FadeOut(450, Easing.OutQuint); - this.FadeOut(800) - .Expire(); + switch (state) + { + case ArmedState.Idle: + break; + case ArmedState.Hit: + Ball.ScaleTo(HitObject.Scale * 1.5f, 450, Easing.OutQuint); + break; + case ArmedState.Miss: + break; + } + + this.FadeOut(800, Easing.Out).Expire(); } } From 155e84d2b70a798bf5f07dbf1a98a0b0d08a8cd8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 20:24:59 +0900 Subject: [PATCH 5/8] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 6134dafccb..8366ab1705 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6134dafccb3368dac96d837537325c04b89fb8ee +Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec From 1f62fe19d55337209a0b69ace46ab7f14ac6c5ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 20:43:42 +0900 Subject: [PATCH 6/8] Make animation a bit more subtle --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 8 +++++--- .../Objects/Drawables/Pieces/SliderBall.cs | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 2a7a42a5a5..5f46b5b36e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -161,15 +161,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables using (BeginDelayedSequence(slider.Duration, true)) { - Body.FadeOut(450, Easing.OutQuint); - Ball.FadeOut(450, Easing.OutQuint); + const float fade_out_time = 450; + + Body.FadeOut(fade_out_time, Easing.Out); + Ball.FadeOut(fade_out_time / 4, Easing.Out); switch (state) { case ArmedState.Idle: break; case ArmedState.Hit: - Ball.ScaleTo(HitObject.Scale * 1.5f, 450, Easing.OutQuint); + Ball.ScaleTo(HitObject.Scale * 1.4f, fade_out_time, Easing.Out); break; case ArmedState.Miss: break; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 864251b47b..46b4353f9a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } private readonly Slider slider; - private readonly Box follow; + public readonly Box FollowCircle; private readonly Box ball; public SliderBall(Slider slider) @@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces Children = new Drawable[] { - follow = new Box + FollowCircle = new Box { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -118,8 +118,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; tracking = value; - follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); - follow.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); + FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); + FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); } } From 717b263b772590df54294f42e370d4e8e09cfe5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 20:47:42 +0900 Subject: [PATCH 7/8] Comment and better stacking of FadeOuts --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 5f46b5b36e..61b992cc95 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { const float fade_out_time = 450; - Body.FadeOut(fade_out_time, Easing.Out); + // intentionally pile on an extra FadeOut to make it happen much faster. Ball.FadeOut(fade_out_time / 4, Easing.Out); switch (state) @@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; } - this.FadeOut(800, Easing.Out).Expire(); + this.FadeOut(fade_out_time, Easing.OutQuint).Expire(); } } From 0cc8516aa3b044c993c8a34cb5dc7ec24c783946 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 20:53:33 +0900 Subject: [PATCH 8/8] Remove empty cases, add initial ball scale adjust. --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 61b992cc95..f32a027f2e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -158,6 +158,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void UpdateCurrentState(ArmedState state) { Ball.FadeIn(); + Ball.ScaleTo(HitObject.Scale); using (BeginDelayedSequence(slider.Duration, true)) { @@ -168,13 +169,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables switch (state) { - case ArmedState.Idle: - break; case ArmedState.Hit: Ball.ScaleTo(HitObject.Scale * 1.4f, fade_out_time, Easing.Out); break; - case ArmedState.Miss: - break; } this.FadeOut(fade_out_time, Easing.OutQuint).Expire();