1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Use existing property and fix nullability

This commit is contained in:
Salman Ahmed 2023-10-23 11:46:21 +03:00
parent 7373a9a784
commit 0cf572d029

View File

@ -37,18 +37,23 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
}
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject)
private void load()
{
var ballColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? Color4.White;
DrawableSlider drawableSlider = (DrawableSlider)drawableHitObject;
double? ballAnimationRate = null;
// stable apparently calculates slider velocity in units of seconds rather than milliseconds.
double stableSliderVelocity = drawableSlider.HitObject.Velocity * 1000;
if (parentObject != null)
{
DrawableSlider drawableSlider = (DrawableSlider)parentObject;
double ballAnimationRate = Math.Max(
150 / stableSliderVelocity * LegacySkinExtensions.SIXTY_FRAME_TIME,
LegacySkinExtensions.SIXTY_FRAME_TIME);
// stable apparently calculates slider velocity in units of seconds rather than milliseconds.
double stableSliderVelocity = drawableSlider.HitObject.Velocity * 1000;
ballAnimationRate = Math.Max(
150 / stableSliderVelocity * LegacySkinExtensions.SIXTY_FRAME_TIME,
LegacySkinExtensions.SIXTY_FRAME_TIME);
}
Vector2 maxSize = OsuLegacySkinTransformer.MAX_FOLLOW_CIRCLE_AREA_SIZE;