diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 119005eb40..8b72b23ca3 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -4,7 +4,6 @@ using System; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -57,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { RelativeSizeAxes = Axes.Both, // TODO: support skin filename animation (sliderb0, sliderb1...) - Child = new SkinnableDrawable("Play/osu/sliderb", _ => new DefaultSliderBall()), + Child = new SkinnableDrawable("Play/osu/sliderball", _ => new DefaultSliderBall()), } } }; @@ -204,10 +203,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces public class DefaultSliderBall : CompositeDrawable { - private readonly Bindable accentColour = new Bindable(); - - private Drawable drawableBall; - [BackgroundDependencyLoader] private void load(DrawableHitObject drawableObject, ISkinSource skin) { @@ -225,15 +220,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces BorderThickness = 10, BorderColour = Color4.White, Alpha = 1, - Child = drawableBall = new Box + Child = new Box { RelativeSizeAxes = Axes.Both, + Colour = Color4.White, Alpha = 0.4f, } }; - - accentColour.BindTo(drawableObject.AccentColour); - accentColour.BindValueChanged(colour => drawableBall.Colour = colour.NewValue, true); } } } diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index af9a24df42..84fa5ff97b 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Graphics; @@ -15,6 +16,7 @@ using osu.Framework.IO.Stores; using osu.Game.Database; using osu.Game.Graphics.Sprites; using osuTK; +using osuTK.Graphics; namespace osu.Game.Skinning { @@ -71,6 +73,12 @@ namespace osu.Game.Skinning { switch (componentName) { + case "Play/osu/sliderball": + if (GetTexture("sliderb") != null) + return new LegacySliderBall(); + + break; + case "Play/Miss": componentName = "hit0"; break; @@ -109,6 +117,16 @@ namespace osu.Game.Skinning return new Sprite { Texture = texture }; } + public class LegacySliderBall : Sprite + { + [BackgroundDependencyLoader] + private void load(ISkinSource skin) + { + Texture = skin.GetTexture("sliderb"); + Colour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Color4.White; + } + } + public override Texture GetTexture(string componentName) { float ratio = 2;