Skip to content

feat(ui): theme system saving, multiple theme support#1570

Closed
davo0411 wants to merge 30 commits into
community-shaders:devfrom
davo0411:feature/theme-system-infrastructure
Closed

feat(ui): theme system saving, multiple theme support#1570
davo0411 wants to merge 30 commits into
community-shaders:devfrom
davo0411:feature/theme-system-infrastructure

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Oct 13, 2025

Summary by CodeRabbit

  • New Features

    • Full theming system with built‑in presets (e.g., Dark, Light, High Contrast, Ocean, Forest, Amber, Dragon Blood, Dwemer Bronze, Nordic Frost).
    • Theme discovery, creation, saving/loading, and default theme generation.
    • Background blur, scrollbar opacity, and extensive styling controls.
    • Font roles with a font catalog and per‑section typography.
    • Contrast‑aware UI elements, flash feedback buttons, and a compact feature toggle.
  • Improvements

    • Upscaling now supports per‑axis scaling, clearer preset labels, and new sharpness controls for DLSS/FSR.
  • Bug Fixes

    • More accurate 1:1/VR scaling behavior and robust recovery from corrupted themes.
  • Documentation

    • Added plan outlining upcoming PR split.

davo0411 and others added 30 commits September 22, 2025 22:05
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
…upport

- Add PathHelpers namespace for consistent file system path handling
- Implement theme JSON loading/saving system with validation
- Add 9 theme presets (Default, Amber, DragonBlood, DwemerBronze, Forest, HighContrast, Light, NordicFrost, Ocean)
- Add ThemeManager core for theme discovery and application
- Add THEME config mode to State
- Update SettingsOverrideManager to use PathHelpers
- Integrate theme loading/saving into Menu
- Add CreateDefaultThemes and theme discovery at plugin startup
- Remove PR #2 files (Font system - to be added in next PR)
- Remove PR #3 files (Settings UI overhaul - to be added in future PR)
- Remove PR #4 files (UI candy/blur - to be added in future PR)
- Remove PR #5 files (Performance overlay improvements - to be added in future PR)
@davo0411 davo0411 closed this Oct 13, 2025
@davo0411 davo0411 deleted the feature/theme-system-infrastructure branch October 13, 2025 09:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a full theming system (JSON themes, theme discovery/load/save, per-role fonts, background blur) and integrates it across the Menu/UI. Refactors upscaling to use 2D resolution scales (float2) with API changes in FidelityFX/Streamline and related UI updates. Minor shader tweak to hair albedo. Paths and overrides refactored to helpers. Adds a PR split plan doc.

Changes

Cohort / File(s) Summary
Docs / PR Plan
PR-1530-SPLIT-PLAN.md
New markdown outlining how to split PR #1530 into sequential PRs with scopes, dependencies, testing, and merge order.
Theme JSON assets
package/SKSE/Plugins/CommunityShaders/Themes/Default.json, .../Amber.json, .../DragonBlood.json, .../DwemerBronze.json, .../Forest.json, .../HighContrast.json, .../Light.json, .../NordicFrost.json, .../Ocean.json
Adds multiple theme configuration files with metadata, palettes, status colors, style metrics, font roles, and full palettes; no code logic.
Upscaling subsystem (float2 scaling)
src/Features/Upscaling.cpp, src/Features/Upscaling/FidelityFX.h, src/Features/Upscaling/FidelityFX.cpp, src/Features/Upscaling/Streamline.h, src/Features/Upscaling/Streamline.cpp
Changes resolution scale from float to float2; updates render dimension calculations; adds DLSS option setter; updates serialization fields (streamlineLogLevel, sharpnessFSR/DLSS); modifies GetInputResolutionScale signatures and usage.
Menu theming integration
src/Menu.h, src/Menu.cpp
Introduces font roles, theme settings/preset handling, theme load/save hooks, default theme application, deferred font reload, and public helpers (role resolution, font signature).
Theme Manager overhaul
src/Menu/ThemeManager.h, src/Menu/ThemeManager.cpp
Adds theme discovery/load/save APIs, default theme creation, ImGui style setup via FullPalette, per-role font reload, emergency recovery, and background blur shaders/render path.
Menu renderers (font-role aware UI)
src/Menu/FeatureListRenderer.cpp, src/Menu/MenuHeaderRenderer.cpp, src/Menu/SettingsTabRenderer.h, src/Menu/SettingsTabRenderer.cpp, src/Menu/OverlayRenderer.cpp
Adds RAII font guards and font-aware widgets; restructures tabs/headers; integrates SaveTheme; adds background blur render step; refactors settings sub-tabs.
UI utilities and icons
src/Utils/UI.h, src/Utils/UI.cpp
Adds ButtonWithFlash, FeatureToggle, and ColorUtils for contrast-aware rendering; loads new featureSettingRevert icon; replaces hardcoded colors with theme palette usage.
State and initialization
src/State.h, src/State.cpp, src/XSEPlugin.cpp
Adds THEME config mode; implements LoadTheme/SaveTheme; switches to PathHelpers; integrates theme discovery during plugin load.
Filesystem path helpers
src/Utils/FileSystem.h, src/Utils/FileSystem.cpp
Adds GetSettingsThemePath, GetThemesPath, GetThemesRealPath for theme file locations.
Overrides manager paths
src/SettingsOverrideManager.h, src/SettingsOverrideManager.cpp
Removes hardcoded path constants; switches to PathHelpers for overrides/tracking paths.
Shader tweak
package/Shaders/Lighting.hlsl
Hair shading path: sets outputAlbedo to indirectDiffuseLobeWeight when hair specular is enabled (removes PBRLightingScale factor).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Game as Game/Plugin Loader
  participant XSE as XSEPlugin
  participant State as State
  participant Menu as Menu
  participant TM as ThemeManager

  Game->>XSE: Load()
  XSE->>State: LoadTheme()
  alt No preset selected
    State->>TM: (may) ForceApplyDefaultTheme()
  end
  XSE->>Menu: CreateDefaultThemes()
  XSE->>TM: DiscoverThemes()
  Menu->>TM: SetupImGuiStyle(menu)
  Menu->>TM: ReloadFont(menu, cachedFontSize)
  Note over TM: Applies FullPalette, per-role fonts, recovery
  Menu->>TM: ApplyBackgroundBlur(blurIntensity)
Loading
sequenceDiagram
  autonumber
  participant UI as Menu/UI
  participant Ups as Upscaling
  participant FFX as FidelityFX
  participant SL as Streamline

  UI->>Ups: Update settings / preset
  Ups->>FFX: GetInputResolutionScale(quality) 
  FFX-->>Ups: float2{sx, sy}
  Ups->>SL: GetInputResolutionScale(quality)
  SL-->>Ups: float2{dx, dy}
  Ups->>Ups: Compute renderWidth = sw*sx, renderHeight = sh*sy
  alt 1:1 match
    Ups->>Ups: resolutionScale = {1.0, 1.0}
  else Scaled
    Ups->>Ups: resolutionScale = {rw/sw, rh/sh}
  end
  Ups-->>UI: Display preset label with avg(scale)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum

Poem

A rabbit taps keys by moonlit theme,
Fonts don capes, blur hums like a dream.
Scales split in twos, waves meet the shore—
Nordic frost, amber’s warm lore.
Click—flash! a toggle gleams bright—
Saved my theme, UI takes flight.
Hop, hop—everything feels right. 🐇✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62fa347 and 49f866b.

⛔ Files ignored due to path filters (3)
  • package/Interface/CommunityShaders/Fonts/Jost/Jost-Light.ttf is excluded by !**/*.ttf
  • package/Interface/CommunityShaders/Fonts/Jost/Jost-Regular.ttf is excluded by !**/*.ttf
  • package/Interface/CommunityShaders/Fonts/Jost/Jost-SemiBold.ttf is excluded by !**/*.ttf
📒 Files selected for processing (34)
  • PR-1530-SPLIT-PLAN.md (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/Amber.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/Default.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/DragonBlood.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/DwemerBronze.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/Forest.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/HighContrast.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/Light.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/NordicFrost.json (1 hunks)
  • package/SKSE/Plugins/CommunityShaders/Themes/Ocean.json (1 hunks)
  • package/Shaders/Lighting.hlsl (1 hunks)
  • src/Features/Upscaling.cpp (3 hunks)
  • src/Features/Upscaling/FidelityFX.cpp (1 hunks)
  • src/Features/Upscaling/FidelityFX.h (1 hunks)
  • src/Features/Upscaling/Streamline.cpp (6 hunks)
  • src/Features/Upscaling/Streamline.h (1 hunks)
  • src/Menu.cpp (11 hunks)
  • src/Menu.h (8 hunks)
  • src/Menu/FeatureListRenderer.cpp (7 hunks)
  • src/Menu/MenuHeaderRenderer.cpp (5 hunks)
  • src/Menu/OverlayRenderer.cpp (2 hunks)
  • src/Menu/SettingsTabRenderer.cpp (10 hunks)
  • src/Menu/SettingsTabRenderer.h (1 hunks)
  • src/Menu/ThemeManager.cpp (4 hunks)
  • src/Menu/ThemeManager.h (3 hunks)
  • src/SettingsOverrideManager.cpp (3 hunks)
  • src/SettingsOverrideManager.h (0 hunks)
  • src/State.cpp (4 hunks)
  • src/State.h (2 hunks)
  • src/Utils/FileSystem.cpp (2 hunks)
  • src/Utils/FileSystem.h (2 hunks)
  • src/Utils/UI.cpp (11 hunks)
  • src/Utils/UI.h (3 hunks)
  • src/XSEPlugin.cpp (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@davo0411 davo0411 restored the feature/theme-system-infrastructure branch October 13, 2025 09:25
@github-actions
Copy link
Copy Markdown

Using provided base ref: 62fa347
Using base ref: 62fa347
Base commit date: 2025-10-12T14:53:26+01:00 (Sunday, October 12, 2025 02:53 PM)
No actionable suggestions for changed features.

@davo0411 davo0411 deleted the feature/theme-system-infrastructure branch October 13, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant