Fixes lathe stuff (#3383)

This commit is contained in:
Swept
2021-02-23 07:53:14 +00:00
committed by GitHub
parent e05698c027
commit 1e13c3b265
17 changed files with 99 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Content.Shared.GameObjects.Components.Power;
using JetBrains.Annotations;
using Robust.Client.Animations;
@@ -18,6 +18,7 @@ namespace Content.Client.GameObjects.Components.Power
private Animation _insertingGlassAnimation;
private Animation _insertingGoldAnimation;
private Animation _insertingPlasmaAnimation;
private Animation _insertingPlasticAnimation;
public override void LoadData(YamlMappingNode node)
{
@@ -28,6 +29,7 @@ namespace Content.Client.GameObjects.Components.Power
_insertingGlassAnimation = PopulateAnimation("protolathe_glass", 0.9f);
_insertingGoldAnimation = PopulateAnimation("protolathe_gold", 0.9f);
_insertingPlasmaAnimation = PopulateAnimation("protolathe_plasma", 0.9f);
_insertingPlasticAnimation = PopulateAnimation("protolathe_plastic", 0.9f);
}
private Animation PopulateAnimation(string sprite, float length)
@@ -103,6 +105,12 @@ namespace Content.Client.GameObjects.Components.Power
animPlayer.Play(_insertingPlasmaAnimation, AnimationKey);
}
break;
case LatheVisualState.InsertingPlastic:
if (!animPlayer.HasRunningAnimation(AnimationKey))
{
animPlayer.Play(_insertingPlasticAnimation, AnimationKey);
}
break;
default:
throw new ArgumentOutOfRangeException();
}