From 468d1424ecb9ec98b4c3a68caf3cfec101c32100 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 17 Apr 2025 05:39:14 +1000 Subject: [PATCH] Vending machine popup prediction (#36622) Title. --- .../SharedVendingMachineSystem.Restock.cs | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) 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); } -- 2.51.2