acdream/tests/AcDream.App.Tests/UI/Layout/CombatLayoutConformanceTests.cs
Erik 5276a83087 fix(combat): match retail live attack feedback
Keep AttackDone control statuses out of chat, preserve dead motion across zero-velocity position updates, render the authored power meter from right to left, and retain the rotatable viewer offset during target tracking.

Co-Authored-By: Codex <codex@openai.com>
2026-07-11 21:10:01 +02:00

44 lines
1.7 KiB
C#

using AcDream.App.UI;
using AcDream.App.UI.Layout;
namespace AcDream.App.Tests.UI.Layout;
public sealed class CombatLayoutConformanceTests
{
[Theory]
[InlineData("ID_CombatPanelOption_AutoRepeatAttack", 0x0718F89Bu)]
[InlineData("ID_CombatPanelOption_AutoTarget", 0x0FB7B944u)]
[InlineData("ID_CombatPanelOption_ViewCombatTarget", 0x0936C254u)]
public void RetailStringHash_MatchesNamedDecompGolden(string value, uint expected)
=> Assert.Equal(expected, DatStringResolver.ComputeHash(value));
[Fact]
public void RetailFixture_UsesAuthoredScrollbarRolesAndCheckboxWidgets()
{
ElementInfo info = FixtureLoader.LoadCombatInfos();
ImportedLayout layout = LayoutImporter.Build(
info,
_ => (0u, 0, 0),
datFont: null,
stringResolve: _ => "localized");
var power = Assert.IsType<UiScrollbar>(
layout.FindElement(CombatUiController.PowerControlId));
Assert.Equal(0x060074CAu, power.TrackSprite);
Assert.Equal(0x06001923u, power.ThumbSprite);
Assert.Equal(0x06001200u, power.ScalarFillSprite);
Assert.True(power.ScalarFillFromRight);
var repeat = Assert.IsType<UiButton>(
layout.FindElement(CombatUiController.RepeatAttacksId));
Assert.Equal(13f, repeat.FaceWidth);
Assert.Equal(13f, repeat.FaceHeight);
Assert.Equal(17f, repeat.LabelOffsetX);
Assert.True(repeat.ToggleBehavior);
var high = Assert.IsType<UiButton>(
layout.FindElement(CombatUiController.HighButtonId));
Assert.Equal("localized", high.Label);
Assert.IsType<UiText>(layout.FindElement(CombatUiController.SpeedLabelId));
}
}