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

@ -176,7 +176,7 @@ public class PaperdollControllerTests
}
[Fact]
public void ClickEquippedItem_updatesSharedSelection()
public void MouseDownEquippedItem_updatesSharedSelection()
{
var (layout, lists) = BuildLayout();
var objects = new ClientObjectTable();
@ -184,7 +184,8 @@ public class PaperdollControllerTests
var selection = new SelectionState();
Bind(layout, objects, selection: selection);
lists[HeadSlot].Cell.Clicked!();
UiItemSlot cell = lists[HeadSlot].Cell;
cell.OnEvent(new UiEvent(0u, cell, UiEventType.MouseDown));
Assert.Equal(0xA01u, selection.SelectedObjectId);
Assert.True(lists[HeadSlot].Cell.Selected);