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
|
|
@ -38,7 +38,9 @@ public sealed record RadarRuntimeBindings(
|
|||
|
||||
public sealed record CombatRuntimeBindings(
|
||||
CombatState State,
|
||||
CombatAttackController Attacks);
|
||||
CombatAttackController Attacks,
|
||||
Func<GameplaySettings> Gameplay,
|
||||
Action<GameplaySettings> SetGameplay);
|
||||
|
||||
public sealed record ToolbarRuntimeBindings(
|
||||
ClientObjectTable Objects,
|
||||
|
|
@ -325,11 +327,13 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
lock (_bindings.Assets.DatLock)
|
||||
{
|
||||
info = LayoutImporter.ImportInfos(_bindings.Assets.Dats, ChatWindowController.LayoutId);
|
||||
var strings = new DatStringResolver(_bindings.Assets.Dats);
|
||||
layout = info is null ? null : LayoutImporter.Build(
|
||||
info,
|
||||
_bindings.Assets.ResolveSprite,
|
||||
_bindings.Assets.DefaultFont,
|
||||
_bindings.Assets.ResolveFont);
|
||||
_bindings.Assets.ResolveFont,
|
||||
strings.Resolve);
|
||||
}
|
||||
if (info is null || layout is null)
|
||||
{
|
||||
|
|
@ -449,8 +453,22 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
|
||||
private void MountCombat()
|
||||
{
|
||||
ImportedLayout? layout = Import(CombatUiController.LayoutId);
|
||||
if (layout is null)
|
||||
ElementInfo? info;
|
||||
ImportedLayout? layout;
|
||||
CombatUiLabels? labels;
|
||||
lock (_bindings.Assets.DatLock)
|
||||
{
|
||||
info = LayoutImporter.ImportInfos(_bindings.Assets.Dats, CombatUiController.LayoutId);
|
||||
var strings = new DatStringResolver(_bindings.Assets.Dats);
|
||||
layout = info is null ? null : LayoutImporter.Build(
|
||||
info,
|
||||
_bindings.Assets.ResolveSprite,
|
||||
_bindings.Assets.DefaultFont,
|
||||
_bindings.Assets.ResolveFont,
|
||||
strings.Resolve);
|
||||
labels = info is null ? null : CombatUiLabels.Resolve(info, strings);
|
||||
}
|
||||
if (layout is null || labels is null)
|
||||
{
|
||||
Console.WriteLine("[M2] combat: LayoutDesc 0x21000073 not found.");
|
||||
return;
|
||||
|
|
@ -460,6 +478,9 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
layout,
|
||||
_bindings.Combat.State,
|
||||
_bindings.Combat.Attacks,
|
||||
_bindings.Combat.Gameplay,
|
||||
_bindings.Combat.SetGameplay,
|
||||
labels,
|
||||
visible =>
|
||||
{
|
||||
if (visible) Host.ShowWindow(WindowNames.Combat);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue