fix #213: complete suicide and framerate presentation
Translate suicide response 0x004A as retail's successful self-kill notice. Port /framerate onto the authored SmartBox FPS element with live two-decimal FPS and DEG values, keep diagnostic window chrome independent, and synchronize command-driven settings without discarding panel drafts. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
9ea579bdd0
commit
43f7c7807c
17 changed files with 729 additions and 39 deletions
|
|
@ -17,17 +17,14 @@ public sealed class DisplaySettingsTests
|
|||
// · Resolution matches WindowOptions (1280×720 in GameWindow.Run)
|
||||
// · FieldOfView matches camera FovY (60° = π/3)
|
||||
// · VSync matches WindowOptions (false during dev)
|
||||
// · ShowFps true preserves the perf string in the title bar
|
||||
// Net effect: opening Display + Save with no edits is a visual
|
||||
// no-op (no window resize, no camera FovY change, no title
|
||||
// bar change).
|
||||
// · ShowFps false matches retail's initially-hidden SmartBox meter
|
||||
var d = DisplaySettings.Default;
|
||||
Assert.Equal("1280x720", d.Resolution);
|
||||
Assert.False(d.Fullscreen);
|
||||
Assert.False(d.VSync);
|
||||
Assert.Equal(60f, d.FieldOfView);
|
||||
Assert.Equal(1.0f, d.Gamma);
|
||||
Assert.True(d.ShowFps);
|
||||
Assert.False(d.ShowFps);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -65,7 +62,7 @@ public sealed class DisplaySettingsTests
|
|||
// Other fields untouched.
|
||||
Assert.Equal("1280x720", d.Resolution);
|
||||
Assert.False(d.VSync);
|
||||
Assert.True(d.ShowFps);
|
||||
Assert.False(d.ShowFps);
|
||||
}
|
||||
|
||||
private static int ParseWidth(string res)
|
||||
|
|
|
|||
|
|
@ -271,12 +271,31 @@ public sealed class SettingsVMTests
|
|||
public void SetDisplay_marks_unsaved_changes()
|
||||
{
|
||||
var (vm, _, _, _, _, _, _, _, _, _) = Build();
|
||||
// Default ShowFps is true → flip to false to ensure the with-
|
||||
// Default ShowFps is false → flip to true to ensure the with-
|
||||
// expression actually mutates a field.
|
||||
vm.SetDisplay(vm.DisplayDraft with { ShowFps = false });
|
||||
vm.SetDisplay(vm.DisplayDraft with { ShowFps = true });
|
||||
Assert.True(vm.HasUnsavedChanges);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ApplyExternalDisplayChange_updates_both_snapshots_and_preserves_other_drafts()
|
||||
{
|
||||
var (vm, _, _, _, _, _, _, _, _, _) = Build();
|
||||
|
||||
vm.SetDisplay(vm.DisplayDraft with { FieldOfView = 90f });
|
||||
Assert.True(vm.HasUnsavedChanges);
|
||||
|
||||
vm.ApplyExternalDisplayChange(display => display with { ShowFps = true });
|
||||
|
||||
Assert.True(vm.DisplayDraft.ShowFps);
|
||||
Assert.Equal(90f, vm.DisplayDraft.FieldOfView);
|
||||
Assert.True(vm.HasUnsavedChanges);
|
||||
|
||||
vm.Cancel();
|
||||
Assert.True(vm.DisplayDraft.ShowFps);
|
||||
Assert.Equal(DisplaySettings.Default.FieldOfView, vm.DisplayDraft.FieldOfView);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Save_invokes_display_callback_with_draft()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue