acdream/src/AcDream.UI.Abstractions/Panels/Settings/CameraTurningSettings.cs
Erik 9d26ecc623 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>
2026-08-11 02:14:40 +02:00

52 lines
2.3 KiB
C#

namespace AcDream.UI.Abstractions.Panels.Settings;
/// <summary>
/// The five CLIENT-LOCAL preferences retail's "Use Mouse Turning Settings"
/// Gameplay-tab button (<c>gmConfigUI::SetMouseTurningDefaults @0x0049E8F0</c>)
/// writes alongside the one server-synced bit
/// (<c>PlayerOption.UseMouseTurning</c>, carried through
/// <c>RuntimeCharacterOptionsState</c> / <c>SetSingleCharacterOption (0x0005)</c>
/// — NOT stored here). Persisted to <c>settings.json</c> the same way
/// <see cref="AudioSettings"/>/<see cref="DisplaySettings"/> are; this is the
/// forward-compatible home Campaign OP slice OP6's full Config tab (27 rows)
/// re-homes into its own preference groups without a storage-shape change —
/// these five keys ARE four of that tab's Camera/Input rows
/// (<c>Camera_Stiffness</c>, <c>Camera_AdjustmentSpeed</c>,
/// <c>Camera_AlignToSlope</c>, <c>Input_MouseLookSensitivity</c>,
/// <c>Input_InvertMouseLookYAxis</c> — research doc
/// <c>2026-08-10-options-panel-structure.md</c> §4).
/// </summary>
public sealed record CameraTurningSettings(
float Stiffness,
float AdjustmentSpeed,
float MouseLookSensitivity,
bool AlignToSlope,
bool InvertMouseLookYAxis)
{
/// <summary>
/// Retail's ORDINARY Config-tab defaults (NOT the mouse-turning macro's
/// targets — <c>gmConfigUI::InitOptions @0x0049E400</c>, research doc §4):
/// Stiffness 0.45 (<c>0x3EE66666</c>), AdjustmentSpeed 40.0
/// (<c>0x42200000</c>), MouseLookSensitivity 0.55 (<c>0x3F0CCCCD</c>),
/// AlignToSlope on, InvertMouseLookYAxis off.
/// </summary>
public static CameraTurningSettings Default { get; } = new(
Stiffness: 0.45f,
AdjustmentSpeed: 40.0f,
MouseLookSensitivity: 0.55f,
AlignToSlope: true,
InvertMouseLookYAxis: false);
/// <summary>
/// The mouse-turning macro's recommended targets
/// (<c>SetMouseTurningDefaults</c>, research doc §4.4): Stiffness 0.95,
/// AdjustmentSpeed 50.0, MouseLookSensitivity 0.7, AlignToSlope OFF,
/// InvertMouseLookYAxis ON.
/// </summary>
public static CameraTurningSettings MouseTurningTarget { get; } = new(
Stiffness: 0.95f,
AdjustmentSpeed: 50.0f,
MouseLookSensitivity: 0.7f,
AlignToSlope: false,
InvertMouseLookYAxis: true);
}