]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Firelock temperature and pressure warning lights (#28339)
authorShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Mon, 21 Apr 2025 22:39:28 +0000 (15:39 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Apr 2025 22:39:28 +0000 (18:39 -0400)
* Add temperature and pressure lights to firelocks

* Replace sprites with new pressure and temperature light versions

* Remove obsolete deny and locked sprites

* Add SpriteSync for warning light animation synchronization

* Teal lights

* Partial animation implementation

* fixup! Teal lights

* Temperature lights

* Adjusted firelock light heights and added final warning light sprites

* Fix colors

* Testing colors

* Update light sprites

* updated sprites

---------

Co-authored-by: EmoGarbage404 <retron404@gmail.com>
27 files changed:
Content.Client/Doors/FirelockSystem.cs
Content.Server/Doors/Systems/FirelockSystem.cs
Content.Shared/Doors/Components/FirelockComponent.cs
Content.Shared/Doors/Systems/SharedFirelockSystem.cs
Resources/Locale/en-US/atmos/firelock-component.ftl
Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_pressure_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_temperature_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closed.png
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closing.png
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/deny.png [deleted file]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/locked.png [deleted file]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/meta.json
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/opening.png
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit_flat.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit_flat.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closed.png
Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closing.png
Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/meta.json
Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/opening.png
Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/pressure_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/temperature_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/edge_door_hazard.rsi/meta.json
Resources/Textures/Structures/Doors/edge_door_hazard.rsi/pressure_unlit.png [new file with mode: 0644]
Resources/Textures/Structures/Doors/edge_door_hazard.rsi/temperature_unlit.png [new file with mode: 0644]

index ad869391f4b81f468bf7195aa94a605608973a98..5d357c0c0921df4687a3651b5da6f02ff0bda137 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Doors.Components;
 using Content.Shared.Doors.Systems;
+using Robust.Client.Animations;
 using Robust.Client.GameObjects;
 
 namespace Content.Client.Doors;
@@ -14,6 +15,30 @@ public sealed class FirelockSystem : SharedFirelockSystem
         SubscribeLocalEvent<FirelockComponent, AppearanceChangeEvent>(OnAppearanceChange);
     }
 
+    protected override void OnComponentStartup(Entity<FirelockComponent> ent, ref ComponentStartup args)
+    {
+        base.OnComponentStartup(ent, ref args);
+        if(!TryComp<DoorComponent>(ent.Owner, out var door))
+            return;
+
+        door.ClosedSpriteStates.Add((DoorVisualLayers.BaseUnlit, ent.Comp.WarningLightSpriteState));
+        door.OpenSpriteStates.Add((DoorVisualLayers.BaseUnlit, ent.Comp.WarningLightSpriteState));
+
+        ((Animation)door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
+            {
+                LayerKey = DoorVisualLayers.BaseUnlit,
+                KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(ent.Comp.OpeningLightSpriteState, 0f) },
+            }
+        );
+
+        ((Animation)door.ClosingAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
+            {
+                LayerKey = DoorVisualLayers.BaseUnlit,
+                KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(ent.Comp.ClosingLightSpriteState, 0f) },
+            }
+        );
+    }
+
     private void OnAppearanceChange(EntityUid uid, FirelockComponent comp, ref AppearanceChangeEvent args)
     {
         if (args.Sprite == null)
index 375e5c745e7bcd7ac4f7ef22505619ea0d08e824..5fd0bf7e97a8cd92649686f59fcb1c18a23cf38b 100644 (file)
@@ -73,6 +73,8 @@ namespace Content.Server.Doors.Systems
                     _appearance.SetData(uid, DoorVisuals.ClosedLights, fire || pressure, appearance);
                     firelock.Temperature = fire;
                     firelock.Pressure = pressure;
+                    _appearance.SetData(uid, FirelockVisuals.PressureWarning, pressure, appearance);
+                    _appearance.SetData(uid, FirelockVisuals.TemperatureWarning, fire, appearance);
                     Dirty(uid, firelock);
 
                     if (pointLightQuery.TryComp(uid, out var pointLight))
index cc9278dfe7e4bb05f1a4f3b97a7f977f51de8b2a..027aa24fdfe40b9891d1003fc82bfe4147964496 100644 (file)
@@ -84,5 +84,51 @@ namespace Content.Shared.Doors.Components
         public bool Powered;
 
         #endregion
+
+        #region Client animation
+
+        /// <summary>
+        /// The sprite state used to animate the airlock frame when the airlock opens.
+        /// </summary>
+        [DataField]
+        public string OpeningLightSpriteState = "opening_unlit";
+
+        /// <summary>
+        /// The sprite state used to animate the airlock frame when the airlock closes.
+        /// </summary>
+        [DataField]
+        public string ClosingLightSpriteState = "closing_unlit";
+
+        /// <summary>
+        /// The sprite state used to animate the airlock panel when the airlock opens.
+        /// </summary>
+        [DataField]
+        public string OpeningPanelSpriteState = "panel_opening";
+
+        /// <summary>
+        /// The sprite state used to animate the airlock panel when the airlock closes.
+        /// </summary>
+        [DataField]
+        public string ClosingPanelSpriteState = "panel_closing";
+
+        /// <summary>
+        /// The sprite state used for the open airlock lights.
+        /// </summary>
+        [DataField]
+        public string OpenLightSpriteState = "open_unlit";
+
+        /// <summary>
+        /// The sprite state used for the closed airlock lights.
+        /// </summary>
+        [DataField]
+        public string WarningLightSpriteState = "closed_unlit";
+
+        /// <summary>
+        /// The sprite state used for the 'access denied' lights animation.
+        /// </summary>
+        [DataField]
+        public string DenySpriteState = "deny_unlit";
+
+        #endregion
     }
 }
