Port frontier no power popups (#2230)

* meow

* meow

* meow

* meow

* meow
This commit is contained in:
Lyndomen 2024-11-18 17:19:17 -05:00 committed by GitHub
parent 1f5132fbe3
commit 0e3643bee9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -4,11 +4,13 @@ using Content.Server.Power.EntitySystems; // Frontier
using Content.Shared.Interaction; // Frontier
using Content.Shared.Examine; // Frontier
using Content.Shared.Power; // Frontier
using Content.Server.Popups; // Frontier
namespace Content.Server.Weapons.Ranged.Systems;
public sealed partial class GunSystem
{
[Dependency] public PopupSystem _popup = default!; // Frontier
public override void Update(float frameTime)
{
base.Update(frameTime);
@ -37,9 +39,6 @@ public sealed partial class GunSystem
// This code is licensed under AGPLv3. See AGPLv3.txt
private void OnGunExamine(EntityUid uid, AutoShootGunComponent component, ExaminedEvent args)
{
if (!HasComp<ApcPowerReceiverComponent>(uid))
return;
// Powered is already handled by other power components
var enabled = Loc.GetString(component.On ? "gun-comp-enabled" : "gun-comp-disabled");
@ -60,6 +59,7 @@ public sealed partial class GunSystem
DisableGun(uid, component);
args.Handled = true;
_popup.PopupEntity(Loc.GetString("auto-fire-disabled"), uid, args.User);
}
else if (CanEnable(uid, component))
{
@ -68,6 +68,11 @@ public sealed partial class GunSystem
EnableGun(uid, component);
args.Handled = true;
_popup.PopupEntity(Loc.GetString("auto-fire-enabled"), uid, args.User);
}
else
{
_popup.PopupEntity(Loc.GetString("auto-fire-enabled-no-power"), uid, args.User);
}
}

View File

@ -1,2 +1,6 @@
gun-comp-enabled = The gun is turned [color=green]on[/color].
gun-comp-disabled = The gun is turned [color=red]off[/color].
auto-fire-enabled = Gun turned on.
auto-fire-disabled = Gun turned off.
auto-fire-enabled-no-power = Gun turned on; but it has no power!