mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add slider ball animation support
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
@ -92,8 +92,20 @@ namespace osu.Game.Skinning
|
||||
return null;
|
||||
|
||||
case "Play/osu/sliderball":
|
||||
if (GetTexture("sliderb") != null)
|
||||
return new LegacySliderBall();
|
||||
var sliderBallContent = getAnimation("sliderb", true, true, "");
|
||||
|
||||
if (sliderBallContent != null)
|
||||
{
|
||||
var size = sliderBallContent.Size;
|
||||
|
||||
sliderBallContent.RelativeSizeAxes = Axes.Both;
|
||||
sliderBallContent.Size = Vector2.One;
|
||||
|
||||
return new LegacySliderBall(sliderBallContent)
|
||||
{
|
||||
Size = size
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -169,16 +181,6 @@ namespace osu.Game.Skinning
|
||||
return (texture = GetTexture(componentName)) == null ? null : new Sprite { Texture = texture };
|
||||
}
|
||||
|
||||
public class LegacySliderBall : Sprite
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ISkinSource skin)
|
||||
{
|
||||
Texture = skin.GetTexture("sliderb");
|
||||
Colour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Color4.White;
|
||||
}
|
||||
}
|
||||
|
||||
public override Texture GetTexture(string componentName)
|
||||
{
|
||||
float ratio = 2;
|
||||
@ -333,6 +335,20 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
public class LegacySliderBall : CompositeDrawable
|
||||
{
|
||||
public LegacySliderBall(Drawable content)
|
||||
{
|
||||
InternalChild = content;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ISkinSource skin)
|
||||
{
|
||||
Colour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Color4.White;
|
||||
}
|
||||
}
|
||||
|
||||
public class LegacyMainCirclePiece : CompositeDrawable
|
||||
{
|
||||
public LegacyMainCirclePiece()
|
||||
|
Reference in New Issue
Block a user