]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix lathe screen animations (#30479)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Tue, 30 Jul 2024 04:03:46 +0000 (00:03 -0400)
committerGitHub <noreply@github.com>
Tue, 30 Jul 2024 04:03:46 +0000 (14:03 +1000)
Content.Client/Lathe/LatheSystem.cs
Content.Shared/Lathe/LatheComponent.cs
Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Resources/Textures/Structures/Machines/autolathe.rsi/meta.json
Resources/Textures/Structures/Machines/autolathe.rsi/unlit-building.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/meta.json
Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/unlit-building.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/protolathe.rsi/meta.json
Resources/Textures/Structures/Machines/protolathe.rsi/unlit-building.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/meta.json
Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/unlit-building.png [new file with mode: 0644]

index c72f01b39b149cdb3309ea48c9e744a7c83f88d6..386520c198fd3a1e2845817fab07fa09aa41819e 100644 (file)
@@ -22,21 +22,29 @@ public sealed class LatheSystem : SharedLatheSystem
         if (args.Sprite == null)
             return;
 
+        // Lathe specific stuff
+        if (_appearance.TryGetData<bool>(uid, LatheVisuals.IsRunning, out var isRunning, args.Component))
+        {
+            if (args.Sprite.LayerMapTryGet(LatheVisualLayers.IsRunning, out var runningLayer) &&
+                component.RunningState != null &&
+                component.IdleState != null)
+            {
+                var state = isRunning ? component.RunningState : component.IdleState;
+                args.Sprite.LayerSetState(runningLayer, state);
+            }
+        }
+
         if (_appearance.TryGetData<bool>(uid, PowerDeviceVisuals.Powered, out var powered, args.Component) &&
             args.Sprite.LayerMapTryGet(PowerDeviceVisualLayers.Powered, out var powerLayer))
         {
             args.Sprite.LayerSetVisible(powerLayer, powered);
-        }
 
-        // Lathe specific stuff
-        if (_appearance.TryGetData<bool>(uid, LatheVisuals.IsRunning, out var isRunning, args.Component) &&
-            args.Sprite.LayerMapTryGet(LatheVisualLayers.IsRunning, out var runningLayer) &&
-            component.RunningState != null &&
-            component.IdleState != null)
-        {
-            var state = isRunning ? component.RunningState : component.IdleState;
-            args.Sprite.LayerSetAnimationTime(runningLayer, 0f);
-            args.Sprite.LayerSetState(runningLayer, state);
+            if (component.UnlitIdleState != null &&
+                component.UnlitRunningState != null)
+            {
+                var state = isRunning ? component.UnlitRunningState : component.UnlitIdleState;
+                args.Sprite.LayerSetState(powerLayer, state);
+            }
         }
     }
 
index 88ac8c05bfbf824c71e4bce5eab507471fedbfcf..5039e78cb0761e7174ec0c9ecddb6d33b0b8b24e 100644 (file)
@@ -39,6 +39,12 @@ namespace Content.Shared.Lathe
 
         [DataField]
         public string? RunningState;
+
+        [DataField]
+        public string? UnlitIdleState;
+
+        [DataField]
+        public string? UnlitRunningState;
         #endregion
 
         /// <summary>
index 66f4f684e9a98bfe2537bc5d3111abe436ffa639..8abcc657cdb8f7b3c33d9a7fde75f13bd7111792 100644 (file)
   - type: Lathe
     idleState: icon
     runningState: building
+    unlitIdleState: unlit
+    unlitRunningState: unlit-building
     staticRecipes:
       - Wirecutter
       - Igniter
   - type: Lathe
     idleState: icon
     runningState: building
+    unlitIdleState: unlit
+    unlitRunningState: unlit-building
     staticRecipes:
     - LargeBeaker
     - Dropper
index b53c89c7a6e60b2d5754b22ea023bce6772435f2..2e28bba2875cee08062c26ee0ceb3a92ed0e1a58 100644 (file)
       "name": "building",
       "delays": [
         [
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15
+        ]
+      ]
+    },
+    {
+      "name": "unlit-building",
+      "delays": [
+        [
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15
         ]
       ]
     },
diff --git a/Resources/Textures/Structures/Machines/autolathe.rsi/unlit-building.png b/Resources/Textures/Structures/Machines/autolathe.rsi/unlit-building.png
new file mode 100644 (file)
index 0000000..5b17c68
Binary files /dev/null and b/Resources/Textures/Structures/Machines/autolathe.rsi/unlit-building.png differ
index 3dfb0685f28a485c06840490e0b9e2a74749eb00..9eada3ebc3db9e186947be622b7d45bb20c78c3a 100644 (file)
       "name": "building",
       "delays": [
         [
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5,
-          0.5
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15
+        ]
+      ]
+    },
+    {
+      "name": "unlit-building",
+      "delays": [
+        [
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15,
+          0.15
         ]
       ]
     },
diff --git a/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/unlit-building.png b/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/unlit-building.png
new file mode 100644 (file)
index 0000000..8f03eaa
Binary files /dev/null and b/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/unlit-building.png differ
index 17832603ef425007b37a57f215b245c1440dcd87..57f80369d0bc795cd2a014397f8c4ea9dc4df9cd 100644 (file)
       "name": "building",
       "delays": [
         [
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8,
-          0.8
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10
+        ]
+      ]
+    },
+    {
+      "name": "unlit-building",
+      "delays": [
+        [
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10
         ]
       ]
     },
diff --git a/Resources/Textures/Structures/Machines/protolathe.rsi/unlit-building.png b/Resources/Textures/Structures/Machines/protolathe.rsi/unlit-building.png
new file mode 100644 (file)
index 0000000..b72d06d
Binary files /dev/null and b/Resources/Textures/Structures/Machines/protolathe.rsi/unlit-building.png differ
index b0326326f9792bd9b458761f51302c47ba811776..775b298d5a87ab2944f0af10842d78cfda2aa287 100644 (file)
       "name": "building",
       "delays": [
         [
-          1.0,
-          1.0,
-          1.0,
-          1.0,
-          1.0,
-          1.0,
-          1.0,
-          1.0,
-          1.0,
-          1.0
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10
+        ]
+      ]
+    },
+    {
+      "name": "unlit-building",
+      "delays": [
+        [
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10,
+          0.10
         ]
       ]
     },
diff --git a/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/unlit-building.png b/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/unlit-building.png
new file mode 100644 (file)
index 0000000..bce4888
Binary files /dev/null and b/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/unlit-building.png differ