using Content.Shared.Instruments; using Content.Shared.UserInterface; namespace Content.Shared._DV.Instruments; public sealed class InstrumentVisualsSystem : EntitySystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnUIClosed); SubscribeLocalEvent(OnUIOpened); } private void OnUIClosed(Entity ent, ref BoundUIClosedEvent args) { if (args.UiKey is not InstrumentUiKey) return; _appearance.SetData(ent, InstrumentVisuals.Playing, false); } private void OnUIOpened(Entity ent, ref BoundUIOpenedEvent args) { if (args.UiKey is not InstrumentUiKey) return; _appearance.SetData(ent, InstrumentVisuals.Playing, true); } }