From 6f840647555da1e8819493e811ff0e3bc359f4f4 Mon Sep 17 00:00:00 2001 From: wrexbe <81056464+wrexbe@users.noreply.github.com> Date: Wed, 22 Dec 2021 20:02:26 -0800 Subject: [PATCH] Improve airlock power ui (#5858) --- .../Doors/Components/AirlockComponent.cs | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Content.Server/Doors/Components/AirlockComponent.cs b/Content.Server/Doors/Components/AirlockComponent.cs index b03f0dcb40..48f6f060b2 100644 --- a/Content.Server/Doors/Components/AirlockComponent.cs +++ b/Content.Server/Doors/Components/AirlockComponent.cs @@ -153,27 +153,29 @@ namespace Content.Server.Doors.Components public void UpdateWiresStatus() { - if (DoorComponent == null) - { - return; - } + if (WiresComponent == null) return; - var powerLight = new StatusLightData(Color.Yellow, StatusLightState.On, "POWR"); - if (PowerWiresPulsed) + var mainPowerCut = WiresComponent.IsWireCut(Wires.MainPower); + var backupPowerCut = WiresComponent.IsWireCut(Wires.BackupPower); + var statusLightState = PowerWiresPulsed ? StatusLightState.BlinkingFast : StatusLightState.On; + StatusLightData powerLight; + if (mainPowerCut && backupPowerCut) { - powerLight = new StatusLightData(Color.Yellow, StatusLightState.BlinkingFast, "POWR"); + powerLight = new StatusLightData(Color.DarkGoldenrod, StatusLightState.Off, "POWER"); } - else if (WiresComponent != null && - WiresComponent.IsWireCut(Wires.MainPower) && - WiresComponent.IsWireCut(Wires.BackupPower)) + else if (mainPowerCut != backupPowerCut) { - powerLight = new StatusLightData(Color.Red, StatusLightState.On, "POWR"); + powerLight = new StatusLightData(Color.Gold, statusLightState, "POWER"); + } + else + { + powerLight = new StatusLightData(Color.Yellow, statusLightState, "POWER"); } var boltStatus = new StatusLightData(Color.Red, BoltsDown ? StatusLightState.On : StatusLightState.Off, "BOLT"); var boltLightsStatus = new StatusLightData(Color.Lime, - _boltLightsWirePulsed ? StatusLightState.On : StatusLightState.Off, "BLTL"); + _boltLightsWirePulsed ? StatusLightState.On : StatusLightState.Off, "BOLT LED"); var ev = new DoorGetCloseTimeModifierEvent(); IoCManager.Resolve().EventBus.RaiseLocalEvent(Owner, ev, false); @@ -185,17 +187,13 @@ namespace Content.Server.Doors.Components "TIME"); var safetyStatus = - new StatusLightData(Color.Red, Safety ? StatusLightState.On : StatusLightState.Off, "SAFE"); + new StatusLightData(Color.Red, Safety ? StatusLightState.On : StatusLightState.Off, "SAFETY"); - if (WiresComponent == null) - { - return; - } WiresComponent.SetStatus(AirlockWireStatus.PowerIndicator, powerLight); WiresComponent.SetStatus(AirlockWireStatus.BoltIndicator, boltStatus); WiresComponent.SetStatus(AirlockWireStatus.BoltLightIndicator, boltLightsStatus); - WiresComponent.SetStatus(AirlockWireStatus.AIControlIndicator, new StatusLightData(Color.Purple, StatusLightState.BlinkingSlow, "AICT")); + WiresComponent.SetStatus(AirlockWireStatus.AIControlIndicator, new StatusLightData(Color.Purple, StatusLightState.BlinkingSlow, "AI CTRL")); WiresComponent.SetStatus(AirlockWireStatus.TimingIndicator, timingStatus); WiresComponent.SetStatus(AirlockWireStatus.SafetyIndicator, safetyStatus); } @@ -219,7 +217,7 @@ namespace Content.Server.Doors.Components } ReceiverComponent.PowerDisabled = - WiresComponent.IsWireCut(Wires.MainPower) || + WiresComponent.IsWireCut(Wires.MainPower) && WiresComponent.IsWireCut(Wires.BackupPower); }