Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Kara <lunarautomaton6@gmail.com>
31 lines
957 B
C#
31 lines
957 B
C#
using Content.Shared.Wires;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
|
|
namespace Content.Client.Wires.Visualizers
|
|
{
|
|
public sealed class WiresVisualizer : AppearanceVisualizer
|
|
{
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
{
|
|
base.OnChangeData(component);
|
|
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner);
|
|
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 : byte
|
|
{
|
|
MaintenancePanel,
|
|
}
|
|
}
|
|
}
|