Various UI warnings cleanup (#36169)
* Various UI warnings cleanup * Revert unnecessary change * Redoing SpriteSystem as it's non-injectable * Missed one * Better entity instantiation * General cleanup of warnings changes * Wrong class name!
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.Chasm;
|
||||
using Content.Shared.Chasm;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Animations;
|
||||
@@ -32,7 +32,9 @@ public sealed class ChasmFallingVisualsSystem : EntitySystem
|
||||
|
||||
component.OriginalScale = sprite.Scale;
|
||||
|
||||
var player = EnsureComp<AnimationPlayerComponent>(uid);
|
||||
if (!TryComp<AnimationPlayerComponent>(uid, out var player))
|
||||
return;
|
||||
|
||||
if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey))
|
||||
return;
|
||||
|
||||
@@ -44,11 +46,13 @@ public sealed class ChasmFallingVisualsSystem : EntitySystem
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
var player = EnsureComp<AnimationPlayerComponent>(uid);
|
||||
if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey))
|
||||
_anim.Stop(player, _chasmFallAnimationKey);
|
||||
|
||||
sprite.Scale = component.OriginalScale;
|
||||
|
||||
if (!TryComp<AnimationPlayerComponent>(uid, out var player))
|
||||
return;
|
||||
|
||||
if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey))
|
||||
_anim.Stop((uid, player), _chasmFallAnimationKey);
|
||||
}
|
||||
|
||||
private Animation GetFallingAnimation(ChasmFallingComponent component)
|
||||
|
||||
Reference in New Issue
Block a user