Files
ss14-wega/Content.Client/_Wega/Dirt/ShowerSystem.cs
T
2026-06-01 23:58:02 +03:00

30 lines
927 B
C#

// Content.Client/Shower/ShowerSystem.cs
using Content.Shared.DirtVisuals;
using Robust.Client.GameObjects;
namespace Content.Client.Shower
{
public sealed class ShowerSystem : EntitySystem
{
[Dependency] private AppearanceSystem _appearance = default!;
[Dependency] private SpriteSystem _sprite = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ShowerComponent, AppearanceChangeEvent>(OnAppearanceChanged);
}
private void OnAppearanceChanged(EntityUid uid, ShowerComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (!_appearance.TryGetData(uid, ShowerVisuals.Spraying, out bool spraying))
spraying = false;
_sprite.LayerSetVisible(uid, ShowerVisuals.Spraying, spraying);
}
}
}