2019-09-01 22:15:34 +02:00
|
|
|
using Robust.Client.GameObjects;
|
2021-11-22 23:22:59 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 11:55:25 +01:00
|
|
|
using Robust.Shared.IoC;
|
2021-06-09 22:19:39 +02:00
|
|
|
using static Content.Shared.Wires.SharedWiresComponent;
|
2019-09-01 22:15:34 +02:00
|
|
|
|
2021-07-04 18:11:52 +02:00
|
|
|
namespace Content.Client.Wires.Visualizers
|
2019-09-01 22:15:34 +02:00
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class WiresVisualizer : AppearanceVisualizer
|
2019-09-01 22:15:34 +02:00
|
|
|
{
|
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
|
|
|
{
|
|
|
|
|
base.OnChangeData(component);
|
2021-12-03 15:53:09 +01:00
|
|
|
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner);
|
2019-09-01 22:15:34 +02:00
|
|
|
if (component.TryGetData<bool>(WiresVisuals.MaintenancePanelState, out var state))
|
|
|
|
|
{
|
|
|
|
|
sprite.LayerSetVisible(WiresVisualLayers.MaintenancePanel, state);
|
|
|
|
|
}
|
2020-11-14 00:42:35 +11:00
|
|
|
// Mainly for spawn window
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sprite.LayerSetVisible(WiresVisualLayers.MaintenancePanel, false);
|
|
|
|
|
}
|
2019-09-01 22:15:34 +02:00
|
|
|
}
|
|
|
|
|
|
2020-12-04 11:57:33 +01:00
|
|
|
public enum WiresVisualLayers : byte
|
2019-09-01 22:15:34 +02:00
|
|
|
{
|
|
|
|
|
MaintenancePanel,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|