fix(ui): select retained items on mouse down

Port UIElement_ListBox's press-time selection ordering through the shared retained item-list contract. Inventory, loot, paperdoll, and physical shortcuts now update canonical selection before release or drag promotion, while target-mode consumption suppresses drag and release-time activation.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-24 06:17:31 +02:00
parent 2dd5cb80d2
commit 043ab10b3c
18 changed files with 292 additions and 62 deletions

View file

@ -199,6 +199,20 @@ public sealed class ExternalContainerControllerTests
Assert.Empty(h.Pickups);
}
[Fact]
public void MouseDownLoot_selectsBeforeCompletedClick()
{
using var h = new Harness();
h.Open(Chest, new ContainerContentEntry(Item, 0u));
UiItemSlot cell = h.Contents.GetItem(0)!;
cell.OnEvent(new UiEvent(0u, cell, UiEventType.MouseDown));
Assert.Equal(Item, h.Selection.SelectedObjectId);
Assert.True(cell.Selected);
Assert.Empty(h.Pickups);
}
[Fact]
public void CloseAndRangeExit_SendUseOnceWithoutNoLongerViewing()
{