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
|
|
@ -47,6 +47,7 @@ public class PaperdollControllerTests
|
|||
IReadOnlyDictionary<uint, uint>? emptySlotSprites = null,
|
||||
List<(uint item, uint container, int placement)>? puts = null,
|
||||
List<string>? systemMessages = null,
|
||||
List<uint>? examines = null,
|
||||
Action<ItemInteractionController>? configureInteraction = null)
|
||||
{
|
||||
var itemInteraction = new ItemInteractionController(
|
||||
|
|
@ -56,6 +57,7 @@ public class PaperdollControllerTests
|
|||
sendUseWithTarget: null,
|
||||
sendWield: wields is null ? null : (i, m) => wields.Add((i, m)),
|
||||
sendDrop: null,
|
||||
sendExamine: examines is null ? null : examines.Add,
|
||||
sendPutItemInContainer: puts is null
|
||||
? null
|
||||
: (item, container, placement) => puts.Add((item, container, placement)),
|
||||
|
|
@ -116,6 +118,28 @@ public class PaperdollControllerTests
|
|||
Assert.Equal(0u, lists[ShieldSlot].Cell.ItemId); // shield slot empty
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RightClickEquippedSlot_selectsAndExaminesItem()
|
||||
{
|
||||
var (layout, lists) = BuildLayout();
|
||||
var objects = new ClientObjectTable();
|
||||
SeedEquipped(objects, 0xA01u, EquipMask.HeadWear);
|
||||
var selection = new SelectionState();
|
||||
var appraisals = new List<uint>();
|
||||
Bind(
|
||||
layout,
|
||||
objects,
|
||||
selection: selection,
|
||||
examines: appraisals);
|
||||
|
||||
UiItemSlot cell = lists[HeadSlot].Cell;
|
||||
cell.OnEvent(new UiEvent(0u, cell, UiEventType.RightClick));
|
||||
|
||||
Assert.Equal(0xA01u, selection.SelectedObjectId);
|
||||
Assert.True(cell.Selected);
|
||||
Assert.Equal(new uint[] { 0xA01u }, appraisals);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SessionTableClearRemovesOldEquipmentAndLocksAetheriaSlots()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue