diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index d5167f013b..9e0ad36dd7 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; +using osu.Framework.Input; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -39,17 +40,14 @@ namespace osu.Game.Modes.Osu.Objects.Drawables }, bouncer1 = new SliderBouncer(slider, false) { Position = slider.Curve.PositionAt(1) }, bouncer2 = new SliderBouncer(slider, true) { Position = slider.Position }, - ball = new SliderBall(slider), initialCircle = new DrawableHitCircle(new HitCircle { StartTime = s.StartTime, Position = s.Position, Colour = s.Colour, Sample = s.Sample, - }) - { - Depth = -1 //override time-based depth. - }, + }), + ball = new SliderBall(slider), }; components.Add(body); @@ -104,14 +102,22 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { base.UpdateInitialState(); body.Alpha = 1; + + //we need to be visible to handle input events. note that we still don't get enough events (we don't get a position if the mouse hasn't moved since the slider appeared). + ball.Alpha = 0.01f; } protected override void UpdateState(ArmedState state) { base.UpdateState(state); + ball.FadeIn(); + Delay(HitObject.Duration, true); + body.FadeOut(160); + ball.FadeOut(160); + FadeOut(800); } } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs index c0e2030a80..61ecc09301 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -98,17 +98,18 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces } } + private bool validTrackingTime => Time.Current >= slider.StartTime && Time.Current <= slider.EndTime; + protected override void Update() { base.Update(); CornerRadius = DrawWidth / 2; - Tracking = lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; + Tracking = validTrackingTime && lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; } public void UpdateProgress(double progress, int repeat) { - Alpha = Time.Current >= slider.StartTime && Time.Current <= slider.EndTime ? 1 : 0; Position = slider.Curve.PositionAt(progress); } } diff --git a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs b/osu.Game.Mode.Osu/UI/OsuPlayfield.cs index 3ee3339f2a..9cf873dabf 100644 --- a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Mode.Osu/UI/OsuPlayfield.cs @@ -51,6 +51,7 @@ namespace osu.Game.Modes.Osu.UI public override void Add(DrawableHitObject h) { + h.Depth = (float)h.HitObject.StartTime; DrawableHitCircle c = h as DrawableHitCircle; if (c != null) { diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 06d25f8cdd..94694b8d5e 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -30,7 +30,6 @@ namespace osu.Game.Modes.Objects.Drawables public DrawableHitObject(HitObject hitObject) { HitObject = hitObject; - Depth = (float)hitObject.StartTime; } private ArmedState state;