index e613848c5c74c18f3681dd5309eca9466dfc7257..ff7293459010a06ed6a6e16787c581cc09ae0c47 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Doors.Components;
 using Content.Shared.Examine;
 using Content.Shared.Popups;
 using Content.Shared.Prying.Components;
+using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
 
 namespace Content.Shared.Doors.Systems;
@@ -27,7 +28,7 @@ public abstract class SharedFirelockSystem : EntitySystem
 
         // Visuals
         SubscribeLocalEvent<FirelockComponent, MapInitEvent>(UpdateVisuals);
-        SubscribeLocalEvent<FirelockComponent, ComponentStartup>(UpdateVisuals);
+        SubscribeLocalEvent<FirelockComponent, ComponentStartup>(OnComponentStartup);
 
         SubscribeLocalEvent<FirelockComponent, ExaminedEvent>(OnExamined);
     }
@@ -104,6 +105,11 @@ public abstract class SharedFirelockSystem : EntitySystem
 
     #region Visuals
 
+    protected virtual void OnComponentStartup(Entity<FirelockComponent> ent, ref ComponentStartup args)
+    {
+        UpdateVisuals(ent.Owner,ent.Comp, args);
+    }
+
     private void UpdateVisuals(EntityUid uid, FirelockComponent component, EntityEventArgs args) => UpdateVisuals(uid, component);
 
     private void UpdateVisuals(EntityUid uid,
@@ -142,3 +148,22 @@ public abstract class SharedFirelockSystem : EntitySystem
         }
     }
 }
+
+[Serializable, NetSerializable]
+public enum FirelockVisuals : byte
+{
+    PressureWarning,
+    TemperatureWarning,
+}
+
+[Serializable, NetSerializable]
+public enum FirelockVisualLayersPressure : byte
+{
+    Base
+}
+
+[Serializable, NetSerializable]
+public enum FirelockVisualLayersTemperature : byte
+{
+    Base
+}
index 81f7e58462aa181d27c8aa6b65bd8487b0f4e028..aab0fd849e78e4275acecea655c3ad6c576bb093 100644 (file)
@@ -1,4 +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.
-firelock-component-examine-pressure-warning = The [color=red]extreme pressure[/color] differential warning is active.
+firelock-component-examine-pressure-warning = The [color=cyan]extreme pressure[/color] differential warning is active.
 firelock-component-examine-temperature-warning = The [color=red]extreme temperature[/color] warning is active.
index a8820b4fc6982977575726eee8377eff469a151b..584a4e5c7bcf376b831ddd518e7b37c352ce63d0 100644 (file)
           visible: false
         - state: panel_open
           map: ["enum.WiresVisualLayers.MaintenancePanel"]
+        - state: pressure_unlit
+          visible: false
+          shader: unshaded
+          map: ["enum.FirelockVisualLayersPressure.Base"]
+        - state: temperature_unlit
+          visible: false
+          shader: unshaded
+          map: ["enum.FirelockVisualLayersTemperature.Base"]
+    - type: GenericVisualizer
+      visuals:
+        enum.FirelockVisuals.PressureWarning:
+          enum.FirelockVisualLayersPressure.Base:
+            True: { visible: true }
+            False: { visible: false }
+        enum.FirelockVisuals.TemperatureWarning:
+          enum.FirelockVisualLayersTemperature.Base:
+            True: { visible: true }
+            False: { visible: false }
     - type: AnimationPlayer
     - type: Fixtures
       fixtures:
       - FireAndGasControl
       - Fires
       - Spacing
+    - type: SyncSprite
 
 - type: entity
   id: Firelock
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_pressure_unlit.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_pressure_unlit.png
new file mode 100644 (file)
index 0000000..e44e9b6
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_pressure_unlit.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_temperature_unlit.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_temperature_unlit.png
new file mode 100644 (file)
index 0000000..67666e1
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_temperature_unlit.png differ
index 602b83df5b0b8503dbe5deb6cb73e61b20b5139e..555403073b7794e94f5d2c6be2ef4a05df61b8a3 100644 (file)
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closed.png and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closed.png differ
index 6718ae08e979bc8c73e2ec6081e70f6088157caa..2a40fddc5b02b88e5459815ad73db141b4896c7c 100644 (file)
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closing.png and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closing.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/deny.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/deny.png
deleted file mode 100644 (file)
index a2b151c..0000000
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/deny.png and /dev/null differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/locked.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/locked.png
deleted file mode 100644 (file)
index 5c87415..0000000
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/locked.png and /dev/null differ
index 505b597a61350ef511fc8ef615e76d96dda87a09..e7fa7f7cad3708f5b2af4ed5050c3a4acfe4588b 100644 (file)
         ]
       ]
     },
-    {
-      "name": "deny",
-      "delays": [
-        [
-          0.1,
-          0.1,
-          0.1
-        ]
-      ]
-    },
     {
       "name": "deny_unlit",
       "delays": [
@@ -65,9 +55,6 @@
         ]
       ]
     },
-    {
-      "name": "locked"
-    },
     {
       "name": "open"
     },
           0.4
         ]
       ]
+    },
+    {
+      "name": "pressure_unlit",
+      "delays": [
+        [
+          0.8,
+          0.4
+        ]
+      ]
+    },
+    {
+      "name": "base_pressure_unlit",
+      "delays": [
+        [
+          0.8,
+          0.4
+        ]
+      ]
+    },
+    {
+      "name": "pressure_unlit_flat",
+      "delays": [
+        [
+          0.8,
+          0.4
+        ]
+      ]
+    },
+    {
+      "name": "temperature_unlit",
+      "delays": [
+        [
+          0.8,
+          0.4
+        ]
+      ]
+    },
+    {
+      "name": "base_temperature_unlit",
+      "delays": [
+          [
+              0.8,
+              0.4
+          ]
+      ]
+    },
+    {
+      "name": "temperature_unlit_flat",
+      "delays": [
+          [
+              0.8,
+              0.4
+          ]
+      ]
     }
   ]
 }
index 113ddab7b76361111ebf7c2cb35999c487ced60d..31b1f72af1b65c203b96f6ac0f22041c152e3a9c 100644 (file)
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/opening.png and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/opening.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit.png
new file mode 100644 (file)
index 0000000..3b4e87f
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit_flat.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit_flat.png
new file mode 100644 (file)
index 0000000..fb64ac6
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/pressure_unlit_flat.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit.png
new file mode 100644 (file)
index 0000000..b6ab456
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit_flat.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit_flat.png
new file mode 100644 (file)
index 0000000..5c553a9
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit_flat.png differ
index 8c90b693a4c9a2b9c9e43b8ff4cb9a299a29d8f4..e2e149852c7a45bf66f1891d7de0a3261c2021e4 100644 (file)
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closed.png and b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closed.png differ
index 4347bf8afe785188644d457001161726d8b4d68a..f576893854df8185ed7fab0486e7fe68f2e99f1e 100644 (file)
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closing.png and b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closing.png differ
index 7c1ec64f6246c73184b4e68eccf13ff6336a9854..792da88fc58413b1135c3dfbfb63cc51d61fafca 100644 (file)
           0.4
         ]
       ]
+    },
+    {
+      "name": "pressure_unlit",
+      "delays": [
+        [
+          0.8,
+          0.4
+        ]
+      ]
+    },
+    {
+      "name": "temperature_unlit",
+      "delays": [
+        [
+          0.8,
+          0.4
+        ]
+      ]
     }
   ]
 }
index 79a05996ad2d11a989475233ab58158551341a2c..d12ecf2cf8182ccb790c9c548216e1909a3b47f2 100644 (file)
Binary files a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/opening.png and b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/opening.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/pressure_unlit.png b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/pressure_unlit.png
new file mode 100644 (file)
index 0000000..14bb8f4
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/pressure_unlit.png differ
diff --git a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/temperature_unlit.png b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/temperature_unlit.png
new file mode 100644 (file)
index 0000000..593d191
Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/temperature_unlit.png differ
index 3462a1492ae585b816cad1c55cf7e92397b469c5..45e8a4311777254d6db1ad20e60338a21e0ceb55 100644 (file)
     {
         "name": "welded_open",
         "directions": 4
+    },
+    {
+      "name": "pressure_unlit",
+      "directions": 4
+    },
+    {
+      "name": "temperature_unlit",
+      "directions": 4
     }
   ]
 }
diff --git a/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/pressure_unlit.png b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/pressure_unlit.png
new file mode 100644 (file)
index 0000000..b0c5be8
Binary files /dev/null and b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/pressure_unlit.png differ
diff --git a/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/temperature_unlit.png b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/temperature_unlit.png
new file mode 100644 (file)
index 0000000..eee51f1
Binary files /dev/null and b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/temperature_unlit.png differ