]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add pressure and temperature warning text to firelocks (#28341)
authorShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Tue, 28 May 2024 14:59:13 +0000 (07:59 -0700)
committerGitHub <noreply@github.com>
Tue, 28 May 2024 14:59:13 +0000 (10:59 -0400)
Content.Server/Doors/Systems/FirelockSystem.cs
Content.Shared/Doors/Systems/SharedFirelockSystem.cs
Resources/Locale/en-US/atmos/firelock-component.ftl

index e2b8b5829d1838321c43a2e713d279f4d1300af5..c7da404fe880a1f13e16af337b056a654bcd8a50 100644 (file)
@@ -69,7 +69,7 @@ namespace Content.Server.Doors.Systems
                     && xformQuery.TryGetComponent(uid, out var xform)
                     && 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);
                     firelock.Temperature = fire;
                     firelock.Pressure = pressure;
index 47a29a4ba803d9889d8cc6ca2cf8c8496c6b45fd..4afe26039ba466aa53582d14f8c723294822fce3 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Access.Systems;
 using Content.Shared.Doors.Components;
+using Content.Shared.Examine;
 using Content.Shared.Popups;
 using Content.Shared.Prying.Components;
 using Robust.Shared.Timing;
@@ -26,6 +27,8 @@ public abstract class SharedFirelockSystem : EntitySystem
         // Visuals
         SubscribeLocalEvent<FirelockComponent, MapInitEvent>(UpdateVisuals);
         SubscribeLocalEvent<FirelockComponent, ComponentStartup>(UpdateVisuals);
+
+        SubscribeLocalEvent<FirelockComponent, ExaminedEvent>(OnExamined);
     }
 
     public bool EmergencyPressureStop(EntityUid uid, FirelockComponent? firelock = null, DoorComponent? door = null)
@@ -107,4 +110,15 @@ public abstract class SharedFirelockSystem : EntitySystem
     }
 
     #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"));
+        }
+    }
 }
index fc375183e975e7f046dae4127526ca2411bdbe6e..81f7e58462aa181d27c8aa6b65bd8487b0f4e028 100644 (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-fire-message = A gush of warm air blows in your face... Maybe you should reconsider.
\ No newline at end of file
+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.