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

@ -190,6 +190,52 @@ procedural arrow. The indicator is persistent selection presentation. Retail
also has a separate, short-lived click confirmation owned by SmartBox; it is not
implemented in `CPhysicsPart::Draw` or `ACCWeenieObject::SetSelected`.
## Retained physical-item press, activation, and drag ordering
`UIElement_ListBox::MouseDown @ 0x0046E3A0`
```text
on left mouse down over a single-selection ListBox:
item = GetItemUnderMouse()
if item exists:
SetSelectedItem(item, notify=true)
if drag-selection is enabled:
StartDragSelect()
```
`UIElement_ItemList::ListenToElementMessage @ 0x004E4D50`
```text
on the physical-item left-button-down notice:
item = UIItem under the mouse
if a target mode is active:
HandleTargetedUseLeftClick(item)
consume the notice
else if item.itemID != 0:
if this list uses single selection:
update the list selection
SetSelectedObject(item.itemID)
on the physical-item double-click notice:
if item.itemID != 0:
UseObject(item.itemID)
```
`gmPaperDollUI::ListenToElementMessage @ 0x004A5C30` uses the same ordering
for a worn item: target mode first, otherwise set the selected object on the
left-button-down notice; right-click selects and examines.
Therefore selection is not a completed-click action. The green selection frame
appears while the left button is still held, before the three-pixel drag
threshold can promote the press into a drag. Opening a bag, using/equipping an
item, and shortcut activation remain completed click or double-click actions,
so dragging never also activates the source. A target-mode-consumed press
suppresses the rest of that physical-item click gesture.
Acdream implements that split once in `UiItemList`/`UiItemSlot`. Inventory,
external-container loot, paperdoll equipment, and physical toolbar shortcuts
only supply their selection source and release-time activation command.
## Right-click selection and examination
`UIElement_SmartBoxWrapper::MouseUp @ 0x004E5820`