Port frontier no power popups (#2230)
* meow * meow * meow * meow * meow
This commit is contained in:
parent
1f5132fbe3
commit
0e3643bee9
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
Loading…
Reference in New Issue