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:
parent
4eae9b4f5a
commit
fec0d94148
24 changed files with 2379 additions and 599 deletions
|
|
@ -434,6 +434,44 @@ public sealed class SettingsVMTests
|
|||
Assert.True(vm.HasUnsavedChanges);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ApplyExternalGameplayChange_updates_both_snapshots_and_preserves_other_drafts()
|
||||
{
|
||||
var (vm, _, _, _, _, _, _, _, _, _) = Build();
|
||||
bool persistedAutoTarget = !GameplaySettings.Default.AutoTarget;
|
||||
|
||||
vm.SetGameplay(vm.GameplayDraft with
|
||||
{
|
||||
ShowTooltips = !GameplaySettings.Default.ShowTooltips,
|
||||
CoordinatesOnRadar = !GameplaySettings.Default.CoordinatesOnRadar,
|
||||
});
|
||||
|
||||
vm.ApplyExternalGameplayChange(gameplay => gameplay with
|
||||
{
|
||||
AutoTarget = persistedAutoTarget,
|
||||
});
|
||||
|
||||
Assert.Equal(persistedAutoTarget, vm.GameplayDraft.AutoTarget);
|
||||
Assert.Equal(
|
||||
!GameplaySettings.Default.ShowTooltips,
|
||||
vm.GameplayDraft.ShowTooltips);
|
||||
Assert.Equal(
|
||||
!GameplaySettings.Default.CoordinatesOnRadar,
|
||||
vm.GameplayDraft.CoordinatesOnRadar);
|
||||
Assert.True(vm.HasUnsavedChanges);
|
||||
|
||||
vm.Cancel();
|
||||
|
||||
Assert.Equal(persistedAutoTarget, vm.GameplayDraft.AutoTarget);
|
||||
Assert.Equal(
|
||||
GameplaySettings.Default.ShowTooltips,
|
||||
vm.GameplayDraft.ShowTooltips);
|
||||
Assert.Equal(
|
||||
GameplaySettings.Default.CoordinatesOnRadar,
|
||||
vm.GameplayDraft.CoordinatesOnRadar);
|
||||
Assert.False(vm.HasUnsavedChanges);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Save_invokes_gameplay_callback_with_draft()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue