Add sprite for vent under-pressure lock-out (#29527)
This commit is contained in:
@@ -83,13 +83,18 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
var timeDelta = args.dt;
|
var timeDelta = args.dt;
|
||||||
var pressureDelta = timeDelta * vent.TargetPressureChange;
|
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 (vent.PumpDirection == VentPumpDirection.Releasing && pipe.Air.Pressure > 0)
|
||||||
{
|
{
|
||||||
if (environment.Pressure > vent.MaxPressure)
|
if (environment.Pressure > vent.MaxPressure)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vent.UnderPressureLockout = (environment.Pressure < vent.UnderPressureLockoutThreshold);
|
|
||||||
|
|
||||||
if ((vent.PressureChecks & VentPressureBound.ExternalBound) != 0)
|
if ((vent.PressureChecks & VentPressureBound.ExternalBound) != 0)
|
||||||
{
|
{
|
||||||
// Vents cannot supply high pressures from an almost empty pipe, instead it's proportional to the pipe
|
// Vents cannot supply high pressures from an almost empty pipe, instead it's proportional to the pipe
|
||||||
@@ -267,6 +272,9 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
}
|
}
|
||||||
else if (vent.PumpDirection == VentPumpDirection.Releasing)
|
else if (vent.PumpDirection == VentPumpDirection.Releasing)
|
||||||
{
|
{
|
||||||
|
if (vent.UnderPressureLockout & !vent.PressureLockoutOverride)
|
||||||
|
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Lockout, appearance);
|
||||||
|
else
|
||||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
|
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
|
||||||
}
|
}
|
||||||
else if (vent.PumpDirection == VentPumpDirection.Siphoning)
|
else if (vent.PumpDirection == VentPumpDirection.Siphoning)
|
||||||
@@ -281,7 +289,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
if (args.IsInDetailsRange)
|
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"));
|
args.PushMarkup(Loc.GetString("gas-vent-pump-uvlo"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,5 +15,6 @@ namespace Content.Shared.Atmos.Visuals
|
|||||||
In,
|
In,
|
||||||
Out,
|
Out,
|
||||||
Welded,
|
Welded,
|
||||||
|
Lockout,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,6 +301,7 @@
|
|||||||
In: { state: vent_in }
|
In: { state: vent_in }
|
||||||
Out: { state: vent_out }
|
Out: { state: vent_out }
|
||||||
Welded: { state: vent_welded }
|
Welded: { state: vent_welded }
|
||||||
|
Lockout: { state: vent_lockout }
|
||||||
- type: PipeColorVisuals
|
- type: PipeColorVisuals
|
||||||
- type: GasVentPump
|
- type: GasVentPump
|
||||||
inlet: inlet
|
inlet: inlet
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
In: { state: vent_in }
|
In: { state: vent_in }
|
||||||
Out: { state: vent_out }
|
Out: { state: vent_out }
|
||||||
Welded: { state: vent_welded }
|
Welded: { state: vent_welded }
|
||||||
|
Lockout: { state: vent_lockout }
|
||||||
- type: GasVentPump
|
- type: GasVentPump
|
||||||
- type: Construction
|
- type: Construction
|
||||||
graph: GasUnary
|
graph: GasUnary
|
||||||
|
|||||||
@@ -28,6 +28,10 @@
|
|||||||
"name":"vent_in",
|
"name":"vent_in",
|
||||||
"directions" : 4,
|
"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 ] ]
|
"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
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user