Move default background implementation out of DrawableSpinner

This commit is contained in:
Dean Herbert
2020-07-29 18:15:19 +09:00
parent 2cd6e89cb0
commit 2a5e9fed4d
2 changed files with 45 additions and 13 deletions

View File

@ -74,15 +74,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Y,
Children = new[]
{
Background = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBackground), _ => new SpinnerFill
{
Disc =
{
Alpha = 0f,
},
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
}),
Background = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBackground), _ => new DefaultSpinnerBackground()),
Disc = new SpinnerDisc(Spinner)
{
Scale = Vector2.Zero,
@ -151,8 +143,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
normalColour = baseColour;
completeColour = colours.YellowLight;
if (Background.Drawable is IHasAccentColour accent) accent.AccentColour = normalColour;
Ticks.AccentColour = normalColour;
Disc.AccentColour = fillColour;
@ -302,8 +292,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private void transformFillColour(Colour4 colour, double duration)
{
Disc.FadeAccent(colour, duration);
(Background.Drawable as IHasAccentColour)?.FadeAccent(colour.Darken(1), duration);
Ticks.FadeAccent(colour, duration);
}
}