1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Add support for sliderb skinning (single frame only)

This commit is contained in:
tgi74000 2018-07-29 22:29:07 +02:00
parent 257c035f30
commit 4322475ad2

View File

@ -28,14 +28,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
set set
{ {
accentColour = value; accentColour = value;
if (ball != null) if (drawableBall != null)
ball.Colour = value; drawableBall.Colour = value;
} }
} }
private readonly Slider slider; private readonly Slider slider;
public readonly Drawable FollowCircle; public readonly Drawable FollowCircle;
private readonly Box ball; private Drawable drawableBall;
public SliderBall(Slider slider) public SliderBall(Slider slider)
{ {
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
Colour = Color4.Orange, Colour = Color4.Orange,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, restrictSize: false), }),
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Width = width, Width = width,
@ -68,18 +68,26 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
BorderThickness = 10,
BorderColour = Color4.White,
Alpha = 1, Alpha = 1,
Children = new[] Child = new Container
{ {
ball = new Box Width = width,
Height = width,
// TODO: support skin filename animation (sliderb0, sliderb1...)
Child = new SkinnableDrawable("Play/osu/sliderb", _ => new CircularContainer
{ {
Colour = AccentColour, Masking = true,
Alpha = 0.4f, RelativeSizeAxes = Axes.Both,
Width = width, BorderThickness = 10,
Height = width, BorderColour = Color4.White,
}, Alpha = 1,
Child = drawableBall = new Box
{
Colour = AccentColour,
RelativeSizeAxes = Axes.Both,
Alpha = 0.4f,
}
}),
} }
} }
}; };