From fd9b985d2f33c05b9ca2d682a359a06ae14c17ae Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Fri, 23 Sep 2022 20:19:44 +0200 Subject: [PATCH 1/6] Move all visual pieces to Skinning namespace --- .../Objects/Slides/TestSceneAllSlides.cs | 2 +- .../Objects/Slides/TestSceneFanSlide.cs | 2 +- .../Objects/Slides/TestSceneSlide.cs | 2 +- .../Objects/TestSceneSlideFan.cs | 2 +- .../Objects/TestSceneSlideNote.cs | 2 +- .../Objects/Drawables/DrawableHold.cs | 2 +- .../Objects/Drawables/DrawableSlideBody.cs | 2 +- .../Objects/Drawables/DrawableSlideFan.cs | 2 +- .../Objects/Drawables/DrawableSlideTap.cs | 2 +- .../Objects/Drawables/DrawableTap.cs | 2 +- .../Objects/Drawables/DrawableTouch.cs | 2 +- .../Objects/Drawables/DrawableTouchHold.cs | 2 +- .../Drawables/Pieces/Touches/TouchBlobs.cs | 122 ------------------ .../Drawables/Pieces/TrianglesPiece.cs | 21 --- .../Pieces => Skinning/Default}/DotPiece.cs | 2 +- .../Pieces => Skinning/Default}/HoldBody.cs | 2 +- .../Default}/NoteRingPiece.cs | 2 +- .../Pieces => Skinning/Default}/RingPiece.cs | 2 +- .../Default}/ShadowPiece.cs | 2 +- .../Default}/Slides/ISlideChevron.cs | 2 +- .../Default}/Slides/ISlideVisual.cs | 2 +- .../Default}/Slides/SlideFanChevrons.cs | 2 +- .../Default}/Slides/SlideFanVisual.cs | 2 +- .../Default}/Slides/SlideTapPiece.cs | 2 +- .../Default}/Slides/SlideVisual.cs | 3 +- .../Default}/Slides/SlideVisualBase.cs | 2 +- .../Default}/Slides/StarPiece.cs | 2 +- .../Pieces => Skinning/Default}/TapPiece.cs | 2 +- .../Default}/TouchHolds/TouchHoldBody.cs | 2 +- .../TouchHolds/TouchHoldCentrePiece.cs | 2 +- .../TouchHolds/TouchHoldProgressPiece.cs | 2 +- .../Default}/Touches/TouchBody.cs | 2 +- .../Default}/Touches/TouchPiece.cs | 2 +- .../UI/Components/SentakkiRing.cs | 2 +- .../UI/DrawableSentakkiRuleset.cs | 2 +- .../UI/LanedPlayfield.cs | 2 +- 36 files changed, 35 insertions(+), 177 deletions(-) delete mode 100644 osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs delete mode 100644 osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/DotPiece.cs (96%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/HoldBody.cs (95%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/NoteRingPiece.cs (92%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/RingPiece.cs (96%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/ShadowPiece.cs (93%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/ISlideChevron.cs (81%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/ISlideVisual.cs (77%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/SlideFanChevrons.cs (98%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/SlideFanVisual.cs (95%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/SlideTapPiece.cs (95%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/SlideVisual.cs (97%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/SlideVisualBase.cs (97%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Slides/StarPiece.cs (90%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/TapPiece.cs (94%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/TouchHolds/TouchHoldBody.cs (95%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/TouchHolds/TouchHoldCentrePiece.cs (97%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/TouchHolds/TouchHoldProgressPiece.cs (97%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Touches/TouchBody.cs (97%) rename osu.Game.Rulesets.Sentakki/{Objects/Drawables/Pieces => Skinning/Default}/Touches/TouchPiece.cs (93%) diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs index ecfb58608..eab5138d9 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneAllSlides.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Sentakki.Objects; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.Sentakki.UI; using osu.Game.Rulesets.Sentakki.UI.Components; using osu.Game.Tests.Visual; diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs index 30760bcbb..956a5768c 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneFanSlide.cs @@ -1,7 +1,7 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.Sentakki.UI; using osu.Game.Rulesets.Sentakki.UI.Components; using osu.Game.Tests.Visual; diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs index 8c45c0ea2..7a03f22c4 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Sentakki.Objects; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.Sentakki.UI; using osu.Game.Rulesets.Sentakki.UI.Components; using osu.Game.Tests.Visual; diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs index 87f912ce6..d4175f6ee 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs @@ -8,7 +8,7 @@ using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Objects.Drawables; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Sentakki.Tests.Objects diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs index 9d341f537..26a4f3754 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs @@ -9,7 +9,7 @@ using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Objects.Drawables; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Sentakki.Tests.Objects diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs index 4242c625b..377eec25d 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs @@ -8,7 +8,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Sentakki.Skinning.Default; using osu.Game.Rulesets.Sentakki.UI; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs index a8d68f971..ef607e6c0 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs @@ -9,7 +9,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs index 6d0f035a1..4dce962ef 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs @@ -1,4 +1,4 @@ -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.Sentakki.UI; using osuTK; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs index 8bd912e11..d0b2f1af3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs @@ -1,6 +1,6 @@ using System.Linq; using osu.Framework.Graphics; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs index ce790f68e..f0e2ef0af 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs @@ -5,7 +5,7 @@ using osu.Framework.Input.Events; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Sentakki.Skinning.Default; using osu.Game.Rulesets.Sentakki.UI; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs index 2ecdf0c1c..9963fa540 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs @@ -5,7 +5,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Sentakki.Configuration; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Touches; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs index e61e65cc0..18255ebcd 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs @@ -12,7 +12,7 @@ using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Sentakki.Configuration; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds; +using osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds; using osu.Game.Skinning; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs deleted file mode 100644 index 2c7784153..000000000 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBlobs.cs +++ /dev/null @@ -1,122 +0,0 @@ -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Objects.Drawables; -using osuTK; -using osuTK.Graphics; - -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches -{ - public class TouchBlob : CircularContainer - { - public TouchBlob() - { - Size = new Vector2(80); - Scale = new Vector2(.5f); - Anchor = Anchor.Centre; - Origin = Anchor.Centre; - Children = new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Padding = new MarginPadding(1), - Child = new Container - { - Alpha = .5f, - Masking = true, - RelativeSizeAxes = Axes.Both, - CornerRadius = 20, - CornerExponent = 2.5f, - EdgeEffect = new EdgeEffectParameters - { - Hollow = true, - Type = EdgeEffectType.Shadow, - Radius = 15, - Colour = Color4.Black, - } - } - }, - new Container - { - CornerRadius = 20, - CornerExponent = 2.5f, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = 16.35f, - BorderColour = Color4.Gray, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha= 0, - AlwaysPresent = true - } - }, - new Container - { - Masking = true, - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding(1), - Child = new Container - { - CornerRadius = 20, - CornerExponent = 2.5f, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = 15, - BorderColour = Color4.White, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true, - } - } - }, - new Container - { - CornerRadius = 20, - CornerExponent = 2.5f, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = 2, - BorderColour = Color4.Gray, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true - } - }, - }; - } - - [BackgroundDependencyLoader] - private void load(DrawableHitObject drawableObject) - { - drawableObject.ApplyCustomUpdateState += updateState; - } - - private void updateState(DrawableHitObject drawableObject, ArmedState state) - { - using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true)) - { - switch (state) - { - case ArmedState.Hit: - const double flash_in = 40; - - this.Delay(flash_in).FadeOut(); - - break; - } - } - } - } -} diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs deleted file mode 100644 index 81f73b8f4..000000000 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TrianglesPiece.cs +++ /dev/null @@ -1,21 +0,0 @@ -using osu.Game.Graphics.Backgrounds; - -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces -{ - public class TrianglesPiece : Triangles - { - protected override float SpawnRatio => 1f; - - public TrianglesPiece() - { - TriangleScale = 1.2f; - HideAlphaDiscrepancies = false; - } - - protected override void Update() - { - if (IsPresent) - base.Update(); - } - } -} diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/DotPiece.cs similarity index 96% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/DotPiece.cs index 6f4e8996c..6fe6a030e 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/DotPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/DotPiece.cs @@ -6,7 +6,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class DotPiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/HoldBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs similarity index 95% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/HoldBody.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs index 1bfe7b6fc..8d6e7a03a 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/HoldBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs @@ -7,7 +7,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class HoldBody : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/NoteRingPiece.cs similarity index 92% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/NoteRingPiece.cs index 8e20b6c0e..ce257f6a3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/NoteRingPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/NoteRingPiece.cs @@ -1,7 +1,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Sentakki.Skinning.Default { // This piece is used for laned notes, which share consistent elements // Each half is extends beyond the area of this drawable diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/RingPiece.cs similarity index 96% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/RingPiece.cs index 15b54190f..9e93bfaa3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/RingPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/RingPiece.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics.Shapes; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class RingPiece : CircularContainer { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/ShadowPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/ShadowPiece.cs similarity index 93% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/ShadowPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/ShadowPiece.cs index 9098948e6..56d871db2 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/ShadowPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/ShadowPiece.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics.Effects; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class ShadowPiece : Container { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/ISlideChevron.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/ISlideChevron.cs similarity index 81% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/ISlideChevron.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/ISlideChevron.cs index e9d409843..9b8dfb082 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/ISlideChevron.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/ISlideChevron.cs @@ -1,4 +1,4 @@ -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public interface ISlideChevron { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/ISlideVisual.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/ISlideVisual.cs similarity index 77% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/ISlideVisual.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/ISlideVisual.cs index f83aa3dd3..35a26007a 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/ISlideVisual.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/ISlideVisual.cs @@ -1,4 +1,4 @@ -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public interface ISlideVisual { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs similarity index 98% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs index 80cf7644a..2ccfa051e 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanChevrons.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs @@ -7,7 +7,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { /// /// This drawable holds a set of all chevron buffered drawables, and is used to preload all/draw of them outside of playfield. (To avoid Playfield transforms re-rendering the chevrons) diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanVisual.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs similarity index 95% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanVisual.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs index 94a6e7b4d..5707436a1 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideFanVisual.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs @@ -6,7 +6,7 @@ using osu.Game.Rulesets.Sentakki.UI; using osuTK; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public class SlideFanVisual : SlideVisualBase { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs similarity index 95% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs index 92717bcb4..179fb29f3 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideTapPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs @@ -7,7 +7,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public class SlideTapPiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs similarity index 97% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs index ad2d5eeaa..b0556ace0 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisual.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs @@ -5,8 +5,9 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Sentakki.Objects; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public class SlideVisual : SlideVisualBase { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisualBase.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs similarity index 97% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisualBase.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs index 019136385..c8e242dba 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/SlideVisualBase.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs @@ -5,7 +5,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Sentakki.Configuration; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public abstract class SlideVisualBase : CompositeDrawable, ISlideVisual where T : Drawable, ISlideChevron { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/StarPiece.cs similarity index 90% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/StarPiece.cs index 2a979089d..749e87b21 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Slides/StarPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/StarPiece.cs @@ -4,7 +4,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public class StarPiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TapPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs similarity index 94% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TapPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs index 6783d8a27..ceb76333a 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TapPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs @@ -7,7 +7,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class TapPiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs similarity index 95% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs index 54a8824e0..e000dd22e 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs @@ -6,7 +6,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds { public class TouchHoldBody : CircularContainer { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldCentrePiece.cs similarity index 97% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldCentrePiece.cs index 1de9d0c80..dc54d3158 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCentrePiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldCentrePiece.cs @@ -6,7 +6,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds { public class TouchHoldCentrePiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldProgressPiece.cs similarity index 97% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldProgressPiece.cs index 6e2026ad1..ad6669828 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldProgressPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldProgressPiece.cs @@ -7,7 +7,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds { public class TouchHoldProgressPiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs similarity index 97% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs index a1b4704da..fdcf3b845 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs @@ -7,7 +7,7 @@ using osuTK; using osuTK.Graphics; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Touches { public class TouchBody : Container { diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchPiece.cs similarity index 93% rename from osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs rename to osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchPiece.cs index 2f2b9daca..c1a3a938e 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/Touches/TouchPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchPiece.cs @@ -5,7 +5,7 @@ using osu.Framework.Graphics.Textures; using osuTK; -namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Touches { public class TouchPiece : CompositeDrawable { diff --git a/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs b/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs index bf7e582d1..d002a1a6c 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Components/SentakkiRing.cs @@ -4,7 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Sentakki.Configuration; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Sentakki.Skinning.Default; using osuTK; namespace osu.Game.Rulesets.Sentakki.UI.Components diff --git a/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs b/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs index a32b61650..8992a9196 100644 --- a/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs +++ b/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs @@ -10,8 +10,8 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Sentakki.Configuration; using osu.Game.Rulesets.Sentakki.Objects; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; using osu.Game.Rulesets.Sentakki.Replays; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.UI; using osu.Game.Scoring; using osu.Game.Screens.Play; diff --git a/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs b/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs index 14c187efa..1b8046e92 100644 --- a/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs +++ b/osu.Game.Rulesets.Sentakki/UI/LanedPlayfield.cs @@ -6,7 +6,7 @@ using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Objects.Drawables; -using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; +using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.Sentakki.UI.Components.HitObjectLine; using osu.Game.Rulesets.UI; From 435a7f85795588a94e3c9f18172492f25ce768ec Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Fri, 23 Sep 2022 22:02:18 +0200 Subject: [PATCH 2/6] Use skinnable drawables in DHOs --- .../Mods/SentakkiModHidden.cs | 3 +- .../Objects/Drawables/DrawableHold.cs | 19 ++- .../Objects/Drawables/DrawableSlideBody.cs | 10 +- .../Objects/Drawables/DrawableSlideFan.cs | 4 +- .../Objects/Drawables/DrawableSlideTap.cs | 9 +- .../Objects/Drawables/DrawableTap.cs | 16 +- .../Objects/Drawables/DrawableTouch.cs | 19 ++- .../Objects/Drawables/DrawableTouchHold.cs | 24 +-- osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs | 5 +- .../Skinning/Default/HoldBody.cs | 8 +- .../Default/Slides/SlideFanChevrons.cs | 148 +++++++++--------- .../Skinning/Default/Slides/SlideTapPiece.cs | 24 +-- .../Skinning/Default/Slides/SlideVisual.cs | 5 +- .../Default/Slides/SlideVisualBase.cs | 3 - .../Skinning/Default/TapPiece.cs | 8 +- .../Default/TouchHolds/TouchHoldBody.cs | 1 - .../Skinning/Default/Touches/TouchBody.cs | 3 +- .../Skinning/ProxyableSkinnableDrawable.cs | 16 ++ .../Skinning/SentakkiSkinComponent.cs | 16 ++ .../Skinning/SentakkiSkinComponents.cs | 13 ++ 20 files changed, 220 insertions(+), 134 deletions(-) create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/ProxyableSkinnableDrawable.cs create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponent.cs create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponents.cs diff --git a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs index 6715deab6..0cc0ab31b 100644 --- a/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs +++ b/osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs @@ -14,6 +14,7 @@ using osu.Game.Rulesets.Sentakki.Localisation.Mods; using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Objects.Drawables; +using osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds; using osu.Game.Rulesets.Sentakki.UI; using osu.Game.Rulesets.UI; using osuTK; @@ -59,7 +60,7 @@ protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, break; case DrawableTouchHold th: - th.TouchHoldBody.ProgressPiece.Hide(); + ((TouchHoldBody)th.TouchHoldBody.Drawable).ProgressPiece.Hide(); break; case DrawableSlideBody sb: diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs index 377eec25d..5ccbbb5d8 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs @@ -8,8 +8,10 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default; using osu.Game.Rulesets.Sentakki.UI; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -21,7 +23,7 @@ public class DrawableHold : DrawableSentakkiLanedHitObject, IKeyBindingHandler headContainer; - public HoldBody NoteBody; + public SkinnableDrawable NoteBody; public override double LifetimeStart { @@ -53,7 +55,14 @@ private void load() Anchor = Anchor.Centre; Origin = Anchor.Centre; AddRangeInternal(new Drawable[]{ - NoteBody = new HoldBody(), + NoteBody = new ProxyableSkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.Hold), _=> new HoldBody()) + { + Scale = Vector2.Zero, + Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE), + Anchor = Anchor.Centre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.None, + }, headContainer = new Container { RelativeSizeAxes = Axes.Both }, }); } @@ -71,7 +80,7 @@ protected override void UpdateInitialTransforms() double animTime = AdjustedAnimationDuration / 2; NoteBody.FadeInFromZero(animTime).ScaleTo(1, animTime); - NoteBody.FadeColour(AccentColour.Value); + ((HoldBody)NoteBody.Drawable).FadeColour(AccentColour.Value); using (BeginDelayedSequence(animTime, true)) { @@ -89,7 +98,7 @@ protected override void UpdateInitialTransforms() .ResizeHeightTo(0, stretchTime); if (HoldStartTime == null && !Auto) - NoteBody.Delay(animTime).FadeColour(Color4.Gray, 100); + ((HoldBody)NoteBody.Drawable).Delay(animTime).FadeColour(Color4.Gray, 100); } } @@ -132,7 +141,7 @@ protected override void UpdateHitStateTransforms(ArmedState state) break; case ArmedState.Miss: - NoteBody.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) + ((HoldBody)NoteBody.Drawable).ScaleTo(0.5f, time_fade_miss, Easing.InCubic) .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) .MoveToOffset(new Vector2(0, -100), time_fade_miss, Easing.OutCubic) .FadeOut(time_fade_miss); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs index ef607e6c0..d5ef4e44d 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideBody.cs @@ -9,7 +9,9 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -26,7 +28,7 @@ public class DrawableSlideBody : DrawableSentakkiLanedHitObject public Container SlideCheckpoints { get; private set; } public ISlideVisual Slidepath; - public Container SlideStars; + public Container SlideStars; protected float StarProg; public virtual float StarProgress @@ -51,7 +53,7 @@ public DrawableSlideBody(SlideBody hitObject) protected virtual void CreateSlideStars() { - SlideStars.Add(new StarPiece + SlideStars.Add(new ProxyableSkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideStar), _ => new StarPiece()) { Alpha = 0, Scale = Vector2.Zero, @@ -78,7 +80,7 @@ private void load() AddRangeInternal(new Drawable[] { (Drawable)Slidepath, - SlideStars = new Container{ + SlideStars = new Container{ Anchor = Anchor.Centre, Origin = Anchor.Centre, }, @@ -212,7 +214,7 @@ protected override void UpdateHitStateTransforms(ArmedState state) foreach (var star in SlideStars) star.FadeOut(200); - this.FadeOut(200).Expire(); + this.Delay(200).Expire(); } break; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs index 4dce962ef..9c88d58a4 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideFan.cs @@ -1,5 +1,7 @@ +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; using osu.Game.Rulesets.Sentakki.UI; +using osu.Game.Skinning; using osuTK; namespace osu.Game.Rulesets.Sentakki.Objects.Drawables @@ -36,7 +38,7 @@ public DrawableSlideFan(SlideFan hitObject) protected override void CreateSlideStars() { for (int i = 0; i < 3; ++i) - SlideStars.Add(new StarPiece + SlideStars.Add(new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideStar), _ => new StarPiece()) { Y = -SentakkiPlayfield.INTERSECTDISTANCE, Alpha = 0, diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs index d0b2f1af3..1269d7666 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs @@ -1,12 +1,15 @@ -using System.Linq; +using System; +using System.Linq; using osu.Framework.Graphics; +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public class DrawableSlideTap : DrawableTap { - protected override Drawable CreateTapRepresentation() => new SlideTapPiece(); + protected override SentakkiSkinComponents TapPieceComponent => SentakkiSkinComponents.SlideStar; + protected override Type fallbackPieceType => typeof(SlideTapPiece); public DrawableSlideTap() : this(null) { } public DrawableSlideTap(SlideTap hitObject) @@ -16,7 +19,7 @@ protected override void UpdateInitialTransforms() { base.UpdateInitialTransforms(); - var note = TapVisual as SlideTapPiece; + var note = TapVisual.Drawable as SlideTapPiece; double spinDuration = 0; diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs index f0e2ef0af..16e5a2db0 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs @@ -1,3 +1,4 @@ +using System; using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -5,8 +6,10 @@ using osu.Framework.Input.Events; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default; using osu.Game.Rulesets.Sentakki.UI; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -14,7 +17,8 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public class DrawableTap : DrawableSentakkiLanedHitObject, IKeyBindingHandler { - protected virtual Drawable CreateTapRepresentation() => new TapPiece(); + protected virtual SentakkiSkinComponents TapPieceComponent => SentakkiSkinComponents.Tap; + protected virtual Type fallbackPieceType => typeof(TapPiece); public override double LifetimeStart { @@ -35,7 +39,7 @@ public override double LifetimeEnd } } - public Drawable TapVisual; + public SkinnableDrawable TapVisual; public DrawableTap() : this(null) { } @@ -48,7 +52,13 @@ private void load() Origin = Anchor.Centre; Anchor = Anchor.Centre; AddRangeInternal(new Drawable[] { - TapVisual = CreateTapRepresentation(), + TapVisual = new ProxyableSkinnableDrawable(new SentakkiSkinComponent(TapPieceComponent), _ => (Drawable)Activator.CreateInstance(fallbackPieceType)) + { + Scale = new Vector2(0f), + Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + } }); } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs index 9963fa540..a9fd6acbf 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs @@ -5,7 +5,9 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Sentakki.Configuration; +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default.Touches; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -24,7 +26,7 @@ public class DrawableTouch : DrawableSentakkiHitObject // Similar to IsHovered for mouse, this tracks whether a pointer (touch or mouse) is interacting with this drawable // Interaction == (IsHovered && ActionPressed) || (OnTouch && TouchPointerInBounds) public bool[] PointInteractionState = new bool[11]; - public TouchBody TouchBody; + public SkinnableDrawable TouchBody; private SentakkiInputManager sentakkiActionInputManager; internal SentakkiInputManager SentakkiActionInputManager => sentakkiActionInputManager ??= GetContainingInputManager() as SentakkiInputManager; @@ -42,7 +44,14 @@ private void load(SentakkiRulesetConfigManager sentakkiConfigs) Origin = Anchor.Centre; Anchor = Anchor.Centre; AddRangeInternal(new Drawable[]{ - TouchBody = new TouchBody(), + TouchBody = new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.Touch), _ => new TouchBody()) + { + Size = new Vector2(130), + Alpha = 0, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.None, + }, }); trackedKeys.BindValueChanged(x => @@ -80,7 +89,7 @@ protected override void UpdateInitialTransforms() using (BeginDelayedSequence(AdjustedAnimationDuration, true)) { TouchBody.ResizeTo(90, moveTo, Easing.InCirc); - TouchBody.BorderContainer.Delay(moveTo).FadeIn(); + ((TouchBody)TouchBody.Drawable).BorderContainer.Delay(moveTo).FadeIn(); } } @@ -124,9 +133,11 @@ protected override void UpdateHitStateTransforms(ArmedState state) break; case ArmedState.Miss: - this.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) + TouchBody.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) .FadeOut(time_fade_miss); + + this.Delay(time_fade_miss).Expire(); break; } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs index 18255ebcd..e2d262cd6 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs @@ -12,6 +12,7 @@ using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Sentakki.Configuration; +using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds; using osu.Game.Skinning; using osuTK; @@ -28,7 +29,7 @@ public class DrawableTouchHold : DrawableSentakkiHitObject public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => TouchHoldBody.ReceivePositionalInputAt(screenSpacePos); - public TouchHoldBody TouchHoldBody; + public SkinnableDrawable TouchHoldBody; private PausableSkinnableSound holdSample; @@ -44,10 +45,14 @@ private void load(SentakkiRulesetConfigManager sentakkiConfigs) Colour = Color4.SlateGray; Anchor = Anchor.Centre; Origin = Anchor.Centre; - Scale = new Vector2(0f); - Alpha = 0; + AddRangeInternal(new Drawable[] { - TouchHoldBody = new TouchHoldBody(), + TouchHoldBody = new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.TouchHold), _=> new TouchHoldBody()) + { + Size = new Vector2(110), + Scale = new Vector2(0f), + Alpha = 0, + }, holdSample = new PausableSkinnableSound { Volume = { Value = 0 }, @@ -100,10 +105,10 @@ protected override void UpdateInitialTransforms() { base.UpdateInitialTransforms(); double fadeIn = AdjustedAnimationDuration; - this.FadeInFromZero(fadeIn).ScaleTo(1, fadeIn); + TouchHoldBody.FadeInFromZero(fadeIn).ScaleTo(1, fadeIn); using (BeginDelayedSequence(fadeIn, true)) { - TouchHoldBody.ProgressPiece.TransformBindableTo(TouchHoldBody.ProgressPiece.ProgressBindable, 1, ((IHasDuration)HitObject).Duration); + ((TouchHoldBody)TouchHoldBody.Drawable).ProgressPiece.TransformBindableTo(((TouchHoldBody)TouchHoldBody.Drawable).ProgressPiece.ProgressBindable, 1, ((IHasDuration)HitObject).Duration); } } @@ -170,16 +175,17 @@ protected override void CheckForResult(bool userTriggered, double timeOffset) protected override void UpdateHitStateTransforms(ArmedState state) { base.UpdateHitStateTransforms(state); - const double time_fade_hit = 100, time_fade_miss = 400; + const double time_fade_miss = 400; switch (state) { case ArmedState.Hit: - this.Delay(time_fade_hit).Expire(); + Expire(); break; case ArmedState.Miss: - this.ScaleTo(.0f, time_fade_miss).FadeOut(time_fade_miss).Expire(); + TouchHoldBody.ScaleTo(.0f, time_fade_miss).FadeOut(time_fade_miss).Expire(); + this.Delay(time_fade_miss).Expire(); break; } } diff --git a/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs b/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs index f6b774ea9..6390f192d 100644 --- a/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs +++ b/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs @@ -48,7 +48,10 @@ private static readonly Lazy is_development_build public override string Description => IsDevelopmentBuild ? "sentakki (Dev build)" : "sentakki"; public override string PlayingVerb => "Washing laundry"; - public override string ShortName => "Sentakki"; + + public const string SHORT_NAME = "Sentakki"; + + public override string ShortName => SHORT_NAME; public override ScoreProcessor CreateScoreProcessor() => new SentakkiScoreProcessor(this); diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs index 8d6e7a03a..fa7812028 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/HoldBody.cs @@ -3,23 +3,17 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Sentakki.UI; -using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class HoldBody : CompositeDrawable { - // This will be proxied, so a must. - public override bool RemoveWhenNotAlive => false; - public HoldBody() { - Scale = Vector2.Zero; - Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE); Anchor = Anchor.Centre; Origin = Anchor.BottomCentre; + RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { new NoteRingPiece(), diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs index 2ccfa051e..62fb3fae7 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Layout; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -72,89 +73,92 @@ public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cached float chevHeight = 16 + (10 * HeightScale); float chevWidth = 6 + (210 * lengthScale); - AddInternal(new Container - { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - AutoSizeAxes = Axes.Both, - Children = new Drawable[]{ - // Outlines - new Container - { - X = 2.5f, - Masking = true, - CornerRadius = chevHeight/4, - CornerExponent = 2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomRight, - Rotation = 22.5f, - Width = chevWidth, - Height = chevHeight, - Child = new Box{ - RelativeSizeAxes = Axes.Both, - Colour = Color4.Gray - }, - }, - new Container - { - X = -2.5f, - Masking = true, - CornerRadius = chevHeight/4, - CornerExponent = 2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomLeft, - Rotation = -22.5f, - Width = chevWidth, - Height = chevHeight, - Child = new Box{ - RelativeSizeAxes = Axes.Both, - Colour = Color4.Gray - }, - }, - // Inners - new Container - { - X = 2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomRight, - Size = new Vector2(chevWidth, chevHeight), - Rotation = 22.5f, - Padding = new MarginPadding(2), - Child = new Container{ - RelativeSizeAxes = Axes.Both, + AddInternal(new SkinnableDrawable( + new SentakkiSkinComponent(SentakkiSkinComponents.SlideFanChevron), + _ => new Container + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + AutoSizeAxes = Axes.Both, + Children = new Drawable[]{ + // Outlines + new Container + { + X = 2.5f, Masking = true, - - CornerRadius = (chevHeight-4)/4, + CornerRadius = chevHeight/4, CornerExponent = 2.5f, - Colour = Color4.White, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomRight, + Rotation = 22.5f, + Width = chevWidth, + Height = chevHeight, Child = new Box{ RelativeSizeAxes = Axes.Both, - Colour = Color4.White - } + Colour = Color4.Gray + }, }, - }, - new Container - { - X = -2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomLeft, - Size = new Vector2(chevWidth, chevHeight), - Rotation = -22.5f, - Padding = new MarginPadding(2), - Child = new Container + new Container { - RelativeSizeAxes = Axes.Both, + X = -2.5f, Masking = true, - CornerRadius = (chevHeight-4)/4, + CornerRadius = chevHeight/4, CornerExponent = 2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomLeft, + Rotation = -22.5f, + Width = chevWidth, + Height = chevHeight, Child = new Box{ RelativeSizeAxes = Axes.Both, - Colour = Color4.White - } + Colour = Color4.Gray + }, + }, + // Inners + new Container + { + X = 2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomRight, + Size = new Vector2(chevWidth, chevHeight), + Rotation = 22.5f, + Padding = new MarginPadding(2), + Child = new Container{ + RelativeSizeAxes = Axes.Both, + Masking = true, + + CornerRadius = (chevHeight-4)/4, + CornerExponent = 2.5f, + Colour = Color4.White, + Child = new Box{ + RelativeSizeAxes = Axes.Both, + Colour = Color4.White + } + }, + }, + new Container + { + X = -2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomLeft, + Size = new Vector2(chevWidth, chevHeight), + Rotation = -22.5f, + Padding = new MarginPadding(2), + Child = new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerRadius = (chevHeight-4)/4, + CornerExponent = 2.5f, + Child = new Box{ + RelativeSizeAxes = Axes.Both, + Colour = Color4.White + } + }, }, - }, - } - }); + } + }) + ); } } } diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs index 179fb29f3..b103a982d 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Sentakki.UI; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -11,11 +11,8 @@ namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public class SlideTapPiece : CompositeDrawable { - // This will be proxied, so a must. - public override bool RemoveWhenNotAlive => false; - public readonly Container Stars; - public readonly StarPiece SecondStar; + public readonly SkinnableDrawable SecondStar; public SlideTapPiece() { @@ -23,8 +20,6 @@ public SlideTapPiece() Anchor = Anchor.Centre; Origin = Anchor.Centre; - Scale = new Vector2(0f); - Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE); InternalChildren = new Drawable[] { @@ -33,8 +28,19 @@ public SlideTapPiece() Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[]{ - new StarPiece(), - SecondStar = new StarPiece { Rotation = 36 } + new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideStar), _ => new StarPiece()) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.None, + }, + SecondStar = new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideStar), _ => new StarPiece()) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.None, + Rotation = 36 + } } }, }; diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs index b0556ace0..797cfd8f1 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisual.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Textures; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Sentakki.Objects; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { @@ -88,12 +89,12 @@ public SlideChevron() [BackgroundDependencyLoader] private void load(TextureStore textures) { - AddInternal(new Sprite + AddInternal(new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideChevron), _ => new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get("slide"), - }); + })); } protected override void FreeAfterUse() diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs index c8e242dba..bed03c99c 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideVisualBase.cs @@ -9,9 +9,6 @@ namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public abstract class SlideVisualBase : CompositeDrawable, ISlideVisual where T : Drawable, ISlideChevron { - // This will be proxied, so a must. - public override bool RemoveWhenNotAlive => false; - private double progress; public double Progress { diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs index ceb76333a..b7de9bbf6 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TapPiece.cs @@ -3,23 +3,17 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Sentakki.UI; -using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Sentakki.Skinning.Default { public class TapPiece : CompositeDrawable { - // This will be proxied, so a must. - public override bool RemoveWhenNotAlive => false; - public TapPiece() { Anchor = Anchor.Centre; Origin = Anchor.Centre; - Scale = new Vector2(0f); - Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE); + RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { new NoteRingPiece(), diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs index e000dd22e..8008aa29e 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs @@ -17,7 +17,6 @@ public class TouchHoldBody : CircularContainer public TouchHoldBody() { - Size = new Vector2(110); Anchor = Anchor.Centre; Origin = Anchor.Centre; InternalChildren = new Drawable[]{ diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs index fdcf3b845..e05be9912 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs @@ -15,10 +15,9 @@ public class TouchBody : Container public Container PieceContainer; public TouchBody() { - Size = new Vector2(130); Anchor = Anchor.Centre; Origin = Anchor.Centre; - Alpha = 0; + RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[]{ BorderContainer = new Container{ diff --git a/osu.Game.Rulesets.Sentakki/Skinning/ProxyableSkinnableDrawable.cs b/osu.Game.Rulesets.Sentakki/Skinning/ProxyableSkinnableDrawable.cs new file mode 100644 index 000000000..6b96dbf35 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/ProxyableSkinnableDrawable.cs @@ -0,0 +1,16 @@ +using System; +using osu.Framework.Graphics; +using osu.Game.Skinning; + +namespace osu.Game.Rulesets.Sentakki.Skinning +{ + public class ProxyableSkinnableDrawable : SkinnableDrawable + { + public override bool RemoveWhenNotAlive => false; + + public ProxyableSkinnableDrawable(ISkinComponent component, Func defaultImplementation = null, ConfineMode confineMode = ConfineMode.NoScaling) + : base(component, defaultImplementation, confineMode) + { + } + } +} diff --git a/osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponent.cs b/osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponent.cs new file mode 100644 index 000000000..6257869f7 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponent.cs @@ -0,0 +1,16 @@ +using osu.Game.Skinning; + +namespace osu.Game.Rulesets.Sentakki.Skinning +{ + public class SentakkiSkinComponent : GameplaySkinComponent + { + public SentakkiSkinComponent(SentakkiSkinComponents component) + : base(component) + { + } + + protected override string RulesetPrefix => SentakkiRuleset.SHORT_NAME; + + protected override string ComponentName => Component.ToString().ToLowerInvariant(); + } +} diff --git a/osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponents.cs b/osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponents.cs new file mode 100644 index 000000000..8f3d16f49 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/SentakkiSkinComponents.cs @@ -0,0 +1,13 @@ +namespace osu.Game.Rulesets.Sentakki.Skinning +{ + public enum SentakkiSkinComponents + { + Tap, + Hold, + Touch, + TouchHold, + SlideChevron, + SlideFanChevron, + SlideStar, + } +} From 08a2b7fb54a7c79c0284c886030ffc6c38487a65 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sat, 24 Sep 2022 13:54:11 +0200 Subject: [PATCH 3/6] Move SlideFanChevron drawable to its own file --- .../Default/Slides/SlideFanChevron.cs | 103 ++++++++++++++++++ .../Default/Slides/SlideFanChevrons.cs | 100 ++--------------- .../Skinning/Default/Slides/SlideFanVisual.cs | 8 +- 3 files changed, 116 insertions(+), 95 deletions(-) create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevron.cs diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevron.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevron.cs new file mode 100644 index 000000000..25936d8c6 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevron.cs @@ -0,0 +1,103 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osuTK; +using osuTK.Graphics; + +namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides +{ + public class SlideFanChevron : CompositeDrawable + { + public SlideFanChevron(float progress) + { + Anchor = Anchor.BottomCentre; + Origin = Anchor.BottomCentre; + AutoSizeAxes = Axes.Both; + + Alpha = 0.5f; + Scale = new Vector2(5); + + float chevHeight = 16 + (10 * progress); + float chevWidth = 6 + (210 * progress); + + InternalChildren = new Drawable[] + { + // Outlines + new Container + { + X = 2.5f, + Masking = true, + CornerRadius = chevHeight/4, + CornerExponent = 2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomRight, + Rotation = 22.5f, + Width = chevWidth, + Height = chevHeight, + Child = new Box{ + RelativeSizeAxes = Axes.Both, + Colour = Color4.Gray + }, + }, + new Container + { + X = -2.5f, + Masking = true, + CornerRadius = chevHeight/4, + CornerExponent = 2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomLeft, + Rotation = -22.5f, + Width = chevWidth, + Height = chevHeight, + Child = new Box{ + RelativeSizeAxes = Axes.Both, + Colour = Color4.Gray + }, + }, + // Inners + new Container + { + X = 2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomRight, + Size = new Vector2(chevWidth, chevHeight), + Rotation = 22.5f, + Padding = new MarginPadding(2), + Child = new Container{ + RelativeSizeAxes = Axes.Both, + Masking = true, + + CornerRadius = (chevHeight-4)/4, + CornerExponent = 2.5f, + Colour = Color4.White, + Child = new Box{ + RelativeSizeAxes = Axes.Both, + Colour = Color4.White + } + }, + }, + new Container + { + X = -2.5f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomLeft, + Size = new Vector2(chevWidth, chevHeight), + Rotation = -22.5f, + Padding = new MarginPadding(2), + Child = new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerRadius = (chevHeight-4)/4, + CornerExponent = 2.5f, + Child = new Box{ + RelativeSizeAxes = Axes.Both, + Colour = Color4.White + } + }, + }, + }; + } + } +} diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs index 62fb3fae7..fbe84fc45 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanChevrons.cs @@ -47,7 +47,7 @@ private void loadChevronsTextures() float progress = (i + 2) / (float)12; float scale = progress; - chevrons.Add(new ChevronBackingTexture(scale, scale)); + chevrons.Add(new ChevronBackingTexture(scale)); } } @@ -64,101 +64,19 @@ protected override bool OnInvalidate(Invalidation invalidation, InvalidationSour return base.OnInvalidate(invalidation, source); } - public ChevronBackingTexture(float lengthScale, float HeightScale) : base(cachedFrameBuffer: true) + public ChevronBackingTexture(float progress) : base(cachedFrameBuffer: true) { Anchor = Anchor.Centre; Origin = Anchor.Centre; AutoSizeAxes = Axes.Both; - float chevHeight = 16 + (10 * HeightScale); - float chevWidth = 6 + (210 * lengthScale); - - AddInternal(new SkinnableDrawable( - new SentakkiSkinComponent(SentakkiSkinComponents.SlideFanChevron), - _ => new Container - { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - AutoSizeAxes = Axes.Both, - Children = new Drawable[]{ - // Outlines - new Container - { - X = 2.5f, - Masking = true, - CornerRadius = chevHeight/4, - CornerExponent = 2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomRight, - Rotation = 22.5f, - Width = chevWidth, - Height = chevHeight, - Child = new Box{ - RelativeSizeAxes = Axes.Both, - Colour = Color4.Gray - }, - }, - new Container - { - X = -2.5f, - Masking = true, - CornerRadius = chevHeight/4, - CornerExponent = 2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomLeft, - Rotation = -22.5f, - Width = chevWidth, - Height = chevHeight, - Child = new Box{ - RelativeSizeAxes = Axes.Both, - Colour = Color4.Gray - }, - }, - // Inners - new Container - { - X = 2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomRight, - Size = new Vector2(chevWidth, chevHeight), - Rotation = 22.5f, - Padding = new MarginPadding(2), - Child = new Container{ - RelativeSizeAxes = Axes.Both, - Masking = true, - - CornerRadius = (chevHeight-4)/4, - CornerExponent = 2.5f, - Colour = Color4.White, - Child = new Box{ - RelativeSizeAxes = Axes.Both, - Colour = Color4.White - } - }, - }, - new Container - { - X = -2.5f, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomLeft, - Size = new Vector2(chevWidth, chevHeight), - Rotation = -22.5f, - Padding = new MarginPadding(2), - Child = new Container - { - RelativeSizeAxes = Axes.Both, - Masking = true, - CornerRadius = (chevHeight-4)/4, - CornerExponent = 2.5f, - Child = new Box{ - RelativeSizeAxes = Axes.Both, - Colour = Color4.White - } - }, - }, - } - }) - ); + AddInternal(new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideFanChevron), _ => new SlideFanChevron(progress)) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.None, + AutoSizeAxes = Axes.Both, + }); } } } diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs index 5707436a1..a1c6d8556 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideFanVisual.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { - public class SlideFanVisual : SlideVisualBase + public class SlideFanVisual : SlideVisualBase { public SlideFanVisual() { @@ -25,7 +25,7 @@ private void load(SlideFanChevrons fanChevrons) { float progress = (i + 2) / (float)12; float scale = progress; - Chevrons.Add(new SlideFanChevron(fanChevrons.Get(i)) + Chevrons.Add(new SlideFanChevronView(fanChevrons.Get(i)) { Y = ((SentakkiPlayfield.RINGSIZE + 50 - (float)endpoint_distance) * scale) - 350, Progress = (i + 1) / (float)11, @@ -33,12 +33,12 @@ private void load(SlideFanChevrons fanChevrons) } } - public class SlideFanChevron : CompositeDrawable, ISlideChevron + public class SlideFanChevronView : CompositeDrawable, ISlideChevron { public double Progress { get; set; } private readonly IBindable textureSize = new Bindable(); - public SlideFanChevron((BufferedContainerView view, IBindable sizeBindable) chevron) + public SlideFanChevronView((BufferedContainerView view, IBindable sizeBindable) chevron) { Anchor = Origin = Anchor.Centre; From 9afba55ffe44d75a61e3a8f37060aa2e56f8971b Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sat, 1 Oct 2022 16:01:37 +0200 Subject: [PATCH 4/6] Make slide chevron skinnable --- .../Skinning/Default/Slides/SlideChevron.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideChevron.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideChevron.cs index cbe8b22d6..819497190 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideChevron.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideChevron.cs @@ -3,6 +3,8 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Game.Skinning; + namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { public class SlideChevron : PoolableDrawable, ISlideChevron @@ -18,12 +20,12 @@ public SlideChevron() [BackgroundDependencyLoader] private void load(TextureStore textures) { - AddInternal(new Sprite + AddInternal(new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideChevron), _ => new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get("slide"), - }); + })); } protected override void FreeAfterUse() From 9d77592d257acddbae1923527fcffc089489392e Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sat, 1 Oct 2022 17:30:34 +0200 Subject: [PATCH 5/6] Ban legacy skins from trying to work --- osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs | 13 +++++++++++++ .../Legacy/SentakkLegacySkinTransformer.cs | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/Legacy/SentakkLegacySkinTransformer.cs diff --git a/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs b/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs index ec108df22..63061cbfe 100644 --- a/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs +++ b/osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs @@ -28,11 +28,13 @@ using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Replays; using osu.Game.Rulesets.Sentakki.Scoring; +using osu.Game.Rulesets.Sentakki.Skinning.Legacy; using osu.Game.Rulesets.Sentakki.Statistics; using osu.Game.Rulesets.Sentakki.UI; using osu.Game.Rulesets.UI; using osu.Game.Scoring; using osu.Game.Screens.Ranking.Statistics; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -71,6 +73,17 @@ public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap public override PerformanceCalculator CreatePerformanceCalculator() => new SentakkiPerformanceCalculator(this); + public override ISkin? CreateSkinTransformer(ISkin skin, IBeatmap beatmap) + { + switch (skin) + { + case LegacySkin: + return new SentakkiLegacySkinTransformer(skin); + } + + return base.CreateSkinTransformer(skin, beatmap); + } + public override IEnumerable GetModsFor(ModType type) { switch (type) diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Legacy/SentakkLegacySkinTransformer.cs b/osu.Game.Rulesets.Sentakki/Skinning/Legacy/SentakkLegacySkinTransformer.cs new file mode 100644 index 000000000..5a1a478a1 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/Legacy/SentakkLegacySkinTransformer.cs @@ -0,0 +1,15 @@ +using osu.Framework.Graphics; +using osu.Game.Skinning; + +namespace osu.Game.Rulesets.Sentakki.Skinning.Legacy +{ + public class SentakkiLegacySkinTransformer : LegacySkinTransformer + { + public SentakkiLegacySkinTransformer(ISkin skin) + : base(skin) + { + } + + public override Drawable? GetDrawableComponent(ISkinComponent component) => null; + } +} From 0195ed600e88109c2baf9dd71ae84b4ccd1f097f Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sat, 1 Oct 2022 17:39:42 +0200 Subject: [PATCH 6/6] Introduce abstractions for pieces --- .../Objects/Drawables/DrawableHold.cs | 6 ++--- .../Objects/Drawables/DrawableSlideTap.cs | 20 +++++++++++------ .../Objects/Drawables/DrawableTap.cs | 22 +++++++++---------- .../Objects/Drawables/DrawableTouch.cs | 2 +- .../Objects/Drawables/DrawableTouchHold.cs | 2 +- .../Skinning/Default/Slides/SlideTapPiece.cs | 12 ++++++---- .../Default/TouchHolds/TouchHoldBody.cs | 8 ++++++- .../Skinning/Default/Touches/TouchBody.cs | 4 +++- .../Skinning/ISlideTapPiece.cs | 11 ++++++++++ .../Skinning/ITouchHoldPiece.cs | 10 +++++++++ .../Skinning/ITouchPiece.cs | 10 +++++++++ 11 files changed, 77 insertions(+), 30 deletions(-) create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/ISlideTapPiece.cs create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/ITouchHoldPiece.cs create mode 100644 osu.Game.Rulesets.Sentakki/Skinning/ITouchPiece.cs diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs index 5b03bf76d..9b08fe799 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs @@ -81,7 +81,7 @@ protected override void UpdateInitialTransforms() double animTime = AdjustedAnimationDuration / 2; NoteBody.FadeInFromZero(animTime).ScaleTo(1, animTime); - ((HoldBody)NoteBody.Drawable).FadeColour(AccentColour.Value); + NoteBody.Drawable.FadeColour(AccentColour.Value); using (BeginDelayedSequence(animTime, true)) { @@ -99,7 +99,7 @@ protected override void UpdateInitialTransforms() .ResizeHeightTo(0, stretchTime); if (HoldStartTime == null && !Auto) - ((HoldBody)NoteBody.Drawable).Delay(animTime).FadeColour(Color4.Gray, 100); + NoteBody.Drawable.Delay(animTime).FadeColour(Color4.Gray, 100); } } @@ -142,7 +142,7 @@ protected override void UpdateHitStateTransforms(ArmedState state) break; case ArmedState.Miss: - ((HoldBody)NoteBody.Drawable).ScaleTo(0.5f, time_fade_miss, Easing.InCubic) + NoteBody.Drawable.ScaleTo(0.5f, time_fade_miss, Easing.InCubic) .FadeColour(Color4.Red, time_fade_miss, Easing.OutQuint) .MoveToOffset(new Vector2(0, -100), time_fade_miss, Easing.OutCubic) .FadeOut(time_fade_miss); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs index 4f13aca85..f46b41843 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs @@ -1,15 +1,21 @@ -using System; -using System.Linq; +using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default.Slides; +using osu.Game.Rulesets.Sentakki.UI; +using osuTK; namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public class DrawableSlideTap : DrawableTap { - protected override SentakkiSkinComponents TapPieceComponent => SentakkiSkinComponents.SlideStar; - protected override Type fallbackPieceType => typeof(SlideTapPiece); + protected override Drawable CreateTapVisual() => new SlideTapPiece() + { + Scale = new Vector2(0f), + Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }; public DrawableSlideTap() : this(null) { } public DrawableSlideTap(SlideTap? hitObject) @@ -19,7 +25,7 @@ protected override void UpdateInitialTransforms() { base.UpdateInitialTransforms(); - var note = (SlideTapPiece)TapVisual.Drawable; + var note = (ISlideTapPiece)TapVisual; double spinDuration = 0; @@ -27,9 +33,9 @@ protected override void UpdateInitialTransforms() { spinDuration = ((Slide)slide.HitObject).SlideInfoList.FirstOrDefault().Duration; if (slide.SlideBodies.Count > 1) - note.SecondStar.Alpha = 1; + note.Stars[1].Alpha = 1; else - note.SecondStar.Alpha = 0; + note.Stars[1].Alpha = 0; } note.Stars.Spin(spinDuration, RotationDirection.Counterclockwise, 0).Loop(); diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs index 6067e1841..84ac13fcd 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTap.cs @@ -1,4 +1,4 @@ -using System; + using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Sentakki.Skinning; using osu.Game.Rulesets.Sentakki.Skinning.Default; using osu.Game.Rulesets.Sentakki.UI; -using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -17,8 +16,13 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables { public class DrawableTap : DrawableSentakkiLanedHitObject, IKeyBindingHandler { - protected virtual SentakkiSkinComponents TapPieceComponent => SentakkiSkinComponents.Tap; - protected virtual Type fallbackPieceType => typeof(TapPiece); + protected virtual Drawable CreateTapVisual() => new ProxyableSkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.Tap), _ => new TapPiece()) + { + Scale = new Vector2(0f), + Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }; public override double LifetimeStart { @@ -39,7 +43,7 @@ public override double LifetimeEnd } } - public SkinnableDrawable TapVisual = null!; + public Drawable TapVisual = null!; public DrawableTap() : this(null) { } @@ -52,13 +56,7 @@ private void load() Origin = Anchor.Centre; Anchor = Anchor.Centre; AddRangeInternal(new Drawable[] { - TapVisual = new ProxyableSkinnableDrawable(new SentakkiSkinComponent(TapPieceComponent), _ => (Drawable)Activator.CreateInstance(fallbackPieceType)) - { - Scale = new Vector2(0f), - Position = new Vector2(0, -SentakkiPlayfield.NOTESTARTDISTANCE), - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - } + TapVisual = CreateTapVisual() }); } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs index 76b968e60..857b32d8e 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouch.cs @@ -89,7 +89,7 @@ protected override void UpdateInitialTransforms() using (BeginDelayedSequence(AdjustedAnimationDuration, true)) { TouchBody.ResizeTo(90, moveTo, Easing.InCirc); - ((TouchBody)TouchBody.Drawable).BorderContainer.Delay(moveTo).FadeIn(); + ((ITouchPiece)TouchBody.Drawable).TouchBorder.Delay(moveTo).FadeIn(); } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs index 206cf8b77..d8306cbd8 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableTouchHold.cs @@ -110,7 +110,7 @@ protected override void UpdateInitialTransforms() TouchHoldBody.FadeInFromZero(fadeIn).ScaleTo(1, fadeIn); using (BeginDelayedSequence(fadeIn, true)) { - ((TouchHoldBody)TouchHoldBody.Drawable).ProgressPiece.TransformBindableTo(((TouchHoldBody)TouchHoldBody.Drawable).ProgressPiece.ProgressBindable, 1, ((IHasDuration)HitObject).Duration); + ((ITouchHoldPiece)TouchHoldBody.Drawable).TransformTo(nameof(ITouchHoldPiece.Progress), 1.0, ((IHasDuration)HitObject).Duration); } } diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs index b103a982d..2f9c26c13 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Slides/SlideTapPiece.cs @@ -9,10 +9,14 @@ namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Slides { - public class SlideTapPiece : CompositeDrawable + public class SlideTapPiece : CompositeDrawable, ISlideTapPiece { - public readonly Container Stars; - public readonly SkinnableDrawable SecondStar; + public override bool RemoveWhenNotAlive => false; + private readonly SkinnableDrawable secondStar; + + public Container Stars { get; private set; } + + public Drawable SecondStar => secondStar; public SlideTapPiece() { @@ -34,7 +38,7 @@ public SlideTapPiece() Origin = Anchor.Centre, RelativeSizeAxes = Axes.None, }, - SecondStar = new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideStar), _ => new StarPiece()) + secondStar = new SkinnableDrawable(new SentakkiSkinComponent(SentakkiSkinComponents.SlideStar), _ => new StarPiece()) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs index 8008aa29e..17badc052 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/TouchHolds/TouchHoldBody.cs @@ -8,8 +8,14 @@ namespace osu.Game.Rulesets.Sentakki.Skinning.Default.TouchHolds { - public class TouchHoldBody : CircularContainer + public class TouchHoldBody : CircularContainer, ITouchHoldPiece { + public double Progress + { + get => ProgressPiece.ProgressBindable.Value; + set => ProgressPiece.ProgressBindable.Value = value; + } + public readonly TouchHoldProgressPiece ProgressPiece; private readonly TouchHoldCentrePiece centrePiece; diff --git a/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs index e05be9912..3e0e05762 100644 --- a/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs +++ b/osu.Game.Rulesets.Sentakki/Skinning/Default/Touches/TouchBody.cs @@ -9,8 +9,10 @@ namespace osu.Game.Rulesets.Sentakki.Skinning.Default.Touches { - public class TouchBody : Container + public class TouchBody : Container, ITouchPiece { + public Drawable TouchBorder => BorderContainer; + public Container BorderContainer; public Container PieceContainer; public TouchBody() diff --git a/osu.Game.Rulesets.Sentakki/Skinning/ISlideTapPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/ISlideTapPiece.cs new file mode 100644 index 000000000..101748283 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/ISlideTapPiece.cs @@ -0,0 +1,11 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Rulesets.Sentakki.Skinning +{ + public interface ISlideTapPiece : IDrawable + { + public Container Stars { get; } + public Drawable SecondStar { get; } + } +} diff --git a/osu.Game.Rulesets.Sentakki/Skinning/ITouchHoldPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/ITouchHoldPiece.cs new file mode 100644 index 000000000..9e8e482b1 --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/ITouchHoldPiece.cs @@ -0,0 +1,10 @@ +using osu.Framework.Graphics; + +namespace osu.Game.Rulesets.Sentakki.Skinning +{ + public interface ITouchHoldPiece : IDrawable + { + // Used to fill the progress bar after HitObject start time + double Progress { get; set; } + } +} diff --git a/osu.Game.Rulesets.Sentakki/Skinning/ITouchPiece.cs b/osu.Game.Rulesets.Sentakki/Skinning/ITouchPiece.cs new file mode 100644 index 000000000..3f9541b9a --- /dev/null +++ b/osu.Game.Rulesets.Sentakki/Skinning/ITouchPiece.cs @@ -0,0 +1,10 @@ +using osu.Framework.Graphics; + +namespace osu.Game.Rulesets.Sentakki.Skinning +{ + public interface ITouchPiece : IDrawable + { + // Shows as soon as Time >= StartTime + Drawable TouchBorder { get; } + } +}