diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs index 1a635147f2d..8b993245948 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs @@ -4,11 +4,13 @@ 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 override void Update(float frameTime) // This code is licensed under AGPLv3. See AGPLv3.txt private void OnGunExamine(EntityUid uid, AutoShootGunComponent component, ExaminedEvent args) { - if (!HasComp(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 @@ private void OnActivateGun(EntityUid uid, AutoShootGunComponent component, Activ 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 @@ private void OnActivateGun(EntityUid uid, AutoShootGunComponent component, Activ 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); } } diff --git a/Resources/Locale/en-US/_NF/weapons/gun.ftl b/Resources/Locale/en-US/_NF/weapons/gun.ftl index 9197a627c78..5e954b49895 100644 --- a/Resources/Locale/en-US/_NF/weapons/gun.ftl +++ b/Resources/Locale/en-US/_NF/weapons/gun.ftl @@ -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!