Files
tbd-station-14/Content.Server/Doors/WireActions/DoorBoltLightWireAction.cs

37 lines
1.3 KiB
C#

using Content.Server.Doors.Systems;
using Content.Server.Wires;
using Content.Shared.Doors;
using Content.Shared.Doors.Components;
using Content.Shared.Wires;
namespace Content.Server.Doors;
public sealed partial class DoorBoltLightWireAction : ComponentWireAction<DoorBoltComponent>
{
public override Color Color { get; set; } = Color.Lime;
public override string Name { get; set; } = "wire-name-bolt-light";
public override StatusLightState? GetLightState(Wire wire, DoorBoltComponent comp)
=> comp.BoltLightsEnabled ? StatusLightState.On : StatusLightState.Off;
public override object StatusKey { get; } = AirlockWireStatus.BoltLightIndicator;
public override bool Cut(EntityUid user, Wire wire, DoorBoltComponent door)
{
EntityManager.System<DoorBoltSystem>().SetBoltLightsEnabled(wire.Owner, door, false);
return true;
}
public override bool Mend(EntityUid user, Wire wire, DoorBoltComponent door)
{
EntityManager.System<DoorBoltSystem>().SetBoltLightsEnabled(wire.Owner, door, true);
return true;
}
public override void Pulse(EntityUid user, Wire wire, DoorBoltComponent door)
{
EntityManager.System<DoorBoltSystem>().SetBoltLightsEnabled(wire.Owner, door, !door.BoltLightsEnabled);
}
}