From cd2968d8491669977c2801c9f1ee346843cf2abd Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Sat, 29 Jun 2024 07:02:48 +0200 Subject: [PATCH] Add sprite for vent under-pressure lock-out (#29527) --- .../Unary/EntitySystems/GasVentPumpSystem.cs | 16 ++++++++++++---- .../Piping/Unary/Visuals/VentPumpVisuals.cs | 1 + .../Structures/Piping/Atmospherics/binary.yml | 1 + .../Structures/Piping/Atmospherics/unary.yml | 1 + .../Piping/Atmospherics/vent.rsi/meta.json | 4 ++++ .../Atmospherics/vent.rsi/vent_lockout.png | Bin 0 -> 1302 bytes 6 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/vent_lockout.png diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs index 8951f8a947..2859c7f19d 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs @@ -83,13 +83,18 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems var timeDelta = args.dt; var pressureDelta = timeDelta * vent.TargetPressureChange; + var lockout = (environment.Pressure < vent.UnderPressureLockoutThreshold); + if (vent.UnderPressureLockout != lockout) // update visuals only if this changes + { + vent.UnderPressureLockout = lockout; + UpdateState(uid, vent); + } + if (vent.PumpDirection == VentPumpDirection.Releasing && pipe.Air.Pressure > 0) { if (environment.Pressure > vent.MaxPressure) return; - vent.UnderPressureLockout = (environment.Pressure < vent.UnderPressureLockoutThreshold); - if ((vent.PressureChecks & VentPressureBound.ExternalBound) != 0) { // Vents cannot supply high pressures from an almost empty pipe, instead it's proportional to the pipe @@ -267,7 +272,10 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems } else if (vent.PumpDirection == VentPumpDirection.Releasing) { - _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance); + if (vent.UnderPressureLockout & !vent.PressureLockoutOverride) + _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Lockout, appearance); + else + _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance); } else if (vent.PumpDirection == VentPumpDirection.Siphoning) { @@ -281,7 +289,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems return; if (args.IsInDetailsRange) { - if (pumpComponent.UnderPressureLockout & !pumpComponent.PressureLockoutOverride) + if (pumpComponent.PumpDirection == VentPumpDirection.Releasing & pumpComponent.UnderPressureLockout & !pumpComponent.PressureLockoutOverride) { args.PushMarkup(Loc.GetString("gas-vent-pump-uvlo")); } diff --git a/Content.Shared/Atmos/Piping/Unary/Visuals/VentPumpVisuals.cs b/Content.Shared/Atmos/Piping/Unary/Visuals/VentPumpVisuals.cs index f15ccde5f2..01aeda7b00 100644 --- a/Content.Shared/Atmos/Piping/Unary/Visuals/VentPumpVisuals.cs +++ b/Content.Shared/Atmos/Piping/Unary/Visuals/VentPumpVisuals.cs @@ -15,5 +15,6 @@ namespace Content.Shared.Atmos.Visuals In, Out, Welded, + Lockout, } } diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml index 213b0b893d..4961f90be9 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml @@ -301,6 +301,7 @@ In: { state: vent_in } Out: { state: vent_out } Welded: { state: vent_welded } + Lockout: { state: vent_lockout } - type: PipeColorVisuals - type: GasVentPump inlet: inlet diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml index 57d069c72f..63c7665978 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml @@ -55,6 +55,7 @@ In: { state: vent_in } Out: { state: vent_out } Welded: { state: vent_welded } + Lockout: { state: vent_lockout } - type: GasVentPump - type: Construction graph: GasUnary diff --git a/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/meta.json b/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/meta.json index 4e1733df55..74e1688748 100644 --- a/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/meta.json +++ b/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/meta.json @@ -28,6 +28,10 @@ "name":"vent_in", "directions" : 4, "delays":[ [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ] ] + }, + { + "name":"vent_lockout", + "directions" : 4 } ] } diff --git a/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/vent_lockout.png b/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/vent_lockout.png new file mode 100644 index 0000000000000000000000000000000000000000..bf0b9c928eec6d868a5de6bcbfc05e05e547f4eb GIT binary patch literal 1302 zcmV+x1?l>UP)!;ZI@m;20N9o zOHb>im$ZboIKen%j0Kv&V&g4lps?jJ6hmj6))W#F?-1UL)I_qRNP2AccabeU>HGCP zz4uH1`$DZ&3!RJ}(E*4?R{+rgh(=cc(E*6Ydu9hhp%8Mp98VFNrrExzEX(}&{QP{# zZE#-kTV*;^0dl!qYiw)`0HCTWBuTOz001b8!hW{gh~OnZ08@Tb0T{}qb>s^xj>rKZ zn;Azuk#u}s(EOGHsHzG|spFd|m)1ckMdbYtY@Z{F-&6oi(;!I_DpiU~l|mUBG#sCO z`1r*0Zr{4Wdn`6`$dmJ;mFkQ+*gF=g=ED9D{5evN1?0#l}_`n{*F5&3#ul9TdN*096{sgSj3Q zmsbG*>8l^%=bx6*Xf*KKAAcVO+Gqg4vHg`Q1(1TKgang5qyG2k76#?tcHniEVD*G6tr96FV*Z<~J39< zp8!Qs(0udy#97u(5Q?H;ZEelbc|r5H9Rl%0($!a;?tA=H@SESXTGA;MAxi=NFR&7z z#>3*I10~8tUyk&3#nq zQSHs|uR$;Q9s2|7^*V0m4lqp4^0u3F4-e*g3~Ts)`2*bW|XUs;VMiSOFmf0Qk1Htzq_23CpYhVD?c7wQbFC zoGn(Us_N>dgXC}P4*(9!Qp(UEB2fv-&>+-5|3aloK?pHy_3c;<@3j5^zxi!vf!T+T zA_b4Dm#g&&EM!0WbMoWdZ%m z#mw{+G))UM3wX(I%Ok|Vh*|n!KHh9*99I%?XqtBHQS}mj@VE5`yh{Xtuf6NH?6|(& zyVr4op!nPR1N3GCw(TE~xeF_u>chrX7?mnDwDZaz;5WZ*e*m+aFbC!^Img><(menv zNRq_cdF>DIi{F($;J;Q8a^(-`6m)!1v@3w<07RoJfam~3qvHkm7w$s?2Y8xccmMzZ M07*qoM6N<$f&h|nI{*Lx literal 0 HcmV?d00001