Files
ss14-wega/Content.Client/_Wega/Dirt/ShowerSystem.cs
T
Zekins3366 864ab2ea6b pew
2026-06-02 01:41:45 +03:00

30 lines
935 B
C#

// Content.Client/Shower/ShowerSystem.cs
using Content.Shared.DirtVisuals;
using Robust.Client.GameObjects;
namespace Content.Client.Shower
{
public sealed partial 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);
}
}
}