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
|
|
@ -84,6 +84,7 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
|
|||
var (element, mask, _, unlockBit) = PaperdollSlotBackgrounds.Definitions[i];
|
||||
if (layout.FindElement(element) is not UiItemList list) continue;
|
||||
list.RegisterDragHandler(this);
|
||||
list.ExamineItemRequested = ExamineItem;
|
||||
list.Cell.SourceKind = ItemDragSource.Equipment;
|
||||
list.Cell.SlotIndex = i; // definition position = equipped drag-payload SourceSlot
|
||||
list.Cell.EmptySprite = emptySlotSprites is not null
|
||||
|
|
@ -350,6 +351,12 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
|
|||
foreach (var a in _armorSlots) a.Visible = _viewState.ArmorSlotsVisible;
|
||||
}
|
||||
|
||||
private void ExamineItem(uint itemId)
|
||||
{
|
||||
_selection.Select(itemId, SelectionChangeSource.Paperdoll);
|
||||
_itemInteraction.ExamineSelectedOrEnterMode(itemId);
|
||||
}
|
||||
|
||||
/// <summary>Detach event handlers (idempotent).</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
|
|
@ -361,6 +368,8 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
|
|||
_objects.ObjectUpdated -= OnObjectChanged;
|
||||
_objects.Cleared -= OnObjectsCleared;
|
||||
_selection.Changed -= OnSelectionChanged;
|
||||
foreach (var (_, list) in _slots)
|
||||
list.ExamineItemRequested = null;
|
||||
if (_dollViewport is UiViewport doll)
|
||||
doll.ClickedAt = null;
|
||||
switch (_dollDragMask)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue