mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-15 03:31:30 +01:00
Fix firelock lights for hot / pressurized rooms (#15892)
This commit is contained in:
27
Content.Client/Doors/FirelockSystem.cs
Normal file
27
Content.Client/Doors/FirelockSystem.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Content.Shared.Doors.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Doors;
|
||||
|
||||
public sealed class FirelockSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<FirelockComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
||||
}
|
||||
|
||||
private void OnAppearanceChange(EntityUid uid, FirelockComponent comp, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
// Apply the closed lights bool to the sprite
|
||||
bool unlitVisible =
|
||||
(AppearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) &&
|
||||
closedLights);
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Doors.Systems;
|
||||
using Content.Shared.Doors.Components;
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Doors.Systems;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Components;
|
||||
using Content.Shared.Database;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.Construction;
|
||||
using JetBrains.Annotations;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Examine;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Atmos.Monitor.Systems;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
@@ -161,13 +160,13 @@ namespace Content.Server.Doors.Systems
|
||||
{
|
||||
var ev = new BeforeDoorAutoCloseEvent();
|
||||
RaiseLocalEvent(uid, ev);
|
||||
UpdateVisuals(uid, component, args);
|
||||
if (ev.Cancelled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_doorSystem.SetNextStateChange(uid, component.AutocloseDelay);
|
||||
UpdateVisuals(uid, component, args);
|
||||
}
|
||||
|
||||
private void OnBeforeDoorAutoclose(EntityUid uid, FirelockComponent component, BeforeDoorAutoCloseEvent args)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Wires;
|
||||
using Content.Shared.Doors;
|
||||
using Content.Shared.Doors.Components;
|
||||
@@ -11,7 +10,7 @@ public sealed class DoorSafetyWireAction : ComponentWireAction<AirlockComponent>
|
||||
{
|
||||
public override Color Color { get; set; } = Color.Red;
|
||||
public override string Name { get; set; } = "wire-name-door-safety";
|
||||
|
||||
|
||||
|
||||
[DataField("timeout")]
|
||||
private int _timeout = 30;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Wires;
|
||||
using Content.Shared.Doors;
|
||||
using Content.Shared.Doors.Components;
|
||||
@@ -11,7 +10,7 @@ public sealed class DoorTimingWireAction : ComponentWireAction<AirlockComponent>
|
||||
{
|
||||
public override Color Color { get; set; } = Color.Orange;
|
||||
public override string Name { get; set; } = "wire-name-door-timer";
|
||||
|
||||
|
||||
[DataField("timeout")]
|
||||
private int _timeout = 30;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ using Content.Shared.Doors.Systems;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Server.Doors.Systems;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Interaction.Events;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Server.Atmos.Monitor.Components;
|
||||
using Content.Shared.Doors.Components;
|
||||
|
||||
namespace Content.Server.Doors.Components
|
||||
namespace Content.Shared.Doors.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Companion component to <see cref="DoorComponent"/> that handles firelock-specific behavior, including
|
||||
Reference in New Issue
Block a user