feat(items): port retail external-container looting

Add the ClientUISystem ground-object lifecycle, authoritative root and nested ViewContents projections, replacement and close semantics, and the DAT-authored gmExternalContainerUI strip for chests and corpses.

Route double-click loot and full or partial drag transfers through the shared retail item policy without optimistic external ownership. Remove the incorrect NoLongerViewingContents behavior from owned side packs and retire AP-106/#196.

Release build succeeds and all 5,875 tests pass with five intentional skips.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-17 16:18:10 +02:00
parent 48a118db91
commit 20ce67b625
27 changed files with 1750 additions and 45 deletions

View file

@ -114,4 +114,36 @@ public class UiItemListTests
list.ScrollItemIntoView(0);
Assert.Equal(0, list.Scroll.ScrollY);
}
[Fact]
public void HorizontalScroll_UsesPixelOffsetAndKeepsPartialEdgeCells()
{
var list = new UiItemList
{
Width = 80f,
Height = 32f,
CellWidth = 32f,
CellHeight = 32f,
SingleRow = true,
HorizontalScroll = true,
};
list.Flush();
for (int i = 0; i < 4; i++) list.AddItem(new UiItemSlot());
list.Scroll.SetScrollY(17);
list.LayoutCells();
Assert.Equal(128, list.Scroll.ContentHeight);
Assert.Equal(80, list.Scroll.ViewHeight);
Assert.Equal(-17f, list.GetItem(0)!.Left);
Assert.True(list.GetItem(0)!.Visible);
Assert.True(list.GetItem(3)!.Visible);
Assert.False(list.GetItem(2) is null);
list.ScrollItemIntoView(3);
Assert.Equal(48, list.Scroll.ScrollY);
list.LayoutCells();
Assert.Equal(48f, list.GetItem(3)!.Left);
Assert.Equal(80f, list.GetItem(3)!.Left + list.GetItem(3)!.Width);
}
}