mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
26 lines
857 B
C#
26 lines
857 B
C#
using Content.Client.Power.EntitySystems;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Power.Components;
|
|
using Content.Shared.Power.EntitySystems;
|
|
using Content.Shared.UserInterface;
|
|
using Content.Shared.Wires;
|
|
|
|
namespace Content.Client.Power;
|
|
|
|
public sealed partial class ActivatableUIRequiresPowerSystem : SharedActivatableUIRequiresPowerSystem
|
|
{
|
|
[Dependency] private SharedPopupSystem _popup = default!;
|
|
|
|
protected override void OnActivate(Entity<ActivatableUIRequiresPowerComponent> ent, ref ActivatableUIOpenAttemptEvent args)
|
|
{
|
|
if (args.Cancelled || this.IsPowered(ent.Owner, EntityManager))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!args.Silent)
|
|
_popup.PopupClient(Loc.GetString("base-computer-ui-component-not-powered", ("machine", ent.Owner)), args.User, args.User);
|
|
|
|
args.Cancel();
|
|
}
|
|
}
|