Cleans up lathe rsis (#3392)

This commit is contained in:
Swept
2021-02-25 11:48:35 +00:00
committed by GitHub
parent 6acb38754f
commit e9af0d58e7
51 changed files with 434 additions and 410 deletions

View File

@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components.Power
[UsedImplicitly]
public class ProtolatheVisualizer : AppearanceVisualizer
{
private const string AnimationKey = "protolathe_animation";
private const string AnimationKey = "inserting_animation";
private Animation _buildingAnimation;
private Animation _insertingMetalAnimation;
@@ -24,23 +24,28 @@ namespace Content.Client.GameObjects.Components.Power
{
base.LoadData(node);
_buildingAnimation = PopulateAnimation("protolathe_building", 0.9f);
_insertingMetalAnimation = PopulateAnimation("protolathe_metal", 0.9f);
_insertingGlassAnimation = PopulateAnimation("protolathe_glass", 0.9f);
_insertingGoldAnimation = PopulateAnimation("protolathe_gold", 0.9f);
_insertingPlasmaAnimation = PopulateAnimation("protolathe_plasma", 0.9f);
_insertingPlasticAnimation = PopulateAnimation("protolathe_plastic", 0.9f);
_buildingAnimation = PopulateAnimation("building", "building_unlit", 0.8f);
_insertingMetalAnimation = PopulateAnimation("inserting_metal", "inserting_unlit", 0.8f);
_insertingGlassAnimation = PopulateAnimation("inserting_glass", "inserting_unlit", 0.8f);
_insertingGoldAnimation = PopulateAnimation("inserting_gold", "inserting_unlit", 0.8f);
_insertingPlasmaAnimation = PopulateAnimation("inserting_plasma", "inserting_unlit", 0.8f);
_insertingPlasticAnimation = PopulateAnimation("inserting_plastic", "inserting_unlit", 0.8f);
}
private Animation PopulateAnimation(string sprite, float length)
private Animation PopulateAnimation(string sprite, string spriteUnlit, float length)
{
var animation = new Animation {Length = TimeSpan.FromSeconds(length)};
var animation = new Animation { Length = TimeSpan.FromSeconds(length) };
var flick = new AnimationTrackSpriteFlick();
animation.AnimationTracks.Add(flick);
flick.LayerKey = ProtolatheVisualLayers.AnimationLayer;
flick.LayerKey = ProtolatheVisualLayers.Base;
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame(sprite, 0f));
var flickUnlit = new AnimationTrackSpriteFlick();
animation.AnimationTracks.Add(flickUnlit);
flickUnlit.LayerKey = ProtolatheVisualLayers.BaseUnlit;
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame(spriteUnlit, 0f));
return animation;
}
@@ -71,8 +76,8 @@ namespace Content.Client.GameObjects.Components.Power
animPlayer.Stop(AnimationKey);
}
sprite.LayerSetState(ProtolatheVisualLayers.Base, "protolathe");
sprite.LayerSetState(ProtolatheVisualLayers.BaseUnlit, "protolathe_unlit");
sprite.LayerSetState(ProtolatheVisualLayers.Base, "icon");
sprite.LayerSetState(ProtolatheVisualLayers.BaseUnlit, "unlit");
sprite.LayerSetVisible(ProtolatheVisualLayers.AnimationLayer, false);
break;
case LatheVisualState.Producing: