2019-09-01 22:15:34 +02:00
|
|
|
using Robust.Client.GameObjects;
|
|
|
|
|
using Robust.Client.Interfaces.GameObjects.Components;
|
|
|
|
|
using static Content.Shared.GameObjects.Components.SharedWiresComponent;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.GameObjects.Components.Wires
|
|
|
|
|
{
|
2020-07-23 00:56:53 +02:00
|
|
|
public class WiresVisualizer : AppearanceVisualizer
|
2019-09-01 22:15:34 +02:00
|
|
|
{
|
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
|
|
|
{
|
|
|
|
|
base.OnChangeData(component);
|
|
|
|
|
|
2020-08-22 13:41:35 +02:00
|
|
|
if (component.Owner.Deleted)
|
|
|
|
|
return;
|
|
|
|
|
|
2019-09-01 22:15:34 +02:00
|
|
|
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
|
|
|
|
if (component.TryGetData<bool>(WiresVisuals.MaintenancePanelState, out var state))
|
|
|
|
|
{
|
|
|
|
|
sprite.LayerSetVisible(WiresVisualLayers.MaintenancePanel, state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum WiresVisualLayers
|
|
|
|
|
{
|
|
|
|
|
MaintenancePanel,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|