Files
tbd-station-14/Content.Client/Wires/Visualizers/WiresVisualizerSystem.cs
2022-08-16 03:04:07 -07:00

33 lines
999 B
C#

using Content.Shared.Wires;
using Robust.Client.GameObjects;
namespace Content.Client.Wires.Visualizers
{
public sealed class WiresVisualizerSystem : VisualizerSystem<WiresVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, WiresVisualsComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
var layer = args.Sprite.LayerMapReserveBlank(WiresVisualLayers.MaintenancePanel);
if(args.AppearanceData.TryGetValue(WiresVisuals.MaintenancePanelState, out var panelStateObject) &&
panelStateObject is bool panelState)
{
args.Sprite.LayerSetVisible(layer, panelState);
}
else
{
//Mainly for spawn window
args.Sprite.LayerSetVisible(layer, false);
}
}
}
public enum WiresVisualLayers : byte
{
MaintenancePanel
}
}