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
|
|
@ -105,7 +105,7 @@ public static class DatWidgetFactory
|
|||
// propagation) because nothing ever activates it.
|
||||
5 => new UiTemplateListBox(info, resolve, info.TemplateList, info.ScrollbarElementId),
|
||||
6 => new UiMenu(), // UIElement_Menu (reg :120163)
|
||||
7 => BuildMeter(info, resolve, elementFont), // UIElement_Meter
|
||||
7 => BuildMeter(info, resolve, elementFont, stringResolve), // UIElement_Meter
|
||||
// UIElement_Panel (Type 8) — retail's tab-strip host (dat property 0x2E;
|
||||
// research doc §1.3/§10.1). OP2 rework (docs/research/2026-08-11-op2-
|
||||
// review-mechanism.md MUST-FIX 5): Type 8 is UIElement_Panel, NOT a class
|
||||
|
|
@ -443,7 +443,8 @@ public static class DatWidgetFactory
|
|||
/// </para>
|
||||
/// </summary>
|
||||
private static UiMeter BuildMeter(ElementInfo info,
|
||||
Func<uint, (uint, int, int)> resolve, UiDatFont? datFont)
|
||||
Func<uint, (uint, int, int)> resolve, UiDatFont? datFont,
|
||||
Func<UiStringInfoValue, string?>? stringResolve = null)
|
||||
{
|
||||
var m = new UiMeter
|
||||
{
|
||||
|
|
@ -534,6 +535,26 @@ public static class DatWidgetFactory
|
|||
m.ConfigureStateFill(stateId, media.File);
|
||||
}
|
||||
}
|
||||
|
||||
// The absorbed Type-12 caption child (gmPowerbarUI's 0x10000035)
|
||||
// authors the per-mode caption on its own states — JumpMode
|
||||
// 'Height', MeleeMode 'Power', MissileMode 'Accuracy' (HJustify
|
||||
// Center over the full bar, matching UiMeter's centered label
|
||||
// draw). Retail shows it through the meter's PassToChildren state
|
||||
// cascade; the absorbed equivalent is a state-label table
|
||||
// consulted by TrySetRetailState.
|
||||
foreach (ElementInfo textChild in info.Children.Where(static c => c.Type == 12))
|
||||
{
|
||||
foreach (var (stateId, state) in textChild.States)
|
||||
{
|
||||
if (stateId == UiStateInfo.DirectStateId
|
||||
|| !state.Properties.Values.TryGetValue(0x17u, out var caption)
|
||||
|| caption.Kind != UiPropertyKind.StringInfo)
|
||||
continue;
|
||||
if (stringResolve?.Invoke(caption.StringInfoValue) is { Length: > 0 } text)
|
||||
m.ConfigureStateLabel(stateId, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue