fix #212: preserve shortcut tint in physical combat
Port the retail m_bShortcutGhosted meaning instead of treating SetShortcutNum's boolean as peace versus war. Keep occupied shortcut numbers on the gold sheet in NonCombat, Melee, and Missile, reserve the gray sheet for Magic, and lock the four-mode matrix with conformance tests and corrected research. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
ab98cda26b
commit
5090aa7217
9 changed files with 197 additions and 112 deletions
|
|
@ -403,11 +403,11 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
return;
|
||||
}
|
||||
|
||||
var (peace, war, empty) = LoadToolbarDigits();
|
||||
var (regular, ghosted, empty) = LoadToolbarDigits();
|
||||
ToolbarRuntimeBindings b = _bindings.Toolbar;
|
||||
ToolbarController = Layout.ToolbarController.Bind(
|
||||
layout, b.Objects, b.Shortcuts, b.ResolveIcon, b.UseItem, b.Combat,
|
||||
peace, war, empty, b.ItemInteraction, b.SendAddShortcut, b.SendRemoveShortcut,
|
||||
regular, ghosted, empty, b.ItemInteraction, b.SendAddShortcut, b.SendRemoveShortcut,
|
||||
toggleCombat: b.ToggleCombat,
|
||||
selectItem: guid => b.Selection.Select(guid, SelectionChangeSource.Toolbar),
|
||||
selectedObjectId: () => b.Selection.SelectedObjectId ?? 0u,
|
||||
|
|
@ -586,9 +586,9 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
Console.WriteLine("[D.6] retail jump bar from gmFloatyPowerBarUI LayoutDesc 0x21000072.");
|
||||
}
|
||||
|
||||
private (uint[] Peace, uint[] War, uint[]? Empty) LoadToolbarDigits()
|
||||
private (uint[] Regular, uint[] Ghosted, uint[]? Empty) LoadToolbarDigits()
|
||||
{
|
||||
uint[]? peace = null, war = null, empty = null;
|
||||
uint[]? regular = null, ghosted = null, empty = null;
|
||||
lock (_bindings.Assets.DatLock)
|
||||
{
|
||||
var layout = _bindings.Assets.Dats.Get<DatReaderWriter.DBObjs.LayoutDesc>(0x21000037u);
|
||||
|
|
@ -597,8 +597,8 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
&& composite.Children.TryGetValue(0x1000034Au, out var number)
|
||||
&& number.StateDesc?.Properties is { } props)
|
||||
{
|
||||
peace = ReadDataIds(props, 0x10000042u);
|
||||
war = ReadDataIds(props, 0x10000043u);
|
||||
regular = ReadDataIds(props, 0x10000042u);
|
||||
ghosted = ReadDataIds(props, 0x10000043u);
|
||||
}
|
||||
if (layout is not null
|
||||
&& layout.Elements.TryGetValue(0x10000341u, out var emptyComposite)
|
||||
|
|
@ -607,18 +607,18 @@ public sealed class RetailUiRuntime : IDisposable
|
|||
empty = ReadDataIds(emptyProps, 0x1000005Eu);
|
||||
}
|
||||
|
||||
peace ??=
|
||||
regular ??=
|
||||
[
|
||||
0x0600109Eu, 0x0600109Fu, 0x060010A0u, 0x060010A1u, 0x060010A2u,
|
||||
0x060010A3u, 0x060010A4u, 0x060010A5u, 0x060010A6u,
|
||||
];
|
||||
war ??=
|
||||
ghosted ??=
|
||||
[
|
||||
0x06001ACCu, 0x06001ACDu, 0x06001ACEu, 0x06001ACFu, 0x06001AD0u,
|
||||
0x06001AD1u, 0x06001AD2u, 0x06001AD3u, 0x06001AD4u,
|
||||
];
|
||||
Console.WriteLine($"[D.5.1] toolbar digit arrays ready: peace={peace.Length}, war={war.Length}, empty={empty?.Length ?? 0} entries.");
|
||||
return (peace, war, empty);
|
||||
Console.WriteLine($"[D.5.1] toolbar digit arrays ready: regular={regular.Length}, ghosted={ghosted.Length}, empty={empty?.Length ?? 0} entries.");
|
||||
return (regular, ghosted, empty);
|
||||
}
|
||||
|
||||
private static uint[]? ReadDataIds(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue