Adjust calls to `DrawableExtensions.With<T>()`

This commit is contained in:
Bartłomiej Dach 2024-06-18 07:30:41 +02:00
parent 659505f711
commit 366ba26cb6
No known key found for this signature in database
2 changed files with 3 additions and 12 deletions

View File

@ -65,11 +65,8 @@ private void load(ISkinSource skin, IScrollingInfo scrollingInfo, DrawableHitObj
if (tmp is IFramedAnimation tmpAnimation && tmpAnimation.FrameCount > 0)
frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount);
light = skin.GetAnimation(lightImage, true, true, frameLength: frameLength).With(d =>
light = skin.GetAnimation(lightImage, true, true, frameLength: frameLength)?.With(d =>
{
if (d == null)
return;
d.Origin = Anchor.Centre;
d.Blending = BlendingParameters.Additive;
d.Scale = new Vector2(lightScale);
@ -91,11 +88,8 @@ private void load(ISkinSource skin, IScrollingInfo scrollingInfo, DrawableHitObj
direction.BindTo(scrollingInfo.Direction);
isHitting.BindTo(holdNote.IsHitting);
bodySprite = skin.GetAnimation(imageName, wrapMode, wrapMode, true, true, frameLength: 30).With(d =>
bodySprite = skin.GetAnimation(imageName, wrapMode, wrapMode, true, true, frameLength: 30)?.With(d =>
{
if (d == null)
return;
if (d is TextureAnimation animation)
animation.IsPlaying = false;

View File

@ -43,11 +43,8 @@ private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
if (tmp is IFramedAnimation tmpAnimation && tmpAnimation.FrameCount > 0)
frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount);
explosion = skin.GetAnimation(imageName, true, false, frameLength: frameLength).With(d =>
explosion = skin.GetAnimation(imageName, true, false, frameLength: frameLength)?.With(d =>
{
if (d == null)
return;
d.Origin = Anchor.Centre;
d.Blending = BlendingParameters.Additive;
d.Scale = new Vector2(explosionScale);