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 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
}
}
}