1
0

ParticleAcceleratorInterfaceWireAction.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Content.Server.ParticleAccelerator.Components;
  2. using Content.Server.ParticleAccelerator.EntitySystems;
  3. using Content.Server.Wires;
  4. using Content.Shared.Singularity.Components;
  5. using Content.Shared.Wires;
  6. namespace Content.Server.ParticleAccelerator.Wires;
  7. public sealed partial class ParticleAcceleratorKeyboardWireAction : ComponentWireAction<ParticleAcceleratorControlBoxComponent>
  8. {
  9. public override string Name { get; set; } = "wire-name-pa-keyboard";
  10. public override Color Color { get; set; } = Color.LimeGreen;
  11. public override object StatusKey { get; } = ParticleAcceleratorWireStatus.Keyboard;
  12. public override StatusLightState? GetLightState(Wire wire, ParticleAcceleratorControlBoxComponent component)
  13. {
  14. return component.InterfaceDisabled ? StatusLightState.BlinkingFast : StatusLightState.On;
  15. }
  16. public override bool Cut(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
  17. {
  18. controller.InterfaceDisabled = true;
  19. var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
  20. paSystem.UpdateUI(wire.Owner, controller);
  21. return true;
  22. }
  23. public override bool Mend(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
  24. {
  25. controller.InterfaceDisabled = false;
  26. var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
  27. paSystem.UpdateUI(wire.Owner, controller);
  28. return true;
  29. }
  30. public override void Pulse(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
  31. {
  32. controller.InterfaceDisabled = !controller.InterfaceDisabled;
  33. }
  34. }