Generic fallback widget for every LayoutDesc element type without a dedicated behavioral widget (chrome corners/edges, drag bars, resize grips). Holds an ElementInfo + active-state name; draws that state's media by tiling (UV-repeat on both S+T axes, matching ImgTex::TileCSI). DrawMode constants documented per format spec §6 (Undefined=0, Normal=1, Overlay=2, Alphablend=3 — no Stretch mode). Plan 1: all modes render as the same alpha-blended tiled quad; per-mode branches deferred to Plan 2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
624 B
C#
17 lines
624 B
C#
using AcDream.App.UI.Layout;
|
|
namespace AcDream.App.Tests.UI.Layout;
|
|
|
|
public class UiDatElementTests
|
|
{
|
|
[Fact]
|
|
public void ActiveMedia_PrefersNamedStateOverDirect()
|
|
{
|
|
var info = new ElementInfo();
|
|
info.StateMedia[""] = (0x06000001, 1); // DirectState (DrawMode Normal=1)
|
|
info.StateMedia["ShowDetail"] = (0x06000002, 3); // named (Alphablend=3)
|
|
var e = new UiDatElement(info, _ => (0, 0, 0)) { ActiveState = "ShowDetail" };
|
|
Assert.Equal(0x06000002u, e.ActiveMedia().File);
|
|
e.ActiveState = "";
|
|
Assert.Equal(0x06000001u, e.ActiveMedia().File);
|
|
}
|
|
}
|