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
|
|
@ -153,6 +153,9 @@ public sealed class InventoryController : IItemListDragHandler, IRetainedPanelCo
|
|||
_contentsGrid?.RegisterDragHandler(this);
|
||||
_containerList?.RegisterDragHandler(this);
|
||||
_topContainer?.RegisterDragHandler(this);
|
||||
if (_contentsGrid is not null) _contentsGrid.ExamineItemRequested = ExamineItem;
|
||||
if (_containerList is not null) _containerList.ExamineItemRequested = ExamineItem;
|
||||
if (_topContainer is not null) _topContainer.ExamineItemRequested = ExamineItem;
|
||||
|
||||
// Burden meter: vertical 11×58 bar (gmBackpackUI m_burdenMeter, retail direction 4).
|
||||
_burdenMeter = layout.FindElement(BurdenMeterId) as UiMeter;
|
||||
|
|
@ -778,6 +781,17 @@ public sealed class InventoryController : IItemListDragHandler, IRetainedPanelCo
|
|||
_selection.Select(guid, SelectionChangeSource.Inventory);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retail ItemList right-click: select the physical item, then enter the
|
||||
/// shared appraisal request owner. This is intentionally independent from
|
||||
/// left-click target mode and double-click Use/AutoWield.
|
||||
/// </summary>
|
||||
private void ExamineItem(uint guid)
|
||||
{
|
||||
SelectItem(guid);
|
||||
_itemInteraction?.ExamineSelectedOrEnterMode(guid);
|
||||
}
|
||||
|
||||
/// <summary>Open a container (side bag or main pack): it becomes both the selected item and the
|
||||
/// open container. Sends Use to open a side bag server-side (ViewContents arrives async).
|
||||
/// Owned packs are not ClientUISystem::groundObject and never send
|
||||
|
|
@ -917,6 +931,9 @@ public sealed class InventoryController : IItemListDragHandler, IRetainedPanelCo
|
|||
_objects.ObjectUpdated -= OnObjectChanged;
|
||||
_objects.Cleared -= OnObjectsCleared;
|
||||
_selection.Changed -= OnSelectionChanged;
|
||||
if (_contentsGrid is not null) _contentsGrid.ExamineItemRequested = null;
|
||||
if (_containerList is not null) _containerList.ExamineItemRequested = null;
|
||||
if (_topContainer is not null) _topContainer.ExamineItemRequested = null;
|
||||
if (_itemInteraction is not null)
|
||||
{
|
||||
_itemInteraction.StateChanged -= OnInteractionStateChanged;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue