diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs index dca9ac9b28..e6e948cf6f 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { if (!IsLoaded) return; - Flush(true); + Flush(); UpdateInitialState(); diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 34318d3cec..7ffd93e3dc 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -3,9 +3,12 @@ using System.Collections.Generic; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -13,13 +16,16 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { private Slider slider; - private DrawableHitCircle startCircle; + private DrawableHitCircle initialCircle; private List components = new List(); + SliderBody body; + + SliderBouncer bouncer1, bouncer2; + public DrawableSlider(Slider s) : base(s) { - SliderBody body; SliderBall ball; slider = s; @@ -35,8 +41,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Position = s.Position, PathWidth = 36, }, + bouncer1 = new SliderBouncer(slider, false) { Position = slider.Curve.PositionAt(1) }, + bouncer2 = new SliderBouncer(slider, true) { Position = slider.Position }, ball = new SliderBall(slider), - startCircle = new DrawableHitCircle(new HitCircle + initialCircle = new DrawableHitCircle(new HitCircle { StartTime = s.StartTime, Position = s.Position, @@ -49,6 +57,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables components.Add(body); components.Add(ball); + components.Add(bouncer1); + components.Add(bouncer2); } protected override void Update() @@ -63,13 +73,15 @@ namespace osu.Game.Modes.Osu.Objects.Drawables if (repeat % 2 == 1) progress = 1 - progress; + bouncer2.Position = slider.Curve.PositionAt(body.SnakedAmount); + components.ForEach(c => c.UpdateProgress(progress, repeat)); } protected override void CheckJudgement(bool userTriggered) { var j = Judgement as OsuJudgementInfo; - var sc = startCircle.Judgement as OsuJudgementInfo; + var sc = initialCircle.Judgement as OsuJudgementInfo; if (!userTriggered && Time.Current >= HitObject.EndTime) { @@ -78,12 +90,19 @@ namespace osu.Game.Modes.Osu.Objects.Drawables } } + protected override void UpdateInitialState() + { + base.UpdateInitialState(); + body.Alpha = 1; + } + protected override void UpdateState(ArmedState state) { base.UpdateState(state); - Delay(HitObject.Duration); - FadeOut(100); + Delay(HitObject.Duration, true); + body.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 f7765a5057..cb6b6228ef 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; +using OpenTK; using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces @@ -30,8 +31,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces Origin = Anchor.Centre, Anchor = Anchor.Centre, Colour = Color4.Orange, - Width = 64, - Height = 64, + Width = 80, + Height = 80, }, new Container { @@ -51,8 +52,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces }, } } - }; + + Scale = new Vector2(0.94f); + } private InputState lastState; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs index 354bf80619..e3423e78a0 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -58,7 +58,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces }, } }, - }; container.Attach(RenderbufferInternalFormat.DepthComponent16); @@ -91,6 +90,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); } + public double SnakedAmount { get; private set; } + private List currentCurve = new List(); private bool updateSnaking(double p0, double p1) { @@ -123,7 +124,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public void UpdateProgress(double progress, int repeat) { double start = 0; - double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; + double end = SnakedAmount = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; if (repeat >= slider.RepeatCount - 1) { @@ -188,12 +189,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { RelativeSizeAxes = Axes.Both, Colour = Color4.White, - Size = new Vector2(0.13f, 1), + Size = new Vector2(0.16f, 1), }, gradientPortion = new Box { RelativeSizeAxes = Axes.Both, - Size = new Vector2(0.85f, 1), + Size = new Vector2(0.82f, 1), }, }, } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs new file mode 100644 index 0000000000..f8401e24a5 --- /dev/null +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs @@ -0,0 +1,58 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +{ + public class SliderBouncer : Container, ISliderProgress + { + private readonly Slider slider; + private readonly bool isEnd; + + public SliderBouncer(Slider slider, bool isEnd) + { + this.slider = slider; + this.isEnd = isEnd; + + Masking = true; + AutoSizeAxes = Axes.Both; + BlendingMode = BlendingMode.Additive; + Origin = Anchor.Centre; + + Children = new Drawable[] + { + new Container + { + Masking = true, + AutoSizeAxes = Axes.Both, + + CornerRadius = 16, + Children = new[] + { + new Box + { + Width = 32, + Height = 32, + }, + } + } + }; + } + + public void UpdateProgress(double progress, int repeat) + { + if (Time.Current < slider.StartTime) + Alpha = 0; + + Alpha = repeat + 1 < slider.RepeatCount && repeat % 2 == (isEnd ? 0 : 1) ? 1 : 0; + } + } +} diff --git a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj index 1f53c706cc..f6b4436951 100644 --- a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj @@ -52,6 +52,7 @@ +