From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 16 Apr 2025 19:39:14 +0000 (+1000) Subject: Vending machine popup prediction (#36622) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=468d1424ecb9ec98b4c3a68caf3cfec101c32100;p=space-station-14.git Vending machine popup prediction (#36622) Title. --- diff --git a/Content.Shared/VendingMachines/SharedVendingMachineSystem.Restock.cs b/Content.Shared/VendingMachines/SharedVendingMachineSystem.Restock.cs index de57189bc7..a5e2a6eccc 100644 --- a/Content.Shared/VendingMachines/SharedVendingMachineSystem.Restock.cs +++ b/Content.Shared/VendingMachines/SharedVendingMachineSystem.Restock.cs @@ -16,14 +16,11 @@ public abstract partial class SharedVendingMachineSystem { if (!TryComp(target, out var panel) || !panel.Open) { - if (_net.IsServer) - { - Popup.PopupCursor(Loc.GetString("vending-machine-restock-needs-panel-open", - ("this", uid), - ("user", user), - ("target", target)), - user); - } + Popup.PopupCursor(Loc.GetString("vending-machine-restock-needs-panel-open", + ("this", uid), + ("user", user), + ("target", target)), + user); return false; } @@ -39,11 +36,8 @@ public abstract partial class SharedVendingMachineSystem { if (!component.CanRestock.Contains(machineComponent.PackPrototypeId)) { - if (_net.IsServer) - { - Popup.PopupCursor(Loc.GetString("vending-machine-restock-invalid-inventory", ("this", uid), ("user", user), - ("target", target)), user); - } + Popup.PopupCursor(Loc.GetString("vending-machine-restock-invalid-inventory", ("this", uid), ("user", user), + ("target", target)), user); return false; } @@ -78,13 +72,11 @@ public abstract partial class SharedVendingMachineSystem if (!_doAfter.TryStartDoAfter(doAfterArgs)) return; - if (_net.IsServer) - { - Popup.PopupEntity(Loc.GetString("vending-machine-restock-start", ("this", uid), ("user", args.User), - ("target", target)), - args.User, - PopupType.Medium); - } + Popup.PopupPredicted(Loc.GetString("vending-machine-restock-start", ("this", uid), ("user", args.User), + ("target", target)), + uid, + args.User, + PopupType.Medium); Audio.PlayPredicted(component.SoundRestockStart, uid, args.User); }