using Content.Shared._White.Jukebox; using Robust.Client.GameObjects; using Robust.Shared.GameStates; namespace Content.Client._White.Jukebox; public sealed class TapeCreatorSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnStateChanged); SubscribeLocalEvent(OnTapeStateChanged); } private void OnTapeStateChanged(EntityUid uid, TapeComponent component, ref ComponentHandleState args) { if (args.Current is not TapeComponentState state) return; component.Songs = state.Songs; } private void OnStateChanged(EntityUid uid, TapeCreatorComponent component, ref ComponentHandleState args) { if (args.Current is not TapeCreatorComponentState state) return; component.Recording = state.Recording; component.CoinBalance = state.CoinBalance; component.InsertedTape = state.InsertedTape; SetTapeLayerVisible(component, state.InsertedTape.HasValue); } private void SetTapeLayerVisible(TapeCreatorComponent component, bool visible) { var spriteComponent = Comp(component.Owner); spriteComponent.LayerMapTryGet("tape", out var layer); spriteComponent.LayerSetVisible(layer, visible); } }