Files
OldThink/Content.Client/Construction/MachineFrameVisualizer.cs

25 lines
724 B
C#
Raw Normal View History

2021-06-09 22:19:39 +02:00
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
2021-12-03 11:55:25 +01:00
using Robust.Shared.IoC;
2021-06-09 22:19:39 +02:00
namespace Content.Client.Construction
{
[UsedImplicitly]
public sealed class MachineFrameVisualizer : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (component.TryGetData<int>(MachineFrameVisuals.State, out var data))
{
2021-12-03 15:53:09 +01:00
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner);
sprite.LayerSetState(0, $"box_{data}");
}
}
}
}