From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Tue, 30 Jul 2024 04:03:46 +0000 (-0400) Subject: fix lathe screen animations (#30479) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=c4c4a934af7655a3c9c936210c9ea5a777ae167e;p=space-station-14.git fix lathe screen animations (#30479) --- diff --git a/Content.Client/Lathe/LatheSystem.cs b/Content.Client/Lathe/LatheSystem.cs index c72f01b39b..386520c198 100644 --- a/Content.Client/Lathe/LatheSystem.cs +++ b/Content.Client/Lathe/LatheSystem.cs @@ -22,21 +22,29 @@ public sealed class LatheSystem : SharedLatheSystem if (args.Sprite == null) return; + // Lathe specific stuff + if (_appearance.TryGetData(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(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(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); + } } } diff --git a/Content.Shared/Lathe/LatheComponent.cs b/Content.Shared/Lathe/LatheComponent.cs index 88ac8c05bf..5039e78cb0 100644 --- a/Content.Shared/Lathe/LatheComponent.cs +++ b/Content.Shared/Lathe/LatheComponent.cs @@ -39,6 +39,12 @@ namespace Content.Shared.Lathe [DataField] public string? RunningState; + + [DataField] + public string? UnlitIdleState; + + [DataField] + public string? UnlitRunningState; #endregion /// diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 66f4f684e9..8abcc657cd 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -115,6 +115,8 @@ - type: Lathe idleState: icon runningState: building + unlitIdleState: unlit + unlitRunningState: unlit-building staticRecipes: - Wirecutter - Igniter @@ -266,6 +268,8 @@ - type: Lathe idleState: icon runningState: building + unlitIdleState: unlit + unlitRunningState: unlit-building staticRecipes: - LargeBeaker - Dropper diff --git a/Resources/Textures/Structures/Machines/autolathe.rsi/meta.json b/Resources/Textures/Structures/Machines/autolathe.rsi/meta.json index b53c89c7a6..2e28bba287 100644 --- a/Resources/Textures/Structures/Machines/autolathe.rsi/meta.json +++ b/Resources/Textures/Structures/Machines/autolathe.rsi/meta.json @@ -20,15 +20,31 @@ "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 index 0000000000..5b17c682dc Binary files /dev/null and b/Resources/Textures/Structures/Machines/autolathe.rsi/unlit-building.png differ diff --git a/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/meta.json b/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/meta.json index 3dfb0685f2..9eada3ebc3 100644 --- a/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/meta.json +++ b/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/meta.json @@ -20,15 +20,31 @@ "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 index 0000000000..8f03eaa61a Binary files /dev/null and b/Resources/Textures/Structures/Machines/autolathe_hypercon.rsi/unlit-building.png differ diff --git a/Resources/Textures/Structures/Machines/protolathe.rsi/meta.json b/Resources/Textures/Structures/Machines/protolathe.rsi/meta.json index 17832603ef..57f80369d0 100644 --- a/Resources/Textures/Structures/Machines/protolathe.rsi/meta.json +++ b/Resources/Textures/Structures/Machines/protolathe.rsi/meta.json @@ -20,19 +20,39 @@ "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 index 0000000000..b72d06d654 Binary files /dev/null and b/Resources/Textures/Structures/Machines/protolathe.rsi/unlit-building.png differ diff --git a/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/meta.json b/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/meta.json index b0326326f9..775b298d5a 100644 --- a/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/meta.json +++ b/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/meta.json @@ -20,16 +20,33 @@ "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 index 0000000000..bce4888e2a Binary files /dev/null and b/Resources/Textures/Structures/Machines/protolathe_hypercon.rsi/unlit-building.png differ