fix(combat): restore retail combat bar controls
Resolve authored StringInfo labels from local.dat, port gmCombatUI's runtime option captions and checkbox widgets, and bind horizontal scrollbar media by retail structural roles so the green power jewel is a thumb instead of a tiled track. Persist the three combat options and make Auto Target govern target acquisition. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
2215c76c7e
commit
927fa7881a
19 changed files with 24591 additions and 48 deletions
|
|
@ -0,0 +1,43 @@
|
|||
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);
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue