Files
OldThink/Content.Client/_White/Cult/Structures/CultCraftStructureVisualizerSystem.cs

24 lines
812 B
C#
Raw Permalink Normal View History

using Content.Shared._White.Cult;
2024-01-27 15:19:52 +03:00
using Robust.Client.GameObjects;
namespace Content.Client._White.Cult.Structures;
public sealed class CultCraftStructureVisualizerSystem : VisualizerSystem<CultCraftStructureVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, CultCraftStructureVisualsComponent component, ref AppearanceChangeEvent args)
{
base.OnAppearanceChange(uid, component, ref args);
if (args.Sprite == null
|| !AppearanceSystem.TryGetData<bool>(uid, CultCraftStructureVisuals.Activated, out var activated))
return;
args.Sprite.LayerSetState(CultCraftStructureVisualsLayers.Activated, activated ? component.StateOn : component.StateOff);
}
}
public enum CultCraftStructureVisualsLayers : byte
{
Activated
}