From af0eaab78c49b667e94065701a5a53e2f20f04b7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 7 Sep 2017 01:46:07 +0900 Subject: [PATCH 01/12] maybe fix --- osu.Game/Beatmaps/WorkingBeatmap.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 462f94ed7c..3793f20222 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -87,7 +87,9 @@ namespace osu.Game.Beatmaps { if (track != null) return track; - track = GetTrack(); + // we want to ensure that we always have a track, even if it's a fake one. + track = GetTrack() ?? new TrackVirtual(); + applyRateAdjustments(); return track; } From 4d77a81e40a2c71456f6840367751d3c492d4675 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 03:50:16 +0900 Subject: [PATCH 02/12] Make TestCaseManiaHitObjects work again. --- .../Visual/TestCaseManiaHitObjects.cs | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs b/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs index 76235bbf19..8f0e87bee6 100644 --- a/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs +++ b/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs @@ -41,8 +41,22 @@ namespace osu.Desktop.Tests.Visual RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableNote(new Note { StartTime = 5000 }, ManiaAction.Key1) { AccentColour = Color4.Red }, - new DrawableNote(new Note { StartTime = 6000 }, ManiaAction.Key1) { AccentColour = Color4.Red } + new DrawableNote(new Note(), ManiaAction.Key1) + { + RelativePositionAxes = Axes.Y, + Y = 5000, + LifetimeStart = double.MinValue, + LifetimeEnd = double.MaxValue, + AccentColour = Color4.Red + }, + new DrawableNote(new Note(), ManiaAction.Key1) + { + RelativePositionAxes = Axes.Y, + Y = 6000, + LifetimeStart = double.MinValue, + LifetimeEnd = double.MaxValue, + AccentColour = Color4.Red + } } } } @@ -63,11 +77,15 @@ namespace osu.Desktop.Tests.Visual RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote + new DrawableHoldNote(new HoldNote(), ManiaAction.Key1) { - StartTime = 5000, - Duration = 1000 - }, ManiaAction.Key1) { AccentColour = Color4.Red } + RelativePositionAxes = Axes.Y, + Y = 5000, + Height = 3000, + LifetimeStart = double.MinValue, + LifetimeEnd = double.MaxValue, + AccentColour = Color4.Red + } } } } From 8797382700c9264841e52043ea1f4623940f7151 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:21:22 +0900 Subject: [PATCH 03/12] Update body styling of hold notes --- .../Objects/Drawables/DrawableHoldNote.cs | 9 ++ .../Objects/Drawables/DrawableNote.cs | 2 +- .../Objects/Drawables/Pieces/BodyPiece.cs | 95 ++++++++++++++++++- 3 files changed, 100 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index e06f71cb64..93e26927e9 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -49,6 +49,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, }, tickContainer = new Container { @@ -104,6 +105,14 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { } + protected override void Update() + { + base.Update(); + + bodyPiece.Y = head.Height; + bodyPiece.Height = DrawHeight - head.Height; + } + public bool OnPressed(ManiaAction action) { // Make sure the action happened within the body of the hold note diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index c201ab7bd0..6d4f921020 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables : base(hitObject, action) { RelativeSizeAxes = Axes.X; - Height = 100; + AutoSizeAxes = Axes.Y; Add(headPiece = new NotePiece { diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs index 04e8df4ae2..ac7054abe8 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs @@ -1,7 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using osu.Framework.Caching; using OpenTK.Graphics; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -14,22 +17,61 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces /// internal class BodyPiece : Container, IHasAccentColour { - private readonly Box box; + private readonly Container subtractionLayer; + + private readonly Drawable background; + private readonly BufferedContainer foreground; + private readonly BufferedContainer subtractionContainer; public BodyPiece() { - RelativeSizeAxes = Axes.Both; + Blending = BlendingMode.Additive; Children = new[] { - box = new Box + background = new Box { RelativeSizeAxes = Axes.Both }, + foreground = new BufferedContainer { RelativeSizeAxes = Axes.Both, - Alpha = 0.3f + CacheDrawnFrameBuffer = true, + Children = new Drawable[] + { + new Box { RelativeSizeAxes = Axes.Both }, + subtractionContainer = new BufferedContainer + { + RelativeSizeAxes = Axes.Both, + // This is needed because we're blending with another object + BackgroundColour = Color4.White.Opacity(0), + CacheDrawnFrameBuffer = true, + // The 'hole' is achieved by subtracting the result of this container with the parent + Blending = new BlendingModeParameters { AlphaEquation = BlendingEquation.ReverseSubtract }, + Child = subtractionLayer = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + // Height computed in Update + Width = 1, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true + } + } + } + } } }; } + protected override void LoadComplete() + { + base.LoadComplete(); + + updateAccentColour(); + } + private Color4 accentColour; public Color4 AccentColour { @@ -40,8 +82,51 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces return; accentColour = value; - box.Colour = accentColour; + updateAccentColour(); } } + + private Cached subtractionCache = new Cached(); + + public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) + { + if ((invalidation & Invalidation.DrawSize) > 0) + subtractionCache.Invalidate(); + + return base.Invalidate(invalidation, source, shallPropagate); + } + + protected override void Update() + { + base.Update(); + + if (!subtractionCache.IsValid) + { + subtractionLayer.Width = 5; + subtractionLayer.Height = Math.Max(0, DrawHeight - DrawWidth); + subtractionLayer.EdgeEffect = new EdgeEffectParameters + { + Colour = Color4.White, + Type = EdgeEffectType.Glow, + Radius = DrawWidth + }; + + foreground.ForceRedraw(); + subtractionContainer.ForceRedraw(); + + subtractionCache.Validate(); + } + } + + private void updateAccentColour() + { + if (!IsLoaded) + return; + + foreground.Colour = AccentColour.Opacity(0.4f); + background.Colour = AccentColour.Opacity(0.2f); + + subtractionCache.Invalidate(); + } } } From 73d77637efe4e54294779e8cc15dc220115cd447 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:22:05 +0900 Subject: [PATCH 04/12] Add glow to DrawableNote --- .../Objects/Drawables/DrawableNote.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 6d4f921020..707b83ef13 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -2,8 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using osu.Framework.Extensions.Color4Extensions; using OpenTK.Graphics; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Input.Bindings; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; @@ -16,6 +18,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// public class DrawableNote : DrawableManiaHitObject, IKeyBindingHandler { + /// + /// Whether the glow for this is handled by a containing it. + /// + protected bool HasOwnGlow = true; + private readonly NotePiece headPiece; public DrawableNote(Note hitObject, ManiaAction action) @@ -23,6 +30,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; + Masking = true; Add(headPiece = new NotePiece { @@ -31,6 +39,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables }); } + protected override void LoadComplete() + { + base.LoadComplete(); + + UpdateGlow(); + } + public override Color4 AccentColour { get { return base.AccentColour; } @@ -41,6 +56,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables base.AccentColour = value; headPiece.AccentColour = value; + + UpdateGlow(); } } @@ -79,6 +96,23 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables } } + protected virtual void UpdateGlow() + { + if (!IsLoaded) + return; + + if (!HasOwnGlow) + return; + + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Colour = AccentColour.Opacity(0.5f), + Radius = 10, + Hollow = true + }; + } + public virtual bool OnPressed(ManiaAction action) { if (action != Action) From 590a34dc28d7b45531afc51580078cac4e0470df Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:22:17 +0900 Subject: [PATCH 05/12] Add glow to DrawableHoldNote --- .../Objects/Drawables/DrawableHoldNote.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 93e26927e9..3ac8f2a2ee 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Extensions.Color4Extensions; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; @@ -9,6 +10,7 @@ using OpenTK; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Bindings; namespace osu.Game.Rulesets.Mania.Objects.Drawables @@ -23,6 +25,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private readonly BodyPiece bodyPiece; private readonly Container tickContainer; + private readonly Container glowContainer; /// /// Time at which the user started holding this hold note. Null if the user is not holding this hold note. @@ -66,6 +69,17 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre + }, + glowContainer = new Container + { + RelativeSizeAxes = Axes.X, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true + } } }); @@ -111,6 +125,15 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables bodyPiece.Y = head.Height; bodyPiece.Height = DrawHeight - head.Height; + + glowContainer.Height = DrawHeight + tail.Height; + glowContainer.EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Colour = AccentColour.Opacity(0.5f), + Radius = 10, + Hollow = true, + }; } public bool OnPressed(ManiaAction action) @@ -162,6 +185,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables RelativePositionAxes = Axes.None; Y = 0; + + HasOwnGlow = false; } public override bool OnPressed(ManiaAction action) @@ -199,6 +224,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables RelativePositionAxes = Axes.None; Y = 0; + + HasOwnGlow = false; } protected override ManiaJudgement CreateJudgement() => new HoldNoteTailJudgement(); From 3b5e847a31a2ab51b76fff5a8f29e2eb8022e16b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:29:32 +0900 Subject: [PATCH 06/12] Better updateGlow methods. --- .../Objects/Drawables/DrawableHoldNote.cs | 35 +++++++++++++---- .../Objects/Drawables/DrawableNote.cs | 38 +++++++++---------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 3ac8f2a2ee..671884fe17 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -70,6 +70,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre }, + // The hit object itself cannot be used for the glow because the tail overshoots it + // So a specialized container that is updated to contain the tail height is used glowContainer = new Container { RelativeSizeAxes = Axes.X, @@ -98,6 +100,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables AddNested(tail); } + protected override void LoadComplete() + { + base.LoadComplete(); + + updateGlow(); + } + public override Color4 AccentColour { get { return base.AccentColour; } @@ -112,9 +121,25 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables bodyPiece.AccentColour = value; head.AccentColour = value; tail.AccentColour = value; + + updateGlow(); } } + private void updateGlow() + { + if (!IsLoaded) + return; + + glowContainer.EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Colour = AccentColour.Opacity(0.5f), + Radius = 10, + Hollow = true + }; + } + protected override void UpdateState(ArmedState state) { } @@ -123,17 +148,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { base.Update(); + // Make the body piece not lie under the head note bodyPiece.Y = head.Height; bodyPiece.Height = DrawHeight - head.Height; + // Make the glowContainer "contain" the height of the tail note, keeping in mind + // that the tail note overshoots the height of this hit object glowContainer.Height = DrawHeight + tail.Height; - glowContainer.EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Colour = AccentColour.Opacity(0.5f), - Radius = 10, - Hollow = true, - }; } public bool OnPressed(ManiaAction action) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 707b83ef13..310d6ba347 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { base.LoadComplete(); - UpdateGlow(); + updateGlow(); } public override Color4 AccentColour @@ -57,10 +57,27 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables headPiece.AccentColour = value; - UpdateGlow(); + updateGlow(); } } + private void updateGlow() + { + if (!IsLoaded) + return; + + if (!HasOwnGlow) + return; + + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Colour = AccentColour.Opacity(0.5f), + Radius = 10, + Hollow = true + }; + } + protected override void CheckJudgement(bool userTriggered) { if (!userTriggered) @@ -96,23 +113,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables } } - protected virtual void UpdateGlow() - { - if (!IsLoaded) - return; - - if (!HasOwnGlow) - return; - - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Colour = AccentColour.Opacity(0.5f), - Radius = 10, - Hollow = true - }; - } - public virtual bool OnPressed(ManiaAction action) { if (action != Action) From 8bb8999820d71fc2df666ed3fd0c675dd4eaa15e Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:34:30 +0900 Subject: [PATCH 07/12] More TestCaseManiaHitObjects fixes. --- osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs | 5 +---- .../Objects/Drawables/DrawableHoldNote.cs | 8 ++++++++ .../Objects/Drawables/DrawableManiaHitObject.cs | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs b/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs index 8f0e87bee6..d855e86aa0 100644 --- a/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs +++ b/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs @@ -43,7 +43,6 @@ namespace osu.Desktop.Tests.Visual { new DrawableNote(new Note(), ManiaAction.Key1) { - RelativePositionAxes = Axes.Y, Y = 5000, LifetimeStart = double.MinValue, LifetimeEnd = double.MaxValue, @@ -51,7 +50,6 @@ namespace osu.Desktop.Tests.Visual }, new DrawableNote(new Note(), ManiaAction.Key1) { - RelativePositionAxes = Axes.Y, Y = 6000, LifetimeStart = double.MinValue, LifetimeEnd = double.MaxValue, @@ -79,9 +77,8 @@ namespace osu.Desktop.Tests.Visual { new DrawableHoldNote(new HoldNote(), ManiaAction.Key1) { - RelativePositionAxes = Axes.Y, Y = 5000, - Height = 3000, + Height = 1000, LifetimeStart = double.MinValue, LifetimeEnd = double.MaxValue, AccentColour = Color4.Red diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 671884fe17..e2ab405cf5 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -207,6 +207,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables RelativePositionAxes = Axes.None; Y = 0; + // Life time managed by the parent DrawableHoldNote + LifetimeStart = double.MinValue; + LifetimeEnd = double.MaxValue; + HasOwnGlow = false; } @@ -246,6 +250,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables RelativePositionAxes = Axes.None; Y = 0; + // Life time managed by the parent DrawableHoldNote + LifetimeStart = double.MinValue; + LifetimeEnd = double.MaxValue; + HasOwnGlow = false; } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index bfef05ea07..f6129602a8 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; using OpenTK.Graphics; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Objects.Drawables; @@ -20,6 +21,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables protected DrawableManiaHitObject(TObject hitObject, ManiaAction? action = null) : base(hitObject) { + RelativePositionAxes = Axes.Y; HitObject = hitObject; if (action != null) From 79a9612243eb7d28b3131068d1d9dd3d2c4ba90f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:37:48 +0900 Subject: [PATCH 08/12] Remove now unnecessary comment. --- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index e2ab405cf5..3bfcf401d7 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -45,9 +45,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables AddRange(new Drawable[] { - // For now the body piece covers the entire height of the container - // whereas possibly in the future we don't want to extend under the head/tail. - // This will be fixed when new designs are given or the current design is finalized. bodyPiece = new BodyPiece { Anchor = Anchor.TopCentre, From 9cd3af11d5911a9efa0c37c8691f296aa85ee925 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:45:10 +0900 Subject: [PATCH 09/12] Fix hold note tick position + lifetime. --- .../Objects/Drawables/DrawableHoldNoteTick.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 39abbb6b3d..546afd089b 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -36,9 +36,15 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; + Y = (float)HitObject.StartTime; + RelativeSizeAxes = Axes.X; Size = new Vector2(1); + // Life time managed by the parent DrawableHoldNote + LifetimeStart = double.MinValue; + LifetimeEnd = double.MaxValue; + Children = new[] { glowContainer = new CircularContainer From 2086ed209db9c14c193afe4b4dba339eadfce727 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 04:51:44 +0900 Subject: [PATCH 10/12] Fix hold note tick input. --- .../Objects/Drawables/DrawableHoldNoteTick.cs | 8 ++------ osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 546afd089b..7a397514d8 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; namespace osu.Game.Rulesets.Mania.Objects.Drawables { @@ -23,11 +24,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// public Func HoldStartTime; - /// - /// References whether the user is currently holding the hold note. - /// - public Func IsHolding; - private readonly Container glowContainer; public DrawableHoldNoteTick(HoldNoteTick hitObject) @@ -118,7 +114,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (Judgement.Result != HitResult.None) return; - if (IsHolding?.Invoke() != true) + if (HoldStartTime?.Invoke() == null) return; UpdateJudgement(true); diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 3fba168216..369ea76028 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -12,10 +12,11 @@ using osu.Game.Rulesets.Objects.Types; using OpenTK.Graphics; using osu.Game.Audio; using System.Linq; +using osu.Game.Graphics; namespace osu.Game.Rulesets.Objects.Drawables { - public abstract class DrawableHitObject : Container + public abstract class DrawableHitObject : Container, IHasAccentColour { public readonly HitObject HitObject; From 2f72dff779b39c6efd712936fb2967e348c67a2f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 08:59:56 +0900 Subject: [PATCH 11/12] Update with framework changes. --- osu-framework | 2 +- .../Objects/Drawables/DrawableHoldNoteTick.cs | 1 - osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu-framework b/osu-framework index d891fc31d8..c9a1998676 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d891fc31d8dbe5ee88b798eca9d0a5a7483a144f +Subproject commit c9a1998676c57f8d5e6a9d817e75b506d40e4246 diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 7a397514d8..7f4ec8d8d2 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; namespace osu.Game.Rulesets.Mania.Objects.Drawables { diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs index ac7054abe8..fe40532e42 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces BackgroundColour = Color4.White.Opacity(0), CacheDrawnFrameBuffer = true, // The 'hole' is achieved by subtracting the result of this container with the parent - Blending = new BlendingModeParameters { AlphaEquation = BlendingEquation.ReverseSubtract }, + Blending = new BlendingParameters { AlphaEquation = BlendingEquation.ReverseSubtract }, Child = subtractionLayer = new CircularContainer { Anchor = Anchor.Centre, From de7d50d384a9551ed523759ce51deda564ee5b88 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 15:08:51 +0900 Subject: [PATCH 12/12] Better variable + comment naming --- .../Objects/Drawables/DrawableHoldNote.cs | 4 ++-- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 3bfcf401d7..3b801cba01 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -208,7 +208,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables LifetimeStart = double.MinValue; LifetimeEnd = double.MaxValue; - HasOwnGlow = false; + ApplyGlow = false; } public override bool OnPressed(ManiaAction action) @@ -251,7 +251,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables LifetimeStart = double.MinValue; LifetimeEnd = double.MaxValue; - HasOwnGlow = false; + ApplyGlow = false; } protected override ManiaJudgement CreateJudgement() => new HoldNoteTailJudgement(); diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 310d6ba347..a58ae9b31c 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -19,9 +19,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables public class DrawableNote : DrawableManiaHitObject, IKeyBindingHandler { /// - /// Whether the glow for this is handled by a containing it. + /// Gets or sets whether this should apply glow to itself. /// - protected bool HasOwnGlow = true; + protected bool ApplyGlow = true; private readonly NotePiece headPiece; @@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (!IsLoaded) return; - if (!HasOwnGlow) + if (!ApplyGlow) return; EdgeEffect = new EdgeEffectParameters