]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add sprite for vent under-pressure lock-out (#29527)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sat, 29 Jun 2024 05:02:48 +0000 (07:02 +0200)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2024 05:02:48 +0000 (22:02 -0700)
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs
Content.Shared/Atmos/Piping/Unary/Visuals/VentPumpVisuals.cs
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml
Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/meta.json
Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/vent_lockout.png [new file with mode: 0644]

index 8951f8a9474dd538376389e4c4aa989f694e5381..2859c7f19d0c09ab09d2add5c0f43b980f9bbe29 100644 (file)
@@ -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"));
                 }
index f15ccde5f291ad092dd8c3524bc3eb0ad2b938a4..01aeda7b00070728d7a6f7951d8310e4b01c2948 100644 (file)
@@ -15,5 +15,6 @@ namespace Content.Shared.Atmos.Visuals
         In,
         Out,
         Welded,
+        Lockout,
     }
 }
index 213b0b893d94ea4aebf642b543a8f883edb002c3..4961f90be916bb5fc0425df890fbd98f1792e6ec 100644 (file)
             In: { state: vent_in }
             Out: { state: vent_out }
             Welded: { state: vent_welded }
+            Lockout: { state: vent_lockout }
     - type: PipeColorVisuals
     - type: GasVentPump
       inlet: inlet
index 57d069c72faf72879a6f613f0d954aed7a7fb503..63c7665978ba6e68ba17393881d917c66c545696 100644 (file)
@@ -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
index 4e1733df55f2a003c0391d7632417a10e8c92e56..74e1688748df93b3c207d51acb09f8ff9030c751 100644 (file)
          "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 (file)
index 0000000..bf0b9c9
Binary files /dev/null and b/Resources/Textures/Structures/Piping/Atmospherics/vent.rsi/vent_lockout.png differ