mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
18 lines
601 B
C#
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);
|
|
}
|
|
}
|