Cleans up lathe rsis (#3392)
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
[UsedImplicitly]
|
||||
public class AutolatheVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private const string AnimationKey = "autolathe_animation";
|
||||
private const string AnimationKey = "inserting_animation";
|
||||
|
||||
private Animation _buildingAnimation;
|
||||
private Animation _insertingMetalAnimation;
|
||||
@@ -24,12 +24,12 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
{
|
||||
base.LoadData(node);
|
||||
|
||||
_buildingAnimation = PopulateAnimation("autolathe_building", "autolathe_building_unlit", 0.5f);
|
||||
_insertingMetalAnimation = PopulateAnimation("autolathe_inserting_metal_plate", "autolathe_inserting_unlit", 0.9f);
|
||||
_insertingGlassAnimation = PopulateAnimation("autolathe_inserting_glass_plate", "autolathe_inserting_unlit", 0.9f);
|
||||
_insertingGoldAnimation = PopulateAnimation("autolathe_inserting_gold_plate", "autolathe_inserting_unlit", 0.9f);
|
||||
_insertingPlasmaAnimation = PopulateAnimation("autolathe_inserting_plasma_sheet", "autolathe_inserting_unlit", 0.9f);
|
||||
_insertingPlasticAnimation = PopulateAnimation("autolathe_inserting_plastic_sheet", "autolathe_inserting_unlit", 0.9f);
|
||||
_buildingAnimation = PopulateAnimation("building", "building_unlit", 0.5f);
|
||||
_insertingMetalAnimation = PopulateAnimation("inserting_metal", "inserting_unlit", 0.5f);
|
||||
_insertingGlassAnimation = PopulateAnimation("inserting_glass", "inserting_unlit", 0.5f);
|
||||
_insertingGoldAnimation = PopulateAnimation("inserting_gold", "inserting_unlit", 0.5f);
|
||||
_insertingPlasmaAnimation = PopulateAnimation("inserting_plasma", "inserting_unlit", 0.5f);
|
||||
_insertingPlasticAnimation = PopulateAnimation("inserting_plastic", "inserting_unlit", 0.5f);
|
||||
}
|
||||
|
||||
private Animation PopulateAnimation(string sprite, string spriteUnlit, float length)
|
||||
@@ -67,7 +67,7 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
{
|
||||
state = LatheVisualState.Idle;
|
||||
}
|
||||
|
||||
sprite.LayerSetVisible(AutolatheVisualLayers.AnimationLayer, true);
|
||||
switch (state)
|
||||
{
|
||||
case LatheVisualState.Idle:
|
||||
@@ -76,8 +76,9 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
animPlayer.Stop(AnimationKey);
|
||||
}
|
||||
|
||||
sprite.LayerSetState(AutolatheVisualLayers.Base, "autolathe");
|
||||
sprite.LayerSetState(AutolatheVisualLayers.BaseUnlit, "autolathe_unlit");
|
||||
sprite.LayerSetState(AutolatheVisualLayers.Base, "icon");
|
||||
sprite.LayerSetState(AutolatheVisualLayers.BaseUnlit, "unlit");
|
||||
sprite.LayerSetVisible(AutolatheVisualLayers.AnimationLayer, false);
|
||||
break;
|
||||
case LatheVisualState.Producing:
|
||||
if (!animPlayer.HasRunningAnimation(AnimationKey))
|
||||
@@ -125,7 +126,8 @@ namespace Content.Client.GameObjects.Components.Power
|
||||
public enum AutolatheVisualLayers : byte
|
||||
{
|
||||
Base,
|
||||
BaseUnlit
|
||||
BaseUnlit,
|
||||
AnimationLayer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user