feat(ui): Campaign OP slice OP3 — Options panel shell, open paths, Gameplay tab

Mounts retail's Options panel (LayoutDesc 0x2100002B resolved through host
0x2100006E slot 0x1000018D, gmPanelUI key 10) via the same catalog-import
pattern CharacterController already validates, registered through
RetailPanelUiController so it shares retail's "one active gmPanelUI child"
mutual exclusion with every other sibling panel for free. F11 and the
toolbar's options button (0x1000019B, already authoring panel id 10) both
now open it; the close button fires the same ToggleOptionsPanel action.

OptionPageModel (OptionPage/BoolOptionRow) ports retail's exact
Apply/Reset/Defaults/visibility semantics from
UIOption_Checkbox/PlayerOptionPage — LED clicks apply live immediately,
Apply commits every row unconditionally + flushes the batched blob, Reset
reverts only Changed rows, Defaults restores without committing, and
tab-switch/window-hide revert uncommitted edits. Wired for all four tabs;
this slice registers real rows on none of them (Gameplay authentically has
none — a pure button list). UiTabPanel gains an ActivePageChanged event so
the page model can hook every tab transition, including the initial
default-tab activation.

The seven Gameplay-tab buttons: Exit Game reuses the existing graceful
window-close path; Exit to Character Selection gets retail's confirmation
dialog and byte-verified mid-air refusal but still behaves as Exit Game
(AD-74 — no pre-world character-select flow exists); Configure Keyboard
and In-Game Help Files are inert this slice (AD-76 for Help — the
plugin retail depends on doesn't exist); Urgent Assistance/Report Abuse
short-circuit to their own byte-verified failure text through the
interface-text seam instead of ShellExecute against a dead URL (AD-75);
Use Mouse Turning Settings runs the pure MouseTurningSettingsMacro port,
persisting five new CameraTurningSettings preferences and sending
PlayerOption.UseMouseTurning — TS-74 records that acdream has no
persistent mouse-turning camera mode for the bit to drive yet.

Full Release suite: 12,918 passed / 4 skipped / 0 failed (baseline
12,871/4/0 — only new tests added).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-11 02:14:40 +02:00
parent 5242de9f15
commit 9d26ecc623
27 changed files with 25696 additions and 8 deletions

View file

@ -22,6 +22,10 @@ internal interface IRuntimeSettingsStorage
CharacterSettings LoadCharacter(string toonKey);
/// <summary>Campaign OP slice OP3: the five client-local preferences the
/// "Use Mouse Turning Settings" Gameplay-tab macro writes.</summary>
CameraTurningSettings LoadCameraTurning();
void SaveDisplay(DisplaySettings display);
void SaveAudio(AudioSettings audio);
@ -31,6 +35,8 @@ internal interface IRuntimeSettingsStorage
void SaveChat(ChatSettings chat);
void SaveCharacter(string toonKey, CharacterSettings character);
void SaveCameraTurning(CameraTurningSettings cameraTurning);
}
internal sealed class JsonRuntimeSettingsStorage : IRuntimeSettingsStorage
@ -59,6 +65,8 @@ internal sealed class JsonRuntimeSettingsStorage : IRuntimeSettingsStorage
public CharacterSettings LoadCharacter(string toonKey) =>
_store.LoadCharacter(toonKey);
public CameraTurningSettings LoadCameraTurning() => _store.LoadCameraTurning();
public void SaveDisplay(DisplaySettings display) => _store.SaveDisplay(display);
public void SaveAudio(AudioSettings audio) => _store.SaveAudio(audio);
@ -70,6 +78,9 @@ internal sealed class JsonRuntimeSettingsStorage : IRuntimeSettingsStorage
public void SaveCharacter(string toonKey, CharacterSettings character) =>
_store.SaveCharacter(toonKey, character);
public void SaveCameraTurning(CameraTurningSettings cameraTurning) =>
_store.SaveCameraTurning(cameraTurning);
}
internal sealed record RuntimeSettingsSnapshot(
@ -430,6 +441,33 @@ internal sealed class RuntimeSettingsController :
}
}
/// <summary>
/// Campaign OP slice OP3: the five client-local preferences the "Use
/// Mouse Turning Settings" Gameplay-tab macro reads/writes. Read
/// directly through storage (no startup-snapshot cache, unlike
/// <see cref="Display"/>/<see cref="Gameplay"/>/<see cref="Chat"/>) —
/// this section has no UI surface of its own yet (Campaign OP slice
/// OP6's Config tab), so there is nothing today that needs a cached,
/// change-notified copy.
/// </summary>
public CameraTurningSettings LoadCameraTurning() => _storage.LoadCameraTurning();
/// <summary>Persists the camera-turning preferences. Failures are logged,
/// not thrown — matching every other <c>Set*</c> save call in this
/// class.</summary>
public void SaveCameraTurning(CameraTurningSettings cameraTurning)
{
ArgumentNullException.ThrowIfNull(cameraTurning);
try
{
_storage.SaveCameraTurning(cameraTurning);
}
catch (Exception ex)
{
_log($"settings: camera-turning save failed: {ex.Message}");
}
}
public void SetActiveCharacter(string characterName)
{
ArgumentException.ThrowIfNullOrWhiteSpace(characterName);