fix: powerbar mode captions - jump 'Height' + combat 'Power'/'Accuracy'
Retail authors ONE caption element per bar with per-mode state strings, switched by a PassToChildren state cascade (gmPowerbarUI:: RecvNotice_BeginPowerbar @0x004DA730 sets 0x10000042 Jump / 0x10000043 Melee / 0x10000044 Missile / 0x10000045 DDD; installed-DAT probe confirmed every string + PassToChildren flag). - Jump bar (user gate): the floaty powerbar's caption child (0x10000035: JumpMode 'Height', authored HJustify=Center over the bar) was dropped by UiMeter's child absorption. The stateful-fill meter build now absorbs it into per-state labels; TrySetRetailState latches the caption and OnDraw shows it when no live Label provider is bound. JumpPowerbarController's existing JumpMode flip now surfaces 'Height' with zero controller changes. The mount gained the string resolver the Build call never passed. - Combat bar (user gate): label 0x10000052 authors 'MeleeCombat' -> 'Power' and 'MissileCombat' -> 'Accuracy'; the controller latched the MELEE string once at bind. CombatUiLabels now resolves both authored strings and OnCombatModeChanged sets the mode's string - switching live when swapping melee <-> missile weapons in combat. Also fixed the mode-state flip target: the states live on the BASIC PANEL (0x1000005C, PassToChildren), not the layout root (Hide/ShowDetail only) - the old _root flip was a silent no-op. New env-gated ACDREAM_PROBE_POWERBAR layout probe (kept, house pattern). App suite 4,987/3 skips. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
4943484eb9
commit
adf8335675
7 changed files with 233 additions and 14 deletions
|
|
@ -730,6 +730,43 @@ public class DatWidgetFactoryTests
|
|||
Assert.Equal("six", lines[1].Text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 2026-08-14 gate: the stateful-fill meter (gmPowerbarUI's shape in
|
||||
/// LayoutDesc 0x21000072) also absorbs its Type-12 caption child
|
||||
/// (0x10000035, per-mode strings 'Height'/'Power'/'Accuracy') into
|
||||
/// per-state labels latched by TrySetRetailState — the absorbed
|
||||
/// equivalent of retail's PassToChildren state cascade.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BuildMeter_StatefulFill_AbsorbsCaptionChildPerStateStrings()
|
||||
{
|
||||
var meter = new ElementInfo { Id = 0x34, Type = 7, Width = 600, Height = 15 };
|
||||
meter.StateMedia[""] = (0x06004D0Bu, 1);
|
||||
|
||||
var fill = new ElementInfo { Id = 2, Type = 3, Width = 600, Height = 15 };
|
||||
fill.States[0x10000042u] = new UiStateInfo { Id = 0x10000042u, Name = "JumpMode" };
|
||||
fill.StateMedia["JumpMode"] = (0x06001354u, 1);
|
||||
meter.Children.Add(fill);
|
||||
|
||||
var caption = new ElementInfo { Id = 0x35, Type = 12, Width = 600, Height = 15 };
|
||||
var jumpText = new UiStateInfo { Id = 0x10000042u, Name = "JumpMode" };
|
||||
jumpText.Properties.Values[0x17u] = new UiPropertyValue
|
||||
{
|
||||
Kind = UiPropertyKind.StringInfo,
|
||||
StringInfoValue = new UiStringInfoValue(0, 1, 2, 0, 1, 0),
|
||||
};
|
||||
caption.States[0x10000042u] = jumpText;
|
||||
meter.Children.Add(caption);
|
||||
|
||||
var m = Assert.IsType<UiMeter>(DatWidgetFactory.Create(
|
||||
meter, NoTex, null, stringResolve: _ => "Height"));
|
||||
|
||||
Assert.Null(m.ActiveStateLabel);
|
||||
Assert.True(m.TrySetRetailState(0x10000042u));
|
||||
Assert.Equal("Height", m.ActiveStateLabel);
|
||||
Assert.Equal(0x06001354u, m.FrontTile);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HorizontalScrollbar_PreservesNestedCombatMeterFillSprite()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue