1
0

GasPressurePumpSystem.cs 756 B

1234567891011121314151617181920212223
  1. using Content.Client.Atmos.UI;
  2. using Content.Shared.Atmos.Components;
  3. using Content.Shared.Atmos.EntitySystems;
  4. using Content.Shared.Atmos.Piping.Binary.Components;
  5. namespace Content.Client.Atmos.EntitySystems;
  6. public sealed class GasPressurePumpSystem : SharedGasPressurePumpSystem
  7. {
  8. public override void Initialize()
  9. {
  10. base.Initialize();
  11. SubscribeLocalEvent<GasPressurePumpComponent, AfterAutoHandleStateEvent>(OnPumpUpdate);
  12. }
  13. private void OnPumpUpdate(Entity<GasPressurePumpComponent> ent, ref AfterAutoHandleStateEvent args)
  14. {
  15. if (UserInterfaceSystem.TryGetOpenUi<GasPressurePumpBoundUserInterface>(ent.Owner, GasPressurePumpUiKey.Key, out var bui))
  16. {
  17. bui.Update();
  18. }
  19. }
  20. }