From aa9a65d69c8b8b40bcd966af485f721b43cfdc1d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 15:42:48 +0900 Subject: [PATCH 1/6] Move load below CreateIcon(). --- .../Objects/Drawable/Pieces/BashCirclePiece.cs | 16 ++++++++-------- .../Drawable/Pieces/CentreHitCirclePiece.cs | 12 ++++++------ .../Objects/Drawable/Pieces/RimHitCirclePiece.cs | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs index 8298c5a871..db58ab9f25 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs @@ -16,14 +16,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces { private Sprite icon; - [BackgroundDependencyLoader] - private void load(OsuColour colours, TextureStore textures) - { - AccentColour = colours.YellowDark; - - icon.Texture = textures.Get(@"Play/Taiko/bash-hit-inner"); - } - protected override Framework.Graphics.Drawable CreateIcon() { return icon = new Sprite @@ -32,5 +24,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces Origin = Anchor.Centre, }; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours, TextureStore textures) + { + AccentColour = colours.YellowDark; + + icon.Texture = textures.Get(@"Play/Taiko/bash-hit-inner"); + } } } \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs index 47a366d194..a5aea77121 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs @@ -15,12 +15,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// public class CentreHitCirclePiece : CirclePiece { - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - AccentColour = colours.PinkDarker; - } - protected override Framework.Graphics.Drawable CreateIcon() { return new CircularContainer @@ -39,5 +33,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces } }; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + AccentColour = colours.PinkDarker; + } } } \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs index 2dfdf3e3b8..96563c5350 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs @@ -16,12 +16,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// public class RimHitCirclePiece : CirclePiece { - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - AccentColour = colours.BlueDarker; - } - protected override Framework.Graphics.Drawable CreateIcon() { return new CircularContainer @@ -43,5 +37,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces } }; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + AccentColour = colours.BlueDarker; + } } } \ No newline at end of file From eea24b2d824f84412a165aef9d25fdbc06b82d54 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 15:43:17 +0900 Subject: [PATCH 2/6] Make sure icon is only instantiated once. --- .../Objects/Drawable/Pieces/BashCirclePiece.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs index db58ab9f25..64787808cd 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/BashCirclePiece.cs @@ -18,11 +18,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces protected override Framework.Graphics.Drawable CreateIcon() { - return icon = new Sprite + return icon ?? (icon = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, - }; + }); } [BackgroundDependencyLoader] From 95183279f3242983a26e8c57daf4339db7eb2d51 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 15:44:43 +0900 Subject: [PATCH 3/6] Rename ScrollingCirclePiece -> ScrollingPiece. --- osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs | 2 +- osu.Game.Modes.Taiko/Objects/Drawable/Pieces/FinisherPiece.cs | 4 ++-- .../Pieces/{ScrollingCirclePiece.cs => ScrollingPiece.cs} | 2 +- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename osu.Game.Modes.Taiko/Objects/Drawable/Pieces/{ScrollingCirclePiece.cs => ScrollingPiece.cs} (89%) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs index 22bbf3c7a2..5e43f855c3 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs @@ -21,7 +21,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// Hitobjects that have a length need only to set Width and the extra corner radius will be added internally. /// /// - public abstract class CirclePiece : ScrollingCirclePiece + public abstract class CirclePiece : ScrollingPiece { /// /// The colour of the inner circle and outer glows. diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/FinisherPiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/FinisherPiece.cs index 699bac0bd0..754ba79cc2 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/FinisherPiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/FinisherPiece.cs @@ -11,9 +11,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// Finisher hitobjects are 1.5x larger, while maintaining the same length. /// /// - public class FinisherPiece : ScrollingCirclePiece + public class FinisherPiece : ScrollingPiece { - public FinisherPiece(ScrollingCirclePiece original) + public FinisherPiece(ScrollingPiece original) { // First we scale the note up Scale = new Vector2(1.5f); diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/ScrollingCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/ScrollingPiece.cs similarity index 89% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/ScrollingCirclePiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawable/Pieces/ScrollingPiece.cs index 413fc55e80..0e1fef015b 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/ScrollingCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/ScrollingPiece.cs @@ -12,7 +12,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// A scrolling circle piece must always have a centre-left origin due to how scroll position is calculated. /// /// - public class ScrollingCirclePiece : Container + public class ScrollingPiece : Container { public override Anchor Origin => Anchor.CentreLeft; } diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 94dcf150d1..54baab37f9 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -55,7 +55,7 @@ - + From 8f7ed813a3d8763d7e5861e941bcbdab371f0293 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 15:45:21 +0900 Subject: [PATCH 4/6] Cleanup. --- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 54baab37f9..ec31d0c1f6 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -94,7 +94,6 @@ osu.Game -