acdream/src/AcDream.UI.Abstractions/Panels/Settings/DisplaySettings.cs
Erik 43f7c7807c 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>
2026-07-13 15:50:47 +02:00

51 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections.Generic;
using AcDream.UI.Abstractions.Settings;
namespace AcDream.UI.Abstractions.Panels.Settings;
/// <summary>
/// Display-related preferences persisted to <c>settings.json</c>.
/// Modern addition (no retail equivalent for FOV / vsync etc) — replaces
/// the various <c>ACDREAM_*</c> environment variables for resolution +
/// windowed mode with an in-game UI.
///
/// <para>
/// Records are immutable; mutation goes through
/// <see cref="SettingsVM.SetDisplay"/> which assigns a new instance via
/// <c>with</c>-expressions.
/// </para>
/// </summary>
public sealed record DisplaySettings(
string Resolution,
bool Fullscreen,
bool VSync,
float FieldOfView,
float Gamma,
bool ShowFps,
QualityPreset Quality)
{
/// <summary>Values used on first launch / when settings.json is absent.
/// Geometry/render defaults preserve the pre-L.0 runtime state — Resolution
/// matches the WindowOptions startup size (1280×720), FieldOfView
/// matches camera FovY (60°), VSync matches WindowOptions (false),
/// ShowFps matches retail's initially-hidden SmartBox FPS readout.</summary>
public static DisplaySettings Default { get; } = new(
Resolution: "1280x720",
Fullscreen: false,
VSync: false,
FieldOfView: 60f,
Gamma: 1.0f,
ShowFps: false,
Quality: QualityPreset.High);
/// <summary>16:9 resolution presets offered in the dropdown.</summary>
public static IReadOnlyList<string> AvailableResolutions { get; } = new[]
{
"1280x720",
"1366x768",
"1600x900",
"1920x1080",
"2560x1440",
"3840x2160",
};
}