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

@ -422,9 +422,15 @@ public sealed class InventoryController : IItemListDragHandler, IRetainedPanelCo
}
// ── IItemListDragHandler (B-Drag) — drop an item to move it (optimistic + wire) ──────────────
/// <summary>Inventory items do NOT lift-remove (unlike the toolbar): the item stays in its slot
/// while <see cref="UiItemSlot"/> reveals retail's waiting/ghosted mesh until release.</summary>
public void OnDragLift(UiItemList sourceList, UiItemSlot sourceCell, ItemDragPayload payload) { }
/// <summary>Retail ItemList_BeginDrag selects an unselected item before enabling its waiting
/// mesh. Inventory items do not lift-remove (unlike the toolbar): the item stays in its slot
/// until the server confirms the eventual drop.</summary>
public void OnDragLift(UiItemList sourceList, UiItemSlot sourceCell, ItemDragPayload payload)
{
// UIElement_ItemList::ItemList_BeginDrag @ 0x004E32D0.
if (payload.ObjId != 0 && _selection.SelectedObjectId != payload.ObjId)
_selection.Select(payload.ObjId, SelectionChangeSource.Inventory);
}
/// <summary>Advisory neutral/accept/reject overlay. Shortcut aliases stay neutral; physical grid
/// drops accept; a side-bag/main-pack drop rejects only when that container is known full.</summary>