33 lines
999 B
C#
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
|
|
}
|
|
}
|