Files
tbd-station-14/Content.Server/ParticleAccelerator/Wires/ParticleAcceleratorInterfaceWireAction.cs
Nemanja 0b5fe2a9ac PA ui cleanup + bugfixes (#28750)
* ui and visual aspect + radio

* finish jank ui shit and finish radio

* remove radio

* send it

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-07-21 15:27:18 +10:00

41 lines
1.6 KiB
C#

using Content.Server.ParticleAccelerator.Components;
using Content.Server.ParticleAccelerator.EntitySystems;
using Content.Server.Wires;
using Content.Shared.Singularity.Components;
using Content.Shared.Wires;
namespace Content.Server.ParticleAccelerator.Wires;
public sealed partial class ParticleAcceleratorKeyboardWireAction : ComponentWireAction<ParticleAcceleratorControlBoxComponent>
{
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;
var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
paSystem.UpdateUI(wire.Owner, controller);
return true;
}
public override bool Mend(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
{
controller.InterfaceDisabled = false;
var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
paSystem.UpdateUI(wire.Owner, controller);
return true;
}
public override void Pulse(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
{
controller.InterfaceDisabled = !controller.InterfaceDisabled;
}
}