using AcDream.App.Settings; using AcDream.App.Plugins; using AcDream.App.Rendering.Gpu; using AcDream.App.Rendering.Packs; using AcDream.UI.Abstractions.Panels.Settings; using Silk.NET.Input; namespace AcDream.App.Composition; /// /// Resolved display/audio/quality settings for the session. The optional /// ImGui developer-tools frontend that used to compose here (VitalsPanel, /// ChatPanel, DebugPanel, SettingsPanel via AcDream.UI.ImGui) was /// removed at Campaign V slice V11 along with the OpenGL backend it /// required — see docs/plans/2026-07-27-vulkan-campaign.md. The /// ImGui-era SettingsPanel's promised re-home landed as Campaign OP's retail /// Options panel (OptionsPanelController et al., the retained /// UiHost/UiRoot tree — D1) instead of a new /// IPanelRenderer implementation, and its OP9 closeout retired the /// unrendered ImGui-era SettingsPanel/SettingsVM outright. Keybind remapping /// is Campaign OP slice OP8's Configure Keyboard screen, persisting to /// keybinds.json (not retail's .keymap format — register row AP-202). /// internal sealed record SettingsDevToolsResult( AcDream.UI.Abstractions.Settings.QualitySettings ResolvedQuality) { internal RenderPackCatalogSource? RenderPacks { get; init; } internal RenderPackSelectionSettings RenderPackSelection { get; init; } = RenderPackSelectionSettings.Retail; } internal sealed record SettingsDevToolsDependencies( RuntimeSettingsController Settings, IRuntimeSettingsStartupTarget StartupTarget) { internal BufferedRenderPackRegistry? RenderPacks { get; init; } internal IGpuDevice? GpuDevice { get; init; } } /// /// Production Phase 3: applies the resolved startup display/audio settings. /// internal sealed class SettingsDevToolsCompositionPhase : ISettingsDevToolsCompositionPhase< GameWindowPlatformResult, HostInputCameraResult, ContentEffectsAudioResult, SettingsDevToolsResult> { private readonly SettingsDevToolsDependencies _dependencies; public SettingsDevToolsCompositionPhase(SettingsDevToolsDependencies dependencies) { _dependencies = dependencies ?? throw new ArgumentNullException(nameof(dependencies)); } public SettingsDevToolsResult Compose( GameWindowPlatformResult platform, HostInputCameraResult host, ContentEffectsAudioResult content) { ArgumentNullException.ThrowIfNull(platform); ArgumentNullException.ThrowIfNull(host); ArgumentNullException.ThrowIfNull(content); _dependencies.Settings.ApplyStartup(_dependencies.StartupTarget); RenderPackCatalogSource? renderPacks = null; if (_dependencies.RenderPacks is { } registry && _dependencies.GpuDevice is { } gpu) { renderPacks = new RenderPackCatalogSource( registry, RenderPackCapabilityResolver.Resolve(gpu.Capabilities)); } return new SettingsDevToolsResult(_dependencies.Settings.ResolvedQuality) { RenderPacks = renderPacks, RenderPackSelection = _dependencies.Settings.Display.RenderPack, }; } }