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
|
|
@ -57,6 +57,7 @@ public sealed class ExternalContainerControllerTests
|
|||
public readonly List<uint> Uses = new();
|
||||
public readonly List<uint> NoLonger = new();
|
||||
public readonly List<uint> Pickups = new();
|
||||
public readonly List<uint> Examines = new();
|
||||
public readonly List<(uint Item, uint Container, int Placement)> Puts = new();
|
||||
public readonly List<(uint Item, uint Container, uint Placement, uint Amount)> Splits = new();
|
||||
public readonly UiRoot Screen = new() { Width = 800f, Height = 600f };
|
||||
|
|
@ -110,6 +111,7 @@ public sealed class ExternalContainerControllerTests
|
|||
sendUseWithTarget: null,
|
||||
sendWield: null,
|
||||
sendDrop: null,
|
||||
sendExamine: Examines.Add,
|
||||
groundObjectId: () => State.CurrentContainerId,
|
||||
placeInBackpack: (item, _, _) => Pickups.Add(item),
|
||||
sendPutItemInContainer: (item, container, placement) =>
|
||||
|
|
@ -183,6 +185,20 @@ public sealed class ExternalContainerControllerTests
|
|||
Assert.Equal(new uint[] { Item }, h.Pickups);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RightClickLoot_selectsAndExaminesWithoutPickingUp()
|
||||
{
|
||||
using var h = new Harness();
|
||||
h.Open(Chest, new ContainerContentEntry(Item, 0u));
|
||||
|
||||
UiItemSlot cell = h.Contents.GetItem(0)!;
|
||||
cell.OnEvent(new UiEvent(0u, cell, UiEventType.RightClick));
|
||||
|
||||
Assert.Equal(Item, h.Selection.SelectedObjectId);
|
||||
Assert.Equal(new uint[] { Item }, h.Examines);
|
||||
Assert.Empty(h.Pickups);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CloseAndRangeExit_SendUseOnceWithoutNoLongerViewing()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue