AtmosphereSystem.cs 749 B

123456789101112131415161718192021222324
  1. using Content.Client.Atmos.Components;
  2. using Content.Shared.Atmos.Components;
  3. using Content.Shared.Atmos.EntitySystems;
  4. using Robust.Shared.GameStates;
  5. namespace Content.Client.Atmos.EntitySystems;
  6. public sealed class AtmosphereSystem : SharedAtmosphereSystem
  7. {
  8. public override void Initialize()
  9. {
  10. base.Initialize();
  11. SubscribeLocalEvent<MapAtmosphereComponent, ComponentHandleState>(OnMapHandleState);
  12. }
  13. private void OnMapHandleState(EntityUid uid, MapAtmosphereComponent component, ref ComponentHandleState args)
  14. {
  15. if (args.Current is not MapAtmosphereComponentState state)
  16. return;
  17. // Struct so should just copy by value.
  18. component.OverlayData = state.Overlay;
  19. }
  20. }