2023-06-07 23:25:59 -07:00
|
|
|
using Content.Server.ParticleAccelerator.Components;
|
2024-07-21 01:27:18 -04:00
|
|
|
using Content.Server.ParticleAccelerator.EntitySystems;
|
2023-06-07 23:25:59 -07:00
|
|
|
using Content.Server.Wires;
|
|
|
|
|
using Content.Shared.Singularity.Components;
|
|
|
|
|
using Content.Shared.Wires;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.ParticleAccelerator.Wires;
|
|
|
|
|
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class ParticleAcceleratorKeyboardWireAction : ComponentWireAction<ParticleAcceleratorControlBoxComponent>
|
2023-06-07 23:25:59 -07:00
|
|
|
{
|
|
|
|
|
public override string Name { get; set; } = "wire-name-pa-keyboard";
|
|
|
|
|
public override Color Color { get; set; } = Color.LimeGreen;
|
|
|
|
|
public override object StatusKey { get; } = ParticleAcceleratorWireStatus.Keyboard;
|
|
|
|
|
|
|
|
|
|
public override StatusLightState? GetLightState(Wire wire, ParticleAcceleratorControlBoxComponent component)
|
|
|
|
|
{
|
|
|
|
|
return component.InterfaceDisabled ? StatusLightState.BlinkingFast : StatusLightState.On;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Cut(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
|
|
|
|
|
{
|
|
|
|
|
controller.InterfaceDisabled = true;
|
2024-07-21 01:27:18 -04:00
|
|
|
var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
|
|
|
|
|
paSystem.UpdateUI(wire.Owner, controller);
|
2023-06-07 23:25:59 -07:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Mend(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
|
|
|
|
|
{
|
|
|
|
|
controller.InterfaceDisabled = false;
|
2024-07-21 01:27:18 -04:00
|
|
|
var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
|
|
|
|
|
paSystem.UpdateUI(wire.Owner, controller);
|
2023-06-07 23:25:59 -07:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Pulse(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
|
|
|
|
|
{
|
|
|
|
|
controller.InterfaceDisabled = !controller.InterfaceDisabled;
|
|
|
|
|
}
|
|
|
|
|
}
|