2021-11-03 14:33:36 -07:00
|
|
|
|
using Content.Shared.PneumaticCannon;
|
|
|
|
|
|
using Robust.Client.GameObjects;
|
2021-11-22 23:22:59 -08:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-05 18:09:01 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
2021-11-03 14:33:36 -07:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.PneumaticCannon
|
|
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class PneumaticCannonVisualizer : AppearanceVisualizer
|
2021-11-03 14:33:36 -07:00
|
|
|
|
{
|
|
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnChangeData(component);
|
|
|
|
|
|
|
2021-12-05 18:09:01 +01:00
|
|
|
|
var entities = IoCManager.Resolve<IEntityManager>();
|
|
|
|
|
|
if (!entities.TryGetComponent(component.Owner, out SpriteComponent sprite))
|
2021-11-03 14:33:36 -07:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (component.TryGetData(PneumaticCannonVisuals.Tank, out bool tank))
|
|
|
|
|
|
{
|
|
|
|
|
|
sprite.LayerSetVisible(PneumaticCannonVisualLayers.Tank, tank);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|