1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 02:33:51 +08:00

Fix slider ball layer sources

This commit is contained in:
Dean Herbert 2021-06-08 12:10:14 +09:00
parent 06840d78cc
commit 88b87b98a8
2 changed files with 10 additions and 4 deletions

View File

@ -14,18 +14,21 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{ {
private readonly Drawable animationContent; private readonly Drawable animationContent;
private readonly ISkin skin;
private Sprite layerNd; private Sprite layerNd;
private Sprite layerSpec; private Sprite layerSpec;
public LegacySliderBall(Drawable animationContent) public LegacySliderBall(Drawable animationContent, ISkin skin)
{ {
this.animationContent = animationContent; this.animationContent = animationContent;
this.skin = skin;
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(ISkinSource skin) private void load()
{ {
var ballColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? Color4.White; var ballColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? Color4.White;

View File

@ -49,13 +49,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return followCircle; return followCircle;
case OsuSkinComponents.SliderBall: case OsuSkinComponents.SliderBall:
var sliderBallContent = this.GetAnimation("sliderb", true, true, animationSeparator: ""); // specular and nd layers must come from the same source as the ball texure.
var ballProvider = Source.FindProvider(s => s.GetTexture("sliderb") != null || s.GetTexture("sliderb0") != null);
var sliderBallContent = ballProvider.GetAnimation("sliderb", true, true, animationSeparator: "");
// todo: slider ball has a custom frame delay based on velocity // todo: slider ball has a custom frame delay based on velocity
// Math.Max((150 / Velocity) * GameBase.SIXTY_FRAME_TIME, GameBase.SIXTY_FRAME_TIME); // Math.Max((150 / Velocity) * GameBase.SIXTY_FRAME_TIME, GameBase.SIXTY_FRAME_TIME);
if (sliderBallContent != null) if (sliderBallContent != null)
return new LegacySliderBall(sliderBallContent); return new LegacySliderBall(sliderBallContent, ballProvider);
return null; return null;