Add pressure and temperature warning text to firelocks (#28341)

This commit is contained in:
ShadowCommander
2024-05-28 07:59:13 -07:00
committed by GitHub
parent 5141a95ed2
commit e4f1201b4c
3 changed files with 18 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ namespace Content.Server.Doors.Systems
&& xformQuery.TryGetComponent(uid, out var xform) && xformQuery.TryGetComponent(uid, out var xform)
&& appearanceQuery.TryGetComponent(uid, out var appearance)) && appearanceQuery.TryGetComponent(uid, out var appearance))
{ {
var (fire, pressure) = CheckPressureAndFire(uid, firelock, xform, airtight, airtightQuery); var (pressure, fire) = CheckPressureAndFire(uid, firelock, xform, airtight, airtightQuery);
_appearance.SetData(uid, DoorVisuals.ClosedLights, fire || pressure, appearance); _appearance.SetData(uid, DoorVisuals.ClosedLights, fire || pressure, appearance);
firelock.Temperature = fire; firelock.Temperature = fire;
firelock.Pressure = pressure; firelock.Pressure = pressure;

View File

@@ -1,5 +1,6 @@
using Content.Shared.Access.Systems; using Content.Shared.Access.Systems;
using Content.Shared.Doors.Components; using Content.Shared.Doors.Components;
using Content.Shared.Examine;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Prying.Components; using Content.Shared.Prying.Components;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -26,6 +27,8 @@ public abstract class SharedFirelockSystem : EntitySystem
// Visuals // Visuals
SubscribeLocalEvent<FirelockComponent, MapInitEvent>(UpdateVisuals); SubscribeLocalEvent<FirelockComponent, MapInitEvent>(UpdateVisuals);
SubscribeLocalEvent<FirelockComponent, ComponentStartup>(UpdateVisuals); SubscribeLocalEvent<FirelockComponent, ComponentStartup>(UpdateVisuals);
SubscribeLocalEvent<FirelockComponent, ExaminedEvent>(OnExamined);
} }
public bool EmergencyPressureStop(EntityUid uid, FirelockComponent? firelock = null, DoorComponent? door = null) public bool EmergencyPressureStop(EntityUid uid, FirelockComponent? firelock = null, DoorComponent? door = null)
@@ -107,4 +110,15 @@ public abstract class SharedFirelockSystem : EntitySystem
} }
#endregion #endregion
private void OnExamined(Entity<FirelockComponent> ent, ref ExaminedEvent args)
{
using (args.PushGroup(nameof(FirelockComponent)))
{
if (ent.Comp.Pressure)
args.PushMarkup(Loc.GetString("firelock-component-examine-pressure-warning"));
if (ent.Comp.Temperature)
args.PushMarkup(Loc.GetString("firelock-component-examine-temperature-warning"));
}
}
} }

View File

@@ -1,2 +1,4 @@
firelock-component-is-holding-pressure-message = A gush of air blows in your face... Maybe you should reconsider. firelock-component-is-holding-pressure-message = A gush of air blows in your face... Maybe you should reconsider.
firelock-component-is-holding-fire-message = A gush of warm air blows in your face... Maybe you should reconsider. firelock-component-is-holding-fire-message = A gush of warm air blows in your face... Maybe you should reconsider.
firelock-component-examine-pressure-warning = The [color=red]extreme pressure[/color] differential warning is active.
firelock-component-examine-temperature-warning = The [color=red]extreme temperature[/color] warning is active.