CatStation/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs
slarticodefast 0552b28cf5
cleanup all popups on client and server (#44572)
* cleanup popups on client and server

* fix RDC BUI
2026-07-11 14:13:19 +00:00

18 lines
601 B
C#

using Content.Shared.Power;
using Content.Shared.Power.Components;
using Content.Shared.Power.EntitySystems;
using Content.Shared.UserInterface;
namespace Content.Server.Power.EntitySystems;
public sealed partial class ActivatableUIRequiresPowerSystem : SharedActivatableUIRequiresPowerSystem
{
[Dependency] private ActivatableUISystem _activatableUI = default!;
[SubscribeLocalEvent]
private void OnPowerChanged(EntityUid uid, ActivatableUIRequiresPowerComponent component, ref PowerChangedEvent args)
{
if (!args.Powered)
_activatableUI.CloseAll(uid);
}
}