fix(ui): complete retail indicator detail panels
Port the authored effect row template, remaining-time and selection details, synchronize the full gmPanelUI child geometry, and route the burden indicator to Character Information panel 3. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
a96767ba6d
commit
d1d603105f
24 changed files with 3696 additions and 147 deletions
|
|
@ -6,12 +6,37 @@ namespace AcDream.App.Tests.UI.Layout;
|
|||
|
||||
/// <summary>
|
||||
/// Unit tests for <see cref="CharacterController"/> and <see cref="SampleData.SampleCharacter"/>.
|
||||
/// The controller CREATES the m_pMainText report element (0x1000011d) at bind time — retail's
|
||||
/// gm*UI builds it at runtime; it is not a static dat element — and attaches it to the layout root.
|
||||
/// No dats, no GL — pure data-wiring + report-content tests.
|
||||
/// Production Character Information data authors m_pMainText (0x1000011d);
|
||||
/// reduced unit-test layouts exercise the controller's fallback element.
|
||||
/// No GL — pure data-wiring + report-content tests.
|
||||
/// </summary>
|
||||
public class CharacterControllerTests
|
||||
{
|
||||
[Fact]
|
||||
public void AuthoredCharacterInformationPanel_BindsTextScrollbarAndClose()
|
||||
{
|
||||
ImportedLayout layout = FixtureLoader.LoadCharacterInformation();
|
||||
int closes = 0;
|
||||
|
||||
CharacterController.Bind(
|
||||
layout, SampleData.SampleCharacter, close: () => closes++);
|
||||
|
||||
Assert.Equal(CharacterController.RootId, layout.Root.DatElementId);
|
||||
Assert.Equal((300f, 362f), (layout.Root.Width, layout.Root.Height));
|
||||
UiText text = Assert.IsType<UiText>(
|
||||
layout.FindElement(CharacterController.MainTextId));
|
||||
UiScrollbar scrollbar = Assert.IsType<UiScrollbar>(
|
||||
layout.FindElement(CharacterController.ScrollbarId));
|
||||
Assert.Same(text.Scroll, scrollbar.Model);
|
||||
Assert.False(text.PreserveEndOnLayout);
|
||||
Assert.Contains("Studio Player", text.LinesProvider().Select(line => line.Text));
|
||||
|
||||
UiButton close = Assert.IsType<UiButton>(
|
||||
layout.FindElement(CharacterController.CloseId));
|
||||
close.OnEvent(new UiEvent(0, close, UiEventType.Click));
|
||||
Assert.Equal(1, closes);
|
||||
}
|
||||
|
||||
/// <summary>Bind on an empty layout, then return the created m_pMainText element.</summary>
|
||||
private static UiText BindAndGetText(System.Func<CharacterSheet> data)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue