Fix firelock lights for hot / pressurized rooms (#15892)

This commit is contained in:
Tom Leys
2023-05-06 17:54:36 +12:00
committed by GitHub
parent eaa83ae113
commit 79eeefd813
9 changed files with 32 additions and 12 deletions

View 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);
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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