fix(ui): select items before drag mesh
Port ItemList_BeginDrag's select-before-waiting order so a direct press-drag shows the selection indicator on its first frame across inventory, paperdoll, and toolbar item lists. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
64a056e656
commit
609ed8bfc2
10 changed files with 71 additions and 14 deletions
|
|
@ -772,13 +772,17 @@ public class InventoryControllerTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void OnDragLift_isNoOp_itemStaysUntilServerConfirms()
|
||||
public void OnDragLift_selectsItem_butKeepsItUntilServerConfirms()
|
||||
{
|
||||
var (layout, grid, _, _, _, _, _, _) = BuildLayout();
|
||||
var objects = new ClientObjectTable();
|
||||
SeedContained(objects, 0xA, Player, slot: 0);
|
||||
var ctrl = (IItemListDragHandler)Bind(layout, objects);
|
||||
var selection = new SelectionState();
|
||||
var ctrl = (IItemListDragHandler)Bind(layout, objects, selection: selection);
|
||||
((IItemListDragHandler)ctrl).OnDragLift(grid, grid.GetItem(0)!, Payload(0xAu));
|
||||
|
||||
Assert.Equal(0xAu, selection.SelectedObjectId);
|
||||
Assert.True(grid.GetItem(0)!.Selected);
|
||||
Assert.Equal(Player, objects.Get(0xAu)!.ContainerId); // NOT removed on lift (unlike the toolbar)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue