diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index db7f9a2f6a..b5fc96bd20 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; +using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -27,36 +28,52 @@ public override void Reset() Reset(); }); - Add(new CentreHitCirclePiece(new CirclePiece + Add(new CirclePiece { - KiaiMode = kiai - }) - { - Position = new Vector2(100, 100) + Position = new Vector2(100, 100), + Width = 0, + AccentColour = Color4.DarkRed, + KiaiMode = kiai, + Children = new[] + { + new CentreHitSymbolPiece() + } }); - Add(new CentreHitCirclePiece(new StrongCirclePiece + Add(new StrongCirclePiece { - KiaiMode = kiai - }) - { - Position = new Vector2(350, 100) + Position = new Vector2(350, 100), + Width = 0, + AccentColour = Color4.DarkRed, + KiaiMode = kiai, + Children = new[] + { + new CentreHitSymbolPiece() + } }); - Add(new RimHitCirclePiece(new CirclePiece + Add(new CirclePiece { - KiaiMode = kiai - }) - { - Position = new Vector2(100, 300) + Position = new Vector2(100, 300), + Width = 0, + AccentColour = Color4.DarkBlue, + KiaiMode = kiai, + Children = new[] + { + new RimHitSymbolPiece() + } }); - Add(new RimHitCirclePiece(new StrongCirclePiece + Add(new StrongCirclePiece { - KiaiMode = kiai - }) - { - Position = new Vector2(350, 300) + Position = new Vector2(350, 300), + Width = 0, + AccentColour = Color4.DarkBlue, + KiaiMode = kiai, + Children = new[] + { + new RimHitSymbolPiece() + } }); Add(new SwellCircle(new CirclePiece diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs index b3f9974c15..a3fcf26f6d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using OpenTK.Input; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using osu.Game.Graphics; +using osu.Framework.Allocation; namespace osu.Game.Modes.Taiko.Objects.Drawable { @@ -11,10 +13,24 @@ public class DrawableCentreHit : DrawableHit { protected override List HitKeys { get; } = new List(new[] { Key.F, Key.J }); + private readonly CirclePiece circlePiece; + public DrawableCentreHit(Hit hit) : base(hit) { - Add(new CentreHitCirclePiece(new CirclePiece())); + Add(circlePiece = new CirclePiece + { + Children = new[] + { + new CentreHitSymbolPiece() + } + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + circlePiece.AccentColour = colours.PinkDarker; } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs index 983471d70a..029cdfb7e7 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Game.Graphics; using OpenTK.Input; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; @@ -11,10 +13,24 @@ public class DrawableRimHit : DrawableHit { protected override List HitKeys { get; } = new List(new[] { Key.D, Key.K }); + private readonly CirclePiece circlePiece; + public DrawableRimHit(Hit hit) : base(hit) { - Add(new RimHitCirclePiece(new CirclePiece())); + Add(circlePiece = new CirclePiece + { + Children = new[] + { + new RimHitSymbolPiece() + } + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + circlePiece.AccentColour = colours.BlueDarker; } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs index 2ad4537bce..7b21924868 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using OpenTK.Input; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using osu.Framework.Allocation; +using osu.Game.Graphics; namespace osu.Game.Modes.Taiko.Objects.Drawable { @@ -11,10 +13,24 @@ public class DrawableStrongCentreHit : DrawableStrongHit { protected override List HitKeys { get; } = new List(new[] { Key.F, Key.J }); + private readonly CirclePiece circlePiece; + public DrawableStrongCentreHit(Hit hit) : base(hit) { - Add(new CentreHitCirclePiece(new StrongCirclePiece())); + Add(circlePiece = new StrongCirclePiece + { + Children = new [] + { + new CentreHitSymbolPiece() + } + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + circlePiece.AccentColour = colours.PinkDarker; } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs index c25030b634..74d8cdfd49 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Game.Graphics; using OpenTK.Input; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; @@ -11,10 +13,24 @@ public class DrawableStrongRimHit : DrawableStrongHit { protected override List HitKeys { get; } = new List(new[] { Key.D, Key.K }); + private readonly CirclePiece circlePiece; + public DrawableStrongRimHit(Hit hit) : base(hit) { - Add(new RimHitCirclePiece(new StrongCirclePiece())); + Add(circlePiece = new StrongCirclePiece + { + Children = new[] + { + new RimHitSymbolPiece() + } + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + circlePiece.AccentColour = colours.BlueDarker; } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs deleted file mode 100644 index 78c3aaec01..0000000000 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitCirclePiece.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; -using OpenTK; - -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces -{ - /// - /// A circle piece used for centre hits. - /// - public class CentreHitCirclePiece : Container - { - private readonly CirclePiece circle; - - public CentreHitCirclePiece(CirclePiece piece) - { - Add(circle = piece); - - circle.Add(new CircularContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE), - Masking = true, - Children = new[] - { - new Box - { - RelativeSizeAxes = Axes.Both - } - } - }); - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - circle.AccentColour = colours.PinkDarker; - } - } -} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitSymbolPiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitSymbolPiece.cs new file mode 100644 index 0000000000..e62ca6b073 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitSymbolPiece.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using OpenTK; + +namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +{ + /// + /// The symbol used for centre hit pieces. + /// + public class CentreHitSymbolPiece : CircularContainer + { + public CentreHitSymbolPiece() + { + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE); + Masking = true; + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both + } + }; + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs deleted file mode 100644 index d2b3833346..0000000000 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitCirclePiece.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; - -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces -{ - public class RimHitCirclePiece : Container - { - private readonly CirclePiece circle; - - public RimHitCirclePiece(CirclePiece piece) - { - Add(circle = piece); - - circle.Add(new CircularContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(CirclePiece.SYMBOL_SIZE), - BorderThickness = CirclePiece.SYMBOL_BORDER, - BorderColour = Color4.White, - Masking = true, - Children = new[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true - } - } - }); - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - circle.AccentColour = colours.BlueDarker; - } - } -} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitSymbolPiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitSymbolPiece.cs new file mode 100644 index 0000000000..6999634108 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitSymbolPiece.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +{ + /// + /// The symbol used for rim hit pieces. + /// + public class RimHitSymbolPiece : CircularContainer + { + public RimHitSymbolPiece() + { + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + Size = new Vector2(CirclePiece.SYMBOL_SIZE); + BorderThickness = CirclePiece.SYMBOL_BORDER; + BorderColour = Color4.White; + Masking = true; + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true + } + }; + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index cd1550334c..07f9a5d4e6 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -54,16 +54,16 @@ - - + +