mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 08:37:26 +00:00
Universal weldable component (#7955)
* Weldable component for door * Content update * Examine message * Universal visualizer * Small fix * Entity storage * Content * Fixed test * Update Content.Shared/Storage/SharedStorageComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Fixed loc string * Add public API to change welding time Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
co-authored by
metalgearsloth
parent
02de328d9c
commit
df49c2fd57
@@ -0,0 +1,22 @@
|
||||
using Content.Client.Tools.Components;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Tools.Visualizers;
|
||||
|
||||
public sealed class WeldableVisualizerSystem : VisualizerSystem<WeldableComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, WeldableComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
base.OnAppearanceChange(uid, component, ref args);
|
||||
|
||||
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
args.Component.TryGetData(WeldableVisuals.IsWelded, out bool isWelded);
|
||||
if (sprite.LayerMapTryGet(WeldableLayers.BaseWelded, out var layer))
|
||||
{
|
||||
sprite.LayerSetVisible(layer, isWelded);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user