CatStation/Content.Client/Tools/Visualizers/WeldableVisualizerSystem.cs
Whatstone d9ffbf1d03
Cleanup: AppearanceSystem.TryGetData to AppearanceChangeEvent.TryGetData (#45373)
* 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
2026-10-05 00:45:37 +00:00

19 lines
686 B
C#

using Content.Shared.Tools.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Tools.Visualizers;
public sealed partial class WeldableVisualizerSystem : VisualizerSystem<WeldableComponent>
{
protected override void OnAppearanceChange(EntityUid uid, WeldableComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
args.TryGetData<bool>(WeldableVisuals.IsWelded, out var isWelded);
if (SpriteSystem.LayerMapTryGet((uid, args.Sprite), WeldableLayers.BaseWelded, out var layer, false))
{
SpriteSystem.LayerSetVisible((uid, args.Sprite), layer, isWelded);
}
}
}