Add PopupPredictedCursor and fix doubled popups on vending machines (#36655)

* Add PopupCursorPredicted method

* Fix doubled popups on vending machine restock failures

* Rename to match existing pattern
This commit is contained in:
Tayrtahn
2025-04-18 00:01:46 -04:00
committed by GitHub
parent 725522c183
commit e00e2ba407
4 changed files with 35 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ public abstract partial class SharedVendingMachineSystem
{
if (!TryComp<WiresPanelComponent>(target, out var panel) || !panel.Open)
{
Popup.PopupCursor(Loc.GetString("vending-machine-restock-needs-panel-open",
Popup.PopupPredictedCursor(Loc.GetString("vending-machine-restock-needs-panel-open",
("this", uid),
("user", user),
("target", target)),
@@ -37,7 +37,7 @@ public abstract partial class SharedVendingMachineSystem
{
if (!component.CanRestock.Contains(machineComponent.PackPrototypeId))
{
Popup.PopupCursor(Loc.GetString("vending-machine-restock-invalid-inventory", ("this", uid), ("user", user),
Popup.PopupPredictedCursor(Loc.GetString("vending-machine-restock-invalid-inventory", ("this", uid), ("user", user),
("target", target)), user);
return false;