Files
wylab-station-14/Content.Client/Power/ActivatableUIRequiresPowerSystem.cs
slarticodefast ed7c004de2 Fix looking at verbs causing sounds or popups (#41609)
* fix verb popups

* spelling
2025-11-28 21:41:44 +00:00

27 lines
858 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 class ActivatableUIRequiresPowerSystem : SharedActivatableUIRequiresPowerSystem
{
[Dependency] private readonly 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();
}
}