From 1e79431a9e510c38dac3be28725e72a80dc22d45 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 13:27:07 +0100 Subject: [PATCH] Treat inventory transfer as submitted intent --- Aetheria.State.Verify/Program.cs | 21 +++++++++++++++++++++ Assets/Scripts/UI/Menu/InventoryMenu.cs | 20 ++++++-------------- Assets/Scripts/UI/Menu/InventoryPanel.cs | 22 ++++++++++------------ 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 2216faa75..f0cb60627 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -9058,6 +9058,27 @@ static void RequireInventoryDoubleClickTransferRequestAuthority(string root) string.Join("; ", inventoryUiAcceptanceHits)); } + var forbiddenInventorySubmissionAcceptanceSymbols = new[] + { + "Unable to move item!", + "Verify that cargo bays are empty before un-equipping them.", + "var success = RequestDraggedItemTo", + "if (RequestCargoItemTransfer(", + "if (RequestEquippedItemTransfer(" + }; + var inventorySubmissionAcceptanceHits = new[] { inventoryMenuPath, inventoryPanelPath } + .SelectMany(path => File.ReadLines(path) + .Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line })) + .Where(line => forbiddenInventorySubmissionAcceptanceSymbols.Any(symbol => line.Line.Contains(symbol, StringComparison.Ordinal))) + .Select(line => $"{Path.GetRelativePath(root, line.Path)}:{line.LineNumber}: {line.Line.Trim()}") + .ToArray(); + if (inventorySubmissionAcceptanceHits.Length > 0) + { + throw new InvalidOperationException( + "Inventory UI still treats daemon transfer submission as accepted inventory movement: " + + string.Join("; ", inventorySubmissionAcceptanceHits)); + } + var requiredUiCalls = new[] { "GameManager.RequestCargoItemTransfer", diff --git a/Assets/Scripts/UI/Menu/InventoryMenu.cs b/Assets/Scripts/UI/Menu/InventoryMenu.cs index a32c3e2ba..5fda4d35d 100644 --- a/Assets/Scripts/UI/Menu/InventoryMenu.cs +++ b/Assets/Scripts/UI/Menu/InventoryMenu.cs @@ -99,12 +99,8 @@ public class InventoryMenu : MonoBehaviour HideEquippedItemDetailsSurface(); ClearSelectedItemSelection(); var otherPanel = panel == InventoryPanels[0] ? InventoryPanels[1] : InventoryPanels[0]; - if (RequestCargoItemTransfer(cargoEvent.CargoBay, otherPanel, item)) - { - // TODO: SFX: Equip - panel.RefreshCells(); - otherPanel.RefreshCells(); - } + RequestCargoItemTransfer(cargoEvent.CargoBay, otherPanel, item); + // TODO: SFX: Equip // else // TODO: SFX: Fail } @@ -135,14 +131,10 @@ public class InventoryMenu : MonoBehaviour HideEquippedItemDetailsSurface(); ClearSelectedItemSelection(); var otherPanel = panel == InventoryPanels[0] ? InventoryPanels[1] : InventoryPanels[0]; - if (RequestEquippedItemTransfer(entityEvent.Entity, item, otherPanel)) - { - // TODO: SFX: Unequip - panel.RefreshCells(); - otherPanel.RefreshCells(); - // else - // TODO: SFX: Fail - } + RequestEquippedItemTransfer(entityEvent.Entity, item, otherPanel); + // TODO: SFX: Unequip + // else + // TODO: SFX: Fail } else { diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index 2e606b19a..18bc419dd 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -637,12 +637,11 @@ private void Update() { //Debug.Log("Entity Drag Callback"); FakeOccupancy = null; - var success = RequestDraggedItemToEntity(drag, entity, placementPosition); - if (!success) - ShowUnableToMoveItemDialog(); - RefreshCells(); + var submitted = RequestDraggedItemToEntity(drag, entity, placementPosition); + if (!submitted) + ShowUnableToSubmitItemMoveRequestDialog(); // TODO: SFX: Equip - return success; + return submitted; }); }); cell.PointerExitTrigger.OnPointerExitAsObservable() @@ -837,11 +836,11 @@ private void Update() { //Debug.Log("Inventory Drag Callback"); FakeOccupancy = null; - var success = RequestDraggedItemToCargo(drag, cargo, placementPosition); - if (!success) - ShowUnableToMoveItemDialog(); + var submitted = RequestDraggedItemToCargo(drag, cargo, placementPosition); + if (!submitted) + ShowUnableToSubmitItemMoveRequestDialog(); // TODO: SFX: Drop - return success; + return submitted; }); }); cell.PointerExitTrigger.OnPointerExitAsObservable() @@ -1142,11 +1141,10 @@ private void Update() } } - private void ShowUnableToMoveItemDialog() + private void ShowUnableToSubmitItemMoveRequestDialog() { Dialog.Clear(); - Dialog.Title.text = "Unable to move item!"; - Dialog.AddProperty("Verify that cargo bays are empty before un-equipping them."); + Dialog.Title.text = "Unable to submit item move request!"; Dialog.Show(); Dialog.MoveToCursor(); }