refactor(settings): own two-phase runtime settings

Move pre-window loading, startup application, live settings mutation, toon context, quality reapply, and SettingsVM loans behind one RuntimeSettingsController. Preserve retail command behavior, ordered target publication, draft semantics, and retryable failure convergence while removing duplicate GameWindow state and feature bodies.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-22 13:30:22 +02:00
parent 4eae9b4f5a
commit fec0d94148
24 changed files with 2379 additions and 599 deletions

View file

@ -189,6 +189,21 @@ public sealed class SettingsVM
_gameplayDraft = value ?? throw new ArgumentNullException(nameof(value));
}
/// <summary>
/// Apply one externally persisted gameplay-option change to both snapshots.
/// Existing unsaved edits to unrelated fields remain drafts rather than
/// being accidentally promoted to persisted state.
/// </summary>
public void ApplyExternalGameplayChange(
Func<GameplaySettings, GameplaySettings> update)
{
ArgumentNullException.ThrowIfNull(update);
_gameplayPersisted = update(_gameplayPersisted)
?? throw new InvalidOperationException("Gameplay update returned null.");
_gameplayDraft = update(_gameplayDraft)
?? throw new InvalidOperationException("Gameplay update returned null.");
}
/// <summary>
/// Replace the entire Chat draft with <paramref name="value"/>.
/// Local-only this phase — values persist on Save but the Hear*Chat