From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Tue, 11 Feb 2025 02:54:35 +0000 (-0800) Subject: Replace DoorVisuals.Powered with PowerDeviceVisuals.Powered (#34646) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=976172b85e6e9b6b85a49af85ed7467e648bd622;p=space-station-14.git Replace DoorVisuals.Powered with PowerDeviceVisuals.Powered (#34646) --- diff --git a/Content.Client/Doors/AirlockSystem.cs b/Content.Client/Doors/AirlockSystem.cs index 58c8730643..712bdd1bec 100644 --- a/Content.Client/Doors/AirlockSystem.cs +++ b/Content.Client/Doors/AirlockSystem.cs @@ -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(uid, DoorVisuals.State, out var state, args.Component)) state = DoorState.Closed; - if (_appearanceSystem.TryGetData(uid, DoorVisuals.Powered, out var powered, args.Component) && powered) + if (_appearanceSystem.TryGetData(uid, PowerDeviceVisuals.Powered, out var powered, args.Component) + && powered) { boltedVisible = _appearanceSystem.TryGetData(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights && (state == DoorState.Closed || state == DoorState.Welded); diff --git a/Content.Server/Doors/Systems/AirlockSystem.cs b/Content.Server/Doors/Systems/AirlockSystem.cs index ca3d133bd0..b731626ff7 100644 --- a/Content.Server/Doors/Systems/AirlockSystem.cs +++ b/Content.Server/Doors/Systems/AirlockSystem.cs @@ -18,21 +18,12 @@ public sealed class AirlockSystem : SharedAirlockSystem { base.Initialize(); - SubscribeLocalEvent(OnAirlockInit); SubscribeLocalEvent(OnSignalReceived); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnActivate, before: new[] { typeof(DoorSystem) }); } - private void OnAirlockInit(EntityUid uid, AirlockComponent component, ComponentInit args) - { - if (TryComp(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(uid, out var appearanceComponent)) - { - Appearance.SetData(uid, DoorVisuals.Powered, args.Powered, appearanceComponent); - } - if (!TryComp(uid, out DoorComponent? door)) return; diff --git a/Content.Server/Doors/Systems/FirelockSystem.cs b/Content.Server/Doors/Systems/FirelockSystem.cs index 6bb1972b6e..375e5c745e 100644 --- a/Content.Server/Doors/Systems/FirelockSystem.cs +++ b/Content.Server/Doors/Systems/FirelockSystem.cs @@ -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); } diff --git a/Content.Shared/Doors/Components/DoorComponent.cs b/Content.Shared/Doors/Components/DoorComponent.cs index 5e35045b10..a8cb25782e 100644 --- a/Content.Shared/Doors/Components/DoorComponent.cs +++ b/Content.Shared/Doors/Components/DoorComponent.cs @@ -314,7 +314,6 @@ public enum DoorState : byte public enum DoorVisuals : byte { State, - Powered, BoltLights, EmergencyLights, ClosedLights,