mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-06-09 10:06:49 +02:00
30 lines
935 B
C#
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);
|
|
}
|
|
}
|
|
}
|