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
|
|
@ -275,6 +275,35 @@ public class DragDropSpineTests
|
|||
Assert.True(used);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RightClick_withoutDrag_requestsItemListAppraisal()
|
||||
{
|
||||
var (root, list, _) = RootWithBoundSlot(0x5001u);
|
||||
var examined = new List<uint>();
|
||||
list.ExamineItemRequested = examined.Add;
|
||||
|
||||
root.OnMouseDown(UiMouseButton.Right, 10, 10);
|
||||
root.OnMouseUp(UiMouseButton.Right, 10, 10);
|
||||
|
||||
Assert.Equal(new uint[] { 0x5001u }, examined);
|
||||
Assert.Null(root.DragSource);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RightButtonMovement_cancelsAppraisal_andNeverStartsItemDrag()
|
||||
{
|
||||
var (root, list, _) = RootWithBoundSlot(0x5001u);
|
||||
var examined = new List<uint>();
|
||||
list.ExamineItemRequested = examined.Add;
|
||||
|
||||
root.OnMouseDown(UiMouseButton.Right, 10, 10);
|
||||
root.OnMouseMove(14, 10);
|
||||
root.OnMouseUp(UiMouseButton.Right, 14, 10);
|
||||
|
||||
Assert.Empty(examined);
|
||||
Assert.Null(root.DragSource);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CompletedDrag_doesNotFireUse()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue