# WBP_SettingsMenu — Widget (Settings Menu)

**Parent:** `UUserWidget`
**Used by:** `SS_UIManager.PushMenu("SettingsMenu")`
**Depends On:** `SS_UIManager`, `SS_SettingsSystem`, `BPC_RenderPipelineManager`

---

### Purpose
Full settings screen with tabs: Video/Graphics, Audio, Gameplay, Controls, Accessibility. The Video tab includes quality presets with platform-aware render pipeline options, upscaling configuration, individual feature toggles, and visual warnings for settings that require a level reload.

### Enums (local or global)

```
E_SettingsTab
{
    Video,
    Audio,
    Gameplay,
    Controls,
    Accessibility
}
```

### Variables

| Name | Type | Description |
|------|------|-------------|
| `ActiveTab` | `E_SettingsTab` | Currently visible tab |
| `TabButtons` | Array of `Button` | Tab navigation buttons |
| `TabPanels` | Array of `PanelWidget` | Tab content panels |
| `ReloadWarningBanner` | `Border` | Warning banner for reload-required settings |

---

### Video Tab Children (EXPANDED — was 5, now 25+)

**Quality Preset:**
| Name | Type | Description |
|------|------|-------------|
| `QualityPresetDropdown` | `ComboBoxString` | Low, Medium, High, Ultra, Cinematic, Custom |
| `PresetDescriptionText` | `RichTextBlock` | Describes what each preset changes |
| `ReloadWarningIcon` | `Image` | ⚠ icon visible when preset change requires reload |

**Display:**
| Name | Type | Description |
|------|------|-------------|
| `ResolutionScaleSlider` | `Slider` | 25%–200% screen percentage |
| `ResolutionScaleValue` | `TextBlock` | Shows current % |
| `WindowModeDropdown` | `ComboBoxString` | Fullscreen, Windowed Fullscreen, Windowed |
| `VSyncToggle` | `CheckBox` | On/Off |
| `FrameRateLimitSlider` | `Slider` | 30–240 FPS |
| `BrightnessSlider` | `Slider` | 0.5–2.0 gamma |
| `HDRToggle` | `CheckBox` | HDR output (if display supports) |

**Render Pipeline (⚠ reload required section):**
| Name | Type | Description |
|------|------|-------------|
| `GlobalIlluminationDropdown` | `ComboBoxString` | Lumen, Baked Lightmass, SSGI, Off |
| `ShadowMethodDropdown` | `ComboBoxString` | Virtual Shadow Maps, Cascaded, Distance Field, Off |
| `ReflectionMethodDropdown` | `ComboBoxString` | Lumen, Screen Space, Captures, Off |
| `MeshStrategyDropdown` | `ComboBoxString` | Nanite, Traditional LOD, Proxy Geometry |
| `PipelineReloadBanner` | `Border` | "These settings require a level transition to apply" |

**Upscaling:**
| Name | Type | Description |
|------|------|-------------|
| `UpscalerMethodDropdown` | `ComboBoxString` | TSR, DLSS, FSR, PSSR, XeSS, NIS, TAAU, Off |
| `UpscalerQualityDropdown` | `ComboBoxString` | Ultra Performance, Performance, Balanced, Quality, Ultra Quality |
| `DynamicResolutionToggle` | `CheckBox` | Enable dynamic resolution scaling |
| `DynamicResTargetSlider` | `Slider` | Target FPS for dynamic resolution |

**Scalability Sliders:**
| Name | Type | Description |
|------|------|-------------|
| `ShadowQualitySlider` | `Slider` | 0=NONE, 1=LOW, 2=MED, 3=HIGH, 4=EPIC |
| `TextureQualitySlider` | `Slider` | 0–3 |
| `PostProcessQualitySlider` | `Slider` | 0–3 |
| `ViewDistanceQualitySlider` | `Slider` | 0–3 |
| `FoliageQualitySlider` | `Slider` | 0–3 |
| `AntiAliasingQualitySlider` | `Slider` | 0–3 |

**Post-Process Toggles:**
| Name | Type | Description |
|------|------|-------------|
| `MotionBlurToggle` | `CheckBox` | On/Off |
| `DepthOfFieldToggle` | `CheckBox` | On/Off |
| `VolumetricCloudsToggle` | `CheckBox` | On/Off |
| `HWRTToggle` | `CheckBox` | Hardware Ray Tracing (⚠ reload) — only visible on supported platforms |

**Texture:**
| Name | Type | Description |
|------|------|-------------|
| `TexturePoolSizeSlider` | `Slider` | 512–8192 MB |

**Actions:**
| Name | Type | Description |
|------|------|-------------|
| `ApplyButton` | `Button` | Apply all pending changes |
| `RevertButton` | `Button` | Revert to last applied state |
| `ResetDefaultsButton` | `Button` | Reset all video settings to platform defaults |

---

### Audio Tab Children

| Name | Type | Description |
|------|------|-------------|
| `MasterVolumeSlider` | `Slider` | 0–100 |
| `SFXVolumeSlider` | `Slider` | 0–100 |
| `MusicVolumeSlider` | `Slider` | 0–100 |
| `VoiceVolumeSlider` | `Slider` | 0–100 |
| `AmbientVolumeSlider` | `Slider` | 0–100 |
| `UIVolumeSlider` | `Slider` | 0–100 |
| `SpatialAudioToggle` | `CheckBox` | On/Off |
| `AudioQualityDropdown` | `ComboBoxString` | Low, Medium, High |
| `SubtitlesToggle` | `CheckBox` | On/Off |

### Gameplay Tab Children

| Name | Type | Description |
|------|------|-------------|
| `InvertYAxisToggle` | `CheckBox` | On/Off |
| `SensitivityXSlider` | `Slider` | Mouse sensitivity X |
| `SensitivityYSlider` | `Slider` | Mouse sensitivity Y |
| `FOVSlider` | `Slider` | 70–120 degrees |
| `HeadBobToggle` | `CheckBox` | Camera head bob |
| `AutoPickupToggle` | `CheckBox` | Auto-pickup items |
| `CrosshairTypeDropdown` | `ComboBoxString` | Default, Dot, Cross, Off |

### Controls Tab Children

| Name | Type | Description |
|------|------|-------------|
| `ActionMappingsList` | `ListView` | Key binding rows |
| `ResetDefaultsButton` | `Button` | Reset all bindings |

### Accessibility Tab Children

| Name | Type | Description |
|------|------|-------------|
| `SubtitleSizeDropdown` | `ComboBoxString` | Small, Medium, Large |
| `SubtitleBackgroundOpacity` | `Slider` | 0–100% |
| `ColorblindModeDropdown` | `ComboBoxString` | None, Protanopia, Deuteranopia, Tritanopia |
| `HighContrastUIToggle` | `CheckBox` | On/Off |
| `CameraShakeIntensity` | `Slider` | 0–100% |
| `ScreenShakeToggle` | `CheckBox` | Enable/disable screen shake |
| `ReducedMotionToggle` | `CheckBox` | Reduce UI animations |
| `LargeTextToggle` | `CheckBox` | Enlarge all UI text |
| `TextToSpeechToggle` | `CheckBox` | TTS for UI elements |
| `DisableFlashToggle` | `CheckBox` | Prevent strobe effects |
| `HapticsEnabledToggle` | `CheckBox` | Enable controller vibration |
| `HapticsIntensitySlider` | `Slider` | Vibration intensity 0–100% |
| `AdaptiveTriggersToggle` | `CheckBox` | PS5 DualSense adaptive triggers |
| `ControllerSpeakerToggle` | `CheckBox` | PS5 controller speaker |

---

### Functions

| Name | Inputs | Outputs | Description |
|------|--------|---------|-------------|
| `OnConstruct` | — | — | Populate dropdowns, load saved settings, query available upscalers |
| `SwitchTab` | Tab: `E_SettingsTab` | — | Show selected panel, hide others |
| `OnQualityPresetChanged` | NewPreset: Name | — | Update all controls to reflect preset, show reload warning if needed |
| `OnPipelineSettingChanged` | SettingName: Name | — | Show reload banner if setting requires level reload |
| `OnSettingChanged` | SettingName: FName, Value: Generic | — | Write to SS_SettingsSystem |
| `SaveSettings` | — | — | SS_SettingsSystem.SaveToDisk |
| `ApplyVideoSettings` | — | — | SS_SettingsSystem.ApplyGraphicsSettings → BPC_RenderPipelineManager |
| `ResetToDefaults` | — | — | Load platform defaults, re-populate UI |
| `OnBack` | — | — | SaveSettings, SS_UIManager.PopMenu |
| `RebindKey` | ActionName: FName | — | Listen for next key press, map to action |
| `QueryAvailableUpscalers` | — | TArray<E_UpscalerMethod> | Calls BPC_RenderPipelineManager.GetAvailableUpscalers() |
| `ShowReloadWarning` | — | — | Display "⚠ Some settings will apply on next level load" banner |
| `HideReloadWarning` | — | — | Dismiss the reload warning banner |
| `UpdatePresetDescription` | Preset: Name | — | Show FPS target, resolution, GI method for preset |
| `OnHoverSetting` | SettingName: Name | — | Show tooltip explaining what this setting does |
| `RevertToApplied` | — | — | Revert UI controls to last-applied state |

---

### Quality Preset Descriptions (shown in `PresetDescriptionText`)

| Preset | Description |
|--------|-------------|
| **Low** | Performance mode. Baked lighting, CSM shadows, LOD meshes. Target: 60 FPS on consoles, 120 FPS on PC. |
| **Medium** | Balanced. Lumen Low GI, VSM shadows, Nanite enabled, TSR upscaling. Target: 60 FPS. |
| **High** | Quality mode. Full Lumen GI, high-quality VSM, Nanite, DLSS/FSR Quality upscaling. Target: 60 FPS. |
| **Ultra** | Maximum fidelity. Lumen Ultra, full VSM, Nanite, DLSS/PSSR upscaling. Target: 60 FPS (30 on base consoles). |
| **Cinematic** | Cinematic quality. Lumen + HWRT, path tracing available, highest upscaling quality. Target: 30 FPS. |
| **Custom** | Manually configured settings. Performance impact varies. |

---

### Communications With

| Target System | Method | Why |
|--------------|--------|-----|
| [`SS_UIManager`](44_SS_UIManager.md) | Push/Pop | Menu lifecycle |
| `SS_SettingsSystem` | Function calls | Read/write all settings |
| `BPC_RenderPipelineManager` (149) | Function calls | Query available upscalers, check reload requirements |

### Blueprint Flow — Video Tab

```
[OnConstruct]
  ├─ Populate QualityPresetDropdown
  ├─ Read SS_SettingsSystem.GetSettingFloat("QualityPreset") → set dropdown
  ├─ Call BPC_RenderPipelineManager.GetAvailableUpscalers() → populate upscaler dropdown
  │    └─ Filter: only show upscalers supported on this platform
  ├─ Read all saved settings from SS_SettingsSystem → populate sliders/toggles
  └─ Call UpdatePresetDescription based on active preset

[OnQualityPresetChanged(NewPreset)]
  ├─ Call BPC_RenderPipelineManager.RequiresReloadForPresetChange(NewPreset)
  ├─ If TRUE: ShowReloadWarning()
  ├─ If FALSE: HideReloadWarning()
  ├─ Set all sliders/toggles to match the preset defaults
  ├─ UpdatePresetDescription(NewPreset)
  └─ SS_SettingsSystem.SetSettingDropdown("QualityPreset", NewPreset)

[OnPipelineSettingChanged(SettingName)]
  ├─ Check if setting is in "reload required" list:
  │    [GlobalIllumination, ShadowMethod, ReflectionMethod, MeshStrategy, HWRT]
  ├─ If changed from current: ShowReloadWarning()
  └─ Else: HideReloadWarning()

[ApplyVideoSettings]
  ├─ SS_SettingsSystem.ApplyGraphicsSettings()
  ├─ If reload warning visible AND game is in session:
  │    └─ SS_SettingsSystem.SaveSettings()
  │    └─ Show notification: "Settings applied. Render pipeline changes will take effect on next level load."
  ├─ Else if in Main Menu:
  │    └─ Apply immediately (no reload needed for menu)
  └─ HideReloadWarning()
```

### Reuse Notes
- The tab panel pattern can be extended for mod settings or developer menus by adding new tab entries
- All controls marked `⚠ reload` call `OnPipelineSettingChanged` to show the warning banner
- The Video tab queries `BPC_RenderPipelineManager` at construction to know which upscalers are available
- Preset selection acts as a "quick-config" — sets all sliders/toggles to preset defaults, then user can fine-tune
- When Custom preset is selected, all individual controls are enabled; other presets lock controls to their defaults
