diff --git a/Content.Client/Doors/FirelockSystem.cs b/Content.Client/Doors/FirelockSystem.cs index ad869391f4..5d357c0c09 100644 --- a/Content.Client/Doors/FirelockSystem.cs +++ b/Content.Client/Doors/FirelockSystem.cs @@ -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(OnAppearanceChange); } + protected override void OnComponentStartup(Entity ent, ref ComponentStartup args) + { + base.OnComponentStartup(ent, ref args); + if(!TryComp(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) diff --git a/Content.Server/Doors/Systems/FirelockSystem.cs b/Content.Server/Doors/Systems/FirelockSystem.cs index 375e5c745e..5fd0bf7e97 100644 --- a/Content.Server/Doors/Systems/FirelockSystem.cs +++ b/Content.Server/Doors/Systems/FirelockSystem.cs @@ -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)) diff --git a/Content.Shared/Doors/Components/FirelockComponent.cs b/Content.Shared/Doors/Components/FirelockComponent.cs index cc9278dfe7..027aa24fdf 100644 --- a/Content.Shared/Doors/Components/FirelockComponent.cs +++ b/Content.Shared/Doors/Components/FirelockComponent.cs @@ -84,5 +84,51 @@ namespace Content.Shared.Doors.Components public bool Powered; #endregion + + #region Client animation + + /// + /// The sprite state used to animate the airlock frame when the airlock opens. + /// + [DataField] + public string OpeningLightSpriteState = "opening_unlit"; + + /// + /// The sprite state used to animate the airlock frame when the airlock closes. + /// + [DataField] + public string ClosingLightSpriteState = "closing_unlit"; + + /// + /// The sprite state used to animate the airlock panel when the airlock opens. + /// + [DataField] + public string OpeningPanelSpriteState = "panel_opening"; + + /// + /// The sprite state used to animate the airlock panel when the airlock closes. + /// + [DataField] + public string ClosingPanelSpriteState = "panel_closing"; + + /// + /// The sprite state used for the open airlock lights. + /// + [DataField] + public string OpenLightSpriteState = "open_unlit"; + + /// + /// The sprite state used for the closed airlock lights. + /// + [DataField] + public string WarningLightSpriteState = "closed_unlit"; + + /// + /// The sprite state used for the 'access denied' lights animation. + /// + [DataField] + public string DenySpriteState = "deny_unlit"; + + #endregion } } diff --git a/Content.Shared/Doors/Systems/SharedFirelockSystem.cs b/Content.Shared/Doors/Systems/SharedFirelockSystem.cs index e613848c5c..ff72934590 100644 --- a/Content.Shared/Doors/Systems/SharedFirelockSystem.cs +++ b/Content.Shared/Doors/Systems/SharedFirelockSystem.cs @@ -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(UpdateVisuals); - SubscribeLocalEvent(UpdateVisuals); + SubscribeLocalEvent(OnComponentStartup); SubscribeLocalEvent(OnExamined); } @@ -104,6 +105,11 @@ public abstract class SharedFirelockSystem : EntitySystem #region Visuals + protected virtual void OnComponentStartup(Entity 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 +} diff --git a/Resources/Locale/en-US/atmos/firelock-component.ftl b/Resources/Locale/en-US/atmos/firelock-component.ftl index 81f7e58462..aab0fd849e 100644 --- a/Resources/Locale/en-US/atmos/firelock-component.ftl +++ b/Resources/Locale/en-US/atmos/firelock-component.ftl @@ -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. diff --git a/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml b/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml index a8820b4fc6..584a4e5c7b 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml @@ -52,6 +52,24 @@ 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: @@ -124,6 +142,7 @@ - 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 index 0000000000..e44e9b62b1 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 index 0000000000..67666e1ef2 Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/base_temperature_unlit.png differ diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closed.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closed.png index 602b83df5b..555403073b 100644 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 diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closing.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/closing.png index 6718ae08e9..2a40fddc5b 100644 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 index a2b151c140..0000000000 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 index 5c87415ec1..0000000000 Binary files a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/locked.png and /dev/null differ diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/meta.json b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/meta.json index 505b597a61..e7fa7f7cad 100644 --- a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/meta.json +++ b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/meta.json @@ -45,16 +45,6 @@ ] ] }, - { - "name": "deny", - "delays": [ - [ - 0.1, - 0.1, - 0.1 - ] - ] - }, { "name": "deny_unlit", "delays": [ @@ -65,9 +55,6 @@ ] ] }, - { - "name": "locked" - }, { "name": "open" }, @@ -142,6 +129,60 @@ 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 + ] + ] } ] } diff --git a/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/opening.png b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/opening.png index 113ddab7b7..31b1f72af1 100644 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 index 0000000000..3b4e87f1da 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 index 0000000000..fb64ac658c 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 index 0000000000..b6ab456943 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 index 0000000000..5c553a9865 Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Glass/firelock.rsi/temperature_unlit_flat.png differ diff --git a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closed.png b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closed.png index 8c90b693a4..e2e149852c 100644 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 diff --git a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closing.png b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/closing.png index 4347bf8afe..f576893854 100644 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 diff --git a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/meta.json b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/meta.json index 7c1ec64f62..792da88fc5 100644 --- a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/meta.json +++ b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/meta.json @@ -154,6 +154,24 @@ 0.4 ] ] + }, + { + "name": "pressure_unlit", + "delays": [ + [ + 0.8, + 0.4 + ] + ] + }, + { + "name": "temperature_unlit", + "delays": [ + [ + 0.8, + 0.4 + ] + ] } ] } diff --git a/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/opening.png b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/opening.png index 79a05996ad..d12ecf2cf8 100644 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 index 0000000000..14bb8f4c5a 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 index 0000000000..593d191641 Binary files /dev/null and b/Resources/Textures/Structures/Doors/Airlocks/Standard/firelock.rsi/temperature_unlit.png differ diff --git a/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/meta.json b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/meta.json index 3462a1492a..45e8a43117 100644 --- a/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/meta.json +++ b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/meta.json @@ -291,6 +291,14 @@ { "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 index 0000000000..b0c5be8bbf 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 index 0000000000..eee51f1e0d Binary files /dev/null and b/Resources/Textures/Structures/Doors/edge_door_hazard.rsi/temperature_unlit.png differ