Add self message variants for starting/finishing vending machine restocking (#36633)

* Add self message variants for starting/finishing restock

* Identity
This commit is contained in:
Tayrtahn
2025-04-16 17:33:02 -04:00
committed by GitHub
parent 705cbe1541
commit aec8e7f8d9
3 changed files with 15 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ using Content.Shared.Damage;
using Content.Shared.Destructible;
using Content.Shared.DoAfter;
using Content.Shared.Emp;
using Content.Shared.IdentityManagement;
using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Throwing;
@@ -15,6 +16,7 @@ using Content.Shared.UserInterface;
using Content.Shared.VendingMachines;
using Content.Shared.Wall;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -141,7 +143,9 @@ namespace Content.Server.VendingMachines
TryRestockInventory(uid, component);
Popup.PopupEntity(Loc.GetString("vending-machine-restock-done", ("this", args.Args.Used), ("user", args.Args.User), ("target", uid)), args.Args.User, PopupType.Medium);
Popup.PopupEntity(Loc.GetString("vending-machine-restock-done-self", ("target", uid)), args.Args.User, args.Args.User, PopupType.Medium);
var othersFilter = Filter.PvsExcept(args.Args.User);
Popup.PopupEntity(Loc.GetString("vending-machine-restock-done-others", ("user", Identity.Entity(args.User, EntityManager)), ("target", uid)), args.Args.User, othersFilter, true, PopupType.Medium);
Audio.PlayPvs(restockComponent.SoundRestockDone, uid, AudioParams.Default.WithVolume(-2f).WithVariation(0.2f));

View File

@@ -1,4 +1,5 @@
using Content.Shared.DoAfter;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Wires;
@@ -72,8 +73,10 @@ public abstract partial class SharedVendingMachineSystem
if (!_doAfter.TryStartDoAfter(doAfterArgs))
return;
Popup.PopupPredicted(Loc.GetString("vending-machine-restock-start", ("this", uid), ("user", args.User),
("target", target)),
var selfMessage = Loc.GetString("vending-machine-restock-start-self", ("target", target));
var othersMessage = Loc.GetString("vending-machine-restock-start-others", ("user", Identity.Entity(args.User, EntityManager)), ("target", target));
Popup.PopupPredicted(selfMessage,
othersMessage,
uid,
args.User,
PopupType.Medium);

View File

@@ -1,4 +1,6 @@
vending-machine-restock-invalid-inventory = { CAPITALIZE(THE($this)) } isn't the right package to restock { THE($target) }.
vending-machine-restock-needs-panel-open = { CAPITALIZE($target) } needs { POSS-ADJ($target) } maintenance panel opened first.
vending-machine-restock-start = { $user } starts restocking { $target }.
vending-machine-restock-done = { $user } finishes restocking { $target }.
vending-machine-restock-needs-panel-open = { CAPITALIZE(THE($target)) } needs { POSS-ADJ($target) } maintenance panel opened first.
vending-machine-restock-start-self = You start restocking { THE($target) }.
vending-machine-restock-start-others = { CAPITALIZE(THE($user)) } starts restocking { THE($target) }.
vending-machine-restock-done-self = You finish restocking { THE($target) }.
vending-machine-restock-done-others = { CAPITALIZE(THE($user)) } finishes restocking { THE($target) }.