Create AGENTS.md as a thin bridge to CLAUDE.md, fix isolated dat-layout previews by normalizing panel roots to the studio canvas, add a --mockup mode that mounts production-backed UI windows into one UiHost, and thread the per-element dat-font resolver through GameWindow's live imports. Verified with dotnet test and headless studio screenshots for inventory and the mockup desktop.
39 lines
1,022 B
C#
39 lines
1,022 B
C#
using AcDream.App.Studio;
|
|
using AcDream.App.UI;
|
|
|
|
namespace AcDream.App.Tests.Studio;
|
|
|
|
public class StudioWindowTests
|
|
{
|
|
[Fact]
|
|
public void ParseMockup_doesNotDefaultToSinglePanelLayout()
|
|
{
|
|
var opts = StudioOptions.Parse(new[] { @"C:\fake-dats", "--mockup" });
|
|
|
|
Assert.True(opts.Mockup);
|
|
Assert.Null(opts.LayoutId);
|
|
Assert.Null(opts.DumpSlug);
|
|
Assert.Null(opts.MarkupPath);
|
|
}
|
|
|
|
[Fact]
|
|
public void NormalizeSinglePanelRoot_movesDatPanelToCanvasOrigin()
|
|
{
|
|
var root = new UiPanel
|
|
{
|
|
Left = 500f,
|
|
Top = 138f,
|
|
Width = 300f,
|
|
Height = 362f,
|
|
Anchors = AnchorEdges.Left | AnchorEdges.Top | AnchorEdges.Right,
|
|
};
|
|
|
|
StudioWindow.NormalizeSinglePanelRoot(root);
|
|
|
|
Assert.Equal(0f, root.Left);
|
|
Assert.Equal(0f, root.Top);
|
|
Assert.Equal(300f, root.Width);
|
|
Assert.Equal(362f, root.Height);
|
|
Assert.Equal(AnchorEdges.None, root.Anchors);
|
|
}
|
|
}
|