mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-15 03:31:44 +01:00
27 lines
880 B
C#
27 lines
880 B
C#
using Content.Shared.Injector.Fabticator;
|
|
using Robust.Client.GameObjects;
|
|
|
|
public sealed class InjectorFabticatorSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
|
[Dependency] private readonly SpriteSystem _sprite = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<InjectorFabticatorComponent, AppearanceChangeEvent>(OnAppearanceChanged);
|
|
}
|
|
|
|
private void OnAppearanceChanged(EntityUid uid, InjectorFabticatorComponent component, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
if (!_appearance.TryGetData<bool>(uid, InjectorFabticatorVisuals.IsRunning, out var isRunning, args.Component))
|
|
return;
|
|
|
|
_sprite.LayerSetVisible(uid, InjectorFabticatorVisuals.IsRunning, isRunning);
|
|
}
|
|
}
|