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

@ -12,8 +12,12 @@ public class DragDropSpineTests
public (UiItemList list, UiItemSlot cell, ItemDragPayload payload)? LastOver;
public (UiItemList list, UiItemSlot cell, ItemDragPayload payload)? LastDrop;
public (UiItemList list, UiItemSlot cell, ItemDragPayload payload)? LastLift;
public bool? WaitingAtLift;
public void OnDragLift(UiItemList list, UiItemSlot cell, ItemDragPayload p)
{ LastLift = (list, cell, p); }
{
WaitingAtLift = cell.WaitingVisual;
LastLift = (list, cell, p);
}
public ItemDragAcceptance OnDragOver(UiItemList list, UiItemSlot cell, ItemDragPayload p)
{ LastOver = (list, cell, p); return Acceptance; }
@ -191,6 +195,8 @@ public class DragDropSpineTests
root.OnMouseDown(UiMouseButton.Left, 10, 10);
root.OnMouseMove(20, 10); // BeginDrag → OnDragLift
Assert.False(h.WaitingAtLift); // retail selects/lifts before enabling the mesh
Assert.True(list.Cell.WaitingVisual);
root.OnMouseUp(UiMouseButton.Left, 600, 500); // release over empty space
Assert.NotNull(h.LastLift); // lift happened
Assert.Null(h.LastDrop); // no drop dispatched (off-bar)