Firelock temperature and pressure warning lights (#28339)
* 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>
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
After Width: | Height: | Size: 753 B |
|
After Width: | Height: | Size: 740 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -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
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 791 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 3.5 KiB |
@@ -154,6 +154,24 @@
|
||||
0.4
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "pressure_unlit",
|
||||
"delays": [
|
||||
[
|
||||
0.8,
|
||||
0.4
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "temperature_unlit",
|
||||
"delays": [
|
||||
[
|
||||
0.8,
|
||||
0.4
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 969 B |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -291,6 +291,14 @@
|
||||
{
|
||||
"name": "welded_open",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "pressure_unlit",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "temperature_unlit",
|
||||
"directions": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 637 B |
|
After Width: | Height: | Size: 671 B |