28 lines
764 B
C#
28 lines
764 B
C#
using Content.Shared._DV.Biscuit;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client._DV.Biscuit;
|
|
|
|
public sealed class BiscuitSystem : VisualizerSystem<BiscuitVisualsComponent>
|
|
{
|
|
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
|
[Dependency] private readonly SpriteSystem _sprite = default!;
|
|
|
|
protected override void OnAppearanceChange(EntityUid uid, BiscuitVisualsComponent component,
|
|
ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
_appearance.TryGetData(uid, BiscuitStatus.Cracked, out bool cracked);
|
|
|
|
_sprite.LayerSetVisible((uid, args.Sprite), BiscuitVisualLayers.Top, !cracked);
|
|
}
|
|
}
|
|
|
|
public enum BiscuitVisualLayers : byte
|
|
{
|
|
Base,
|
|
Top
|
|
}
|