mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* First impl. of appearance TryGetData cleanup * Handful of fixes * DamageVisuals: fix HandleDamage call, inheritdoc * bunch of unused AppearanceSystem instances * Handful more unused appearance systems, inheritdoc * JetpackSystem: Ent<T> * cleanup roundup, more Ent<T> * a few lingering AppearanceSystem.TryGetData calls * more lingering AppearanceData access * Remove unnecessary inheritdoc * once again, with feeling
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using Content.Shared.Singularity.Components;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.ParticleAccelerator;
|
|
|
|
public sealed partial class ParticleAcceleratorPartVisualizerSystem : VisualizerSystem<ParticleAcceleratorPartVisualsComponent>
|
|
{
|
|
protected override void OnAppearanceChange(EntityUid uid, ParticleAcceleratorPartVisualsComponent comp, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
if (!SpriteSystem.LayerMapTryGet((uid, args.Sprite), ParticleAcceleratorVisualLayers.Unlit, out var index, false))
|
|
return;
|
|
|
|
if (!args.TryGetData<ParticleAcceleratorVisualState>(ParticleAcceleratorVisuals.VisualState, out var state))
|
|
{
|
|
state = ParticleAcceleratorVisualState.Unpowered;
|
|
}
|
|
|
|
if (state != ParticleAcceleratorVisualState.Unpowered)
|
|
{
|
|
SpriteSystem.LayerSetVisible((uid, args.Sprite), index, true);
|
|
SpriteSystem.LayerSetRsiState((uid, args.Sprite), index, comp.StateBase + comp.StatesSuffixes[state]);
|
|
}
|
|
else
|
|
{
|
|
SpriteSystem.LayerSetVisible((uid, args.Sprite), index, false);
|
|
}
|
|
}
|
|
}
|