Files
tbd-station-14/Content.Client/GameObjects/Components/Power/PowerDeviceVisualizer2D.cs
Pieter-Jan Briers 9a38577a18 Improve autolathe & protolathe visuals.
Used correct Eris autolathe sprite.
Gave them an unlit layer.
2019-10-14 09:57:57 +02:00

26 lines
793 B
C#

using Content.Shared.GameObjects.Components.Power;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
namespace Content.Client.GameObjects.Components.Power
{
[UsedImplicitly]
public class PowerDeviceVisualizer2D : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
var sprite = component.Owner.GetComponent<ISpriteComponent>();
var powered = component.TryGetData(PowerDeviceVisuals.Powered, out bool poweredVar) && poweredVar;
sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
}
}
public enum PowerDeviceVisualLayers
{
Powered
}
}