2021-06-09 22:19:39 +02:00
|
|
|
|
using Content.Shared.Construction;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
|
using Robust.Client.GameObjects;
|
2021-11-22 23:22:59 -08:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 11:55:25 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Client.Construction
|
2020-12-03 22:49:00 +01:00
|
|
|
|
{
|
|
|
|
|
|
[UsedImplicitly]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class MachineFrameVisualizer : AppearanceVisualizer
|
2020-12-03 22:49:00 +01:00
|
|
|
|
{
|
|
|
|
|
|
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);
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
sprite.LayerSetState(0, $"box_{data}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|