From 1f1bdc6162eb972da2c7557305533f8c14a74cb5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 11 Oct 2017 18:18:06 +0900 Subject: [PATCH] Make juice streams interactive (and correctly positioned) --- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs | 1 + .../Objects/Drawable/DrawableCatchHitObject.cs | 1 - osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs | 3 +++ osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs | 2 ++ .../Objects/Drawable/DrawableJuiceStream.cs | 4 ++++ osu.Game.Rulesets.Catch/Objects/JuiceStream.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 6 +++++- 7 files changed, 16 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index b3ff1acb02..0e4935aa7a 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps yield return new Fruit { StartTime = obj.StartTime, + Samples = obj.Samples, NewCombo = comboData?.NewCombo ?? false, X = positionData.X / CatchPlayfield.BASE_WIDTH }; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index bb2df401cb..e057bf3d8e 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -25,7 +25,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable protected DrawableCatchHitObject(CatchBaseHit hitObject) : base(hitObject) { - Origin = Anchor.Centre; RelativePositionAxes = Axes.Both; X = hitObject.X; Y = (float)HitObject.StartTime; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs index fdb8c3e1e5..aedef33cfd 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using OpenTK; using OpenTK.Graphics; @@ -13,6 +14,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable public DrawableDroplet(Droplet h) : base(h) { + Origin = Anchor.Centre; + Size = new Vector2(Pulp.PULP_SIZE); AccentColour = Color4.Green; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 336647cbb9..cffb2981bf 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -17,6 +17,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable public DrawableFruit(Fruit h) : base(h) { + Origin = Anchor.Centre; + Size = new Vector2(pulp_size * 2.2f, pulp_size * 2.8f); AccentColour = HitObject.ComboColour; Masking = false; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index 162fe05fc5..19fe43a862 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { RelativeSizeAxes = Axes.Both; Height = (float)HitObject.Duration; + X = 0; Child = dropletContainer = new Container { @@ -27,6 +28,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable var start = new DrawableFruit(new Fruit { + Samples = s.Samples, ComboColour = Color4.Blue, StartTime = s.StartTime, X = s.X, @@ -36,6 +38,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable var end = new DrawableFruit(new Fruit { + Samples = s.Samples, ComboColour = Color4.Red, StartTime = s.EndTime, X = s.EndX, @@ -52,6 +55,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable protected override void AddNested(DrawableHitObject h) { + ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; dropletContainer.Add(h); base.AddNested(h); } diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index 5213d67225..fa19a6ff15 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Catch.Objects var minDistanceFromEnd = Velocity * 0.01; // temporary - while (tickDistance > 10) tickDistance /= 2; + while (tickDistance > 100) tickDistance /= 2; for (var repeat = 0; repeat < RepeatCount; repeat++) { diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 4d7af0f2b6..987eef5e45 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -83,7 +83,11 @@ namespace osu.Game.Rulesets.Catch.UI if (judgement.IsHit) { Vector2 screenPosition = judgedObject.ScreenSpaceDrawQuad.Centre; - Remove(judgedObject); + + // todo: don't do this + (judgedObject.Parent as Container)?.Remove(judgedObject); + (judgedObject.Parent as Container)?.Remove(judgedObject); + catcher.Add(judgedObject, screenPosition); } }