diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index ac0df0aef6..37601d9680 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -18,6 +18,7 @@ using osu.Game.Rulesets.Objects; using osu.Framework.Utils; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -34,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container mainContainer; - public readonly SpinnerBackground Background; + public readonly SkinnableDrawable Background; private readonly Container circleContainer; private readonly CirclePiece circle; private readonly GlowPiece glow; @@ -96,7 +97,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables RelativeSizeAxes = Axes.Y, Children = new[] { - Background = new SpinnerBackground + Background = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBackground), _ => new SpinnerFill { Disc = { @@ -104,7 +105,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }, Anchor = Anchor.Centre, Origin = Anchor.Centre, - }, + }), Disc = new SpinnerDisc(Spinner) { Scale = Vector2.Zero, @@ -173,7 +174,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables normalColour = baseColour; completeColour = colours.YellowLight; - Background.AccentColour = normalColour; + if (Background.Drawable is IHasAccentColour accent) accent.AccentColour = normalColour; Ticks.AccentColour = normalColour; Disc.AccentColour = fillColour; @@ -328,7 +329,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { Disc.FadeAccent(colour, duration); - Background.FadeAccent(colour.Darken(1), duration); + (Background.Drawable as IHasAccentColour)?.FadeAccent(colour.Darken(1), duration); Ticks.FadeAccent(colour, duration); circle.FadeColour(colour, duration); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs index 86588a8a9f..22a6fc391a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces Children = new Drawable[] { - background = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerDisc), _ => new SpinnerBackground { Alpha = idle_alpha }), + background = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerDisc), _ => new SpinnerFill { Alpha = idle_alpha }), }; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerFill.cs similarity index 92% rename from osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerFill.cs index 944354abca..dbba1044ca 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerFill.cs @@ -10,7 +10,7 @@ using osuTK.Graphics; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { - public class SpinnerBackground : CircularContainer, IHasAccentColour + public class SpinnerFill : CircularContainer, IHasAccentColour { public readonly Box Disc; @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } } - public SpinnerBackground() + public SpinnerFill() { RelativeSizeAxes = Axes.Both; Masking = true; diff --git a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs index e25b4a5efc..d72673f9ee 100644 --- a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs +++ b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs @@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Osu SliderFollowCircle, SliderBall, SliderBody, - SpinnerDisc + SpinnerDisc, + SpinnerBackground } } diff --git a/osu.Game.Rulesets.Osu/Skinning/OsuLegacySkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/OsuLegacySkinTransformer.cs index c5b5598be7..28eef603f4 100644 --- a/osu.Game.Rulesets.Osu/Skinning/OsuLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Osu/Skinning/OsuLegacySkinTransformer.cs @@ -111,6 +111,12 @@ namespace osu.Game.Rulesets.Osu.Skinning return new Sprite { Texture = Source.GetTexture("spinner-top") }; return null; + + case OsuSkinComponents.SpinnerBackground: + if (Source.GetTexture("spinner-background") != null) + return new Sprite { Texture = Source.GetTexture("spinner-background") }; + + return null; } return null;