]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Resolves PowerDeviceVisualizer is Obsolete (#13900)
authorTemporalOroboros <TemporalOroboros@gmail.com>
Sat, 22 Apr 2023 09:37:40 +0000 (02:37 -0700)
committerGitHub <noreply@github.com>
Sat, 22 Apr 2023 09:37:40 +0000 (19:37 +1000)
Content.Client/Power/Visualizers/PowerDeviceVisualizer.cs [deleted file]
Content.Client/Power/Visualizers/PowerDeviceVisuals.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Structures/Machines/research.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/portable.yml

diff --git a/Content.Client/Power/Visualizers/PowerDeviceVisualizer.cs b/Content.Client/Power/Visualizers/PowerDeviceVisualizer.cs
deleted file mode 100644 (file)
index ed2c276..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-using Content.Shared.Power;
-using JetBrains.Annotations;
-using Robust.Client.GameObjects;
-using Robust.Shared.GameObjects;
-using Robust.Shared.IoC;
-
-namespace Content.Client.Power
-{
-    [UsedImplicitly]
-    public sealed class PowerDeviceVisualizer : AppearanceVisualizer
-    {
-        [Obsolete("Subscribe to AppearanceChangeEvent instead.")]
-        public override void OnChangeData(AppearanceComponent component)
-        {
-            base.OnChangeData(component);
-
-            var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(component.Owner);
-            var powered = component.TryGetData(PowerDeviceVisuals.Powered, out bool poweredVar) && poweredVar;
-            sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
-        }
-    }
-
-    public enum PowerDeviceVisualLayers : byte
-    {
-        Powered
-    }
-}
diff --git a/Content.Client/Power/Visualizers/PowerDeviceVisuals.cs b/Content.Client/Power/Visualizers/PowerDeviceVisuals.cs
new file mode 100644 (file)
index 0000000..5cc86d2
--- /dev/null
@@ -0,0 +1,7 @@
+namespace Content.Client.Power;
+
+/// Remains in use by portable scrubbers and lathes.
+public enum PowerDeviceVisualLayers : byte
+{
+    Powered
+}
index 8d93f4e4e989b62430ff41b7edda945d8ab9efae..767e7b8c93a9fb72b7c6e1c191f7f191539f81fa 100644 (file)
     - key: enum.ResearchClientUiKey.Key
       type: ResearchClientBoundUserInterface
   - type: Appearance
+  - type: GenericVisualizer
     visuals:
-    - type: PowerDeviceVisualizer
+      enum.PowerDeviceVisuals.Powered:
+        enum.PowerDeviceVisualLayers.Powered:
+          True: {visible: true}
+          False: {visible: false}
   - type: Destructible
     thresholds:
     - trigger:
index 28cf2ef0809ac3817cf27c6a9db6706f89ec92be..c51f8f474fc50236a5d604b471834b33878b0b0f 100644 (file)
     powerLoad: 2000
   - type: ExtensionCableReceiver
   - type: Appearance
+  - type: GenericVisualizer
     visuals:
-    - type: PowerDeviceVisualizer
+      enum.PowerDeviceVisuals.Powered:
+        enum.PowerDeviceVisualLayers.Powered:
+          True: {visible: true}
+          False: {visible: false}
   - type: PortableScrubberVisuals
     idleState: icon
     runningState: icon-running