fix(ui): assess retained items on right click
Port UIElement_ItemList's physical-item right-click branch through the shared retained list. Select and appraise backpack, loot, paperdoll, and shortcut items through their canonical owners, while preventing RMB movement from lifting items or issuing appraisal requests. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
5ad32d5753
commit
2dd5cb80d2
17 changed files with 264 additions and 5 deletions
|
|
@ -138,6 +138,7 @@ public sealed class ToolbarController : IItemListDragHandler, IRetainedPanelCont
|
|||
if (_slots[i] is { } list)
|
||||
{
|
||||
WireClick(list);
|
||||
list.ExamineItemRequested = ExamineItem;
|
||||
// B.1 drag-drop spine: this controller is the drop handler for every
|
||||
// toolbar slot list; each cell knows its slot index + that it's a
|
||||
// shortcut-bar source (retail UIElement_ItemList::RegisterItemListDragHandler).
|
||||
|
|
@ -531,6 +532,15 @@ public sealed class ToolbarController : IItemListDragHandler, IRetainedPanelCont
|
|||
};
|
||||
}
|
||||
|
||||
private void ExamineItem(uint itemId)
|
||||
{
|
||||
if (_selectItem is not null)
|
||||
_selectItem(itemId);
|
||||
else
|
||||
_selection?.Select(itemId, SelectionChangeSource.Toolbar);
|
||||
_itemInteraction?.ExamineSelectedOrEnterMode(itemId);
|
||||
}
|
||||
|
||||
private static ItemDragAcceptance InventoryButtonDragOver(ItemDragPayload payload)
|
||||
=> payload.ObjId != 0 && payload.SourceKind != ItemDragSource.ShortcutBar
|
||||
? ItemDragAcceptance.Accept
|
||||
|
|
@ -765,6 +775,9 @@ public sealed class ToolbarController : IItemListDragHandler, IRetainedPanelCont
|
|||
_combatState.CombatModeChanged -= SetCombatMode;
|
||||
if (_selection is not null)
|
||||
_selection.Changed -= OnSelectionChanged;
|
||||
foreach (UiItemList? list in _slots)
|
||||
if (list is not null)
|
||||
list.ExamineItemRequested = null;
|
||||
_repo.ObjectAdded -= OnRepositoryObjectChanged;
|
||||
_repo.ObjectUpdated -= OnRepositoryObjectChanged;
|
||||
_repo.ObjectRemoved -= OnRepositoryObjectChanged;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue