Files
tbd-station-14/Content.Client/GameObjects/Components/Wires/WiresVisualizer.cs
metalgearsloth 02f827f063 Minor appearance changes (#2370)
* Minor appearance changes

* Remove that redundant deleted property

* Fixes and remove redundant checks

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
2020-11-14 00:42:35 +11:00

30 lines
960 B
C#

using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
using static Content.Shared.GameObjects.Components.SharedWiresComponent;
namespace Content.Client.GameObjects.Components.Wires
{
public class WiresVisualizer : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
var sprite = component.Owner.GetComponent<ISpriteComponent>();
if (component.TryGetData<bool>(WiresVisuals.MaintenancePanelState, out var state))
{
sprite.LayerSetVisible(WiresVisualLayers.MaintenancePanel, state);
}
// Mainly for spawn window
else
{
sprite.LayerSetVisible(WiresVisualLayers.MaintenancePanel, false);
}
}
public enum WiresVisualLayers
{
MaintenancePanel,
}
}
}