fix(ui): select items before drag mesh

Port ItemList_BeginDrag's select-before-waiting order so a direct press-drag shows the selection indicator on its first frame across inventory, paperdoll, and toolbar item lists.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-13 09:28:28 +02:00
parent 64a056e656
commit 609ed8bfc2
10 changed files with 71 additions and 14 deletions

View file

@ -51,6 +51,8 @@ ItemList.PrepareDragIcon(cell):
ItemList.ItemList_BeginDrag(cell):
if PrepareDragIcon(cell) failed:
return
if cell is not selected:
SetSelectedObject(cell.itemID, false)
if list is not vendor, salvage, or shortcut list:
cell.SetWaitingState(true)
StartDragAndDrop(cell.m_dragIcon, hotspot = 16,16)
@ -98,8 +100,11 @@ keeps drag-accept feedback topmost.
`GetDragGhost` returns the latter, while `OnDraw` keeps the former in the
source cell.
- `UiRoot` owns the generic source-active lifecycle, including release outside
UI and source-subtree removal. `UiItemSlot` maps that lifecycle to the retail
waiting visual for physical lists; shortcut aliases remain unghosted.
UI and source-subtree removal. It dispatches `DragBegin` before enabling the
source-active mesh, matching retail's select-then-waiting order. The inventory,
paperdoll, and toolbar handlers select an unselected dragged item synchronously.
`UiItemSlot` maps the lifecycle to the retail waiting visual for physical lists;
shortcut aliases remain unghosted.
- `UiItemSlot.WaitingSprite` is the authored `0x0600109A` mesh, not a procedural
tint.
@ -107,6 +112,8 @@ keeps drag-accept feedback topmost.
- `DragDropSpineTests.GetDragGhost_prefersDedicatedUnderlayFreeTexture`
- `DragDropSpineTests.InventoryDrag_ghostsSourceUntilRelease`
- `InventoryControllerTests.OnDragLift_selectsItem_butKeepsItUntilServerConfirms`
- `PaperdollControllerTests.DragLift_selectsEquippedItem_beforeWaitingVisual`
- `DragDropSpineTests.ShortcutDrag_doesNotGhostSource`
- `UiItemSlotTests.DefaultWaitingSprite_isRetailGhostMesh`
- `InventoryControllerTests.Empty_sprites_and_drop_feedback_are_applied_per_list_role`