Replace DoorVisuals.Powered with PowerDeviceVisuals.Powered (#34646)

This commit is contained in:
ShadowCommander
2025-02-10 18:54:35 -08:00
committed by GitHub
parent 0cfcbdeccd
commit 976172b85e
4 changed files with 3 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
using Content.Client.Wires.Visualizers;
using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems;
using Content.Shared.Power;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
@@ -84,7 +85,8 @@ public sealed class AirlockSystem : SharedAirlockSystem
if (!_appearanceSystem.TryGetData<DoorState>(uid, DoorVisuals.State, out var state, args.Component))
state = DoorState.Closed;
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.Powered, out var powered, args.Component) && powered)
if (_appearanceSystem.TryGetData<bool>(uid, PowerDeviceVisuals.Powered, out var powered, args.Component)
&& powered)
{
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component)
&& lights && (state == DoorState.Closed || state == DoorState.Welded);

View File

@@ -18,21 +18,12 @@ public sealed class AirlockSystem : SharedAirlockSystem
{
base.Initialize();
SubscribeLocalEvent<AirlockComponent, ComponentInit>(OnAirlockInit);
SubscribeLocalEvent<AirlockComponent, SignalReceivedEvent>(OnSignalReceived);
SubscribeLocalEvent<AirlockComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<AirlockComponent, ActivateInWorldEvent>(OnActivate, before: new[] { typeof(DoorSystem) });
}
private void OnAirlockInit(EntityUid uid, AirlockComponent component, ComponentInit args)
{
if (TryComp<ApcPowerReceiverComponent>(uid, out var receiverComponent))
{
Appearance.SetData(uid, DoorVisuals.Powered, receiverComponent.Powered);
}
}
private void OnSignalReceived(EntityUid uid, AirlockComponent component, ref SignalReceivedEvent args)
{
if (args.Port == component.AutoClosePort && component.AutoClose)
@@ -47,11 +38,6 @@ public sealed class AirlockSystem : SharedAirlockSystem
component.Powered = args.Powered;
Dirty(uid, component);
if (TryComp<AppearanceComponent>(uid, out var appearanceComponent))
{
Appearance.SetData(uid, DoorVisuals.Powered, args.Powered, appearanceComponent);
}
if (!TryComp(uid, out DoorComponent? door))
return;

View File

@@ -37,8 +37,6 @@ namespace Content.Server.Doors.Systems
private void PowerChanged(EntityUid uid, FirelockComponent component, ref PowerChangedEvent args)
{
// TODO this should REALLLLY not be door specific appearance thing.
_appearance.SetData(uid, DoorVisuals.Powered, args.Powered);
component.Powered = args.Powered;
Dirty(uid, component);
}

View File

@@ -314,7 +314,6 @@ public enum DoorState : byte
public enum DoorVisuals : byte
{
State,
Powered,
BoltLights,
EmergencyLights,
ClosedLights,