ShadowsOfDoubt UI Scaler

v1.0.1·Updated 2025-08-23

Unifies UI scale via Canvas Scaler for Shadows of Doubt. Config hot-reload, configurable hotkeys (F9 toggle, F11/F10 ±5%), and safe per-canvas application. Keeps fonts/sprites crisp; world-space optio

About this mod Author’s original text

Shadows of Doubt UI Scaler

Plugin GUID: khundian.sod.uiscaler

Name: Shadows of Doubt UI Scaler

Version: 1.0.1

Description: UI scaler + configurable hotkeys.

Unifies UI scale via Canvas Scaler for Shadows of Doubt. Config hot-reload, configurable hotkeys (F9 toggle, F11/F10 ±5%), and safe per-canvas application. Keeps fonts/sprites crisp; world-space optional. Requires BepInEx 6 IL2CPP.

Features

  • Global UI scaling via Canvas Scaler (Scale With Screen Size) with configurable reference resolution (default 1920×1080), match factor (0–1), and a multiplier (0.10×–5.00×).
  • Configurable hotkeys (defaults: Toggle F9, Scale Up F11, Scale Down F10). Each press adjusts by 5% and saves after a short idle.
  • Hot reload of the config file. Edits on disk are debounced and re-applied safely while the game is running.
  • Scene-change detection by polling (SceneManager.GetActiveScene()), ensuring compatibility with IL2CPP/Roslyn edge-cases (no event subscription required).
  • Batched layout rebuilds: Canvas.ForceUpdateCanvases() is called once per rescan/revert pass to avoid spikes.
  • Efficient discovery of canvases using Object.FindObjectsOfType(true), with filters:
  • ActiveSceneOnly (affect canvases in the active scene)
  • IncludeWorldSpace (optional world-space canvases)
  • Name filters via include/exclude tokens
  • Zero-alloc pruning of destroyed canvases and best‑effort pre‑sizing of internal collections for large scenes.
  • Periodic rescan interval is configurable (Engine:RescanEveryMilliseconds, default 2000 ms). Heavier work runs on a timed tick; only input runs every frame.

Requirements

  • Shadows of Doubt (Unity 2021.3)
  • BepInEx 6 (IL2CPP)

Installation

Manual (zip)

  • Install BepInEx 6 (IL2CPP) for the game.
  • Copy the plugin DLL to:

\BepInEx\plugins\ShadowsOfDoubt.UIScaler\ShadowsOfDoubt.UIScaler.dll

  • Launch the game once. The config file will be created at:

\BepInEx\config\khundian.sod.uiscaler.cfg

(optional)

Zip structure:

BepInEx/

plugins/

ShadowsOfDoubt.UIScaler/

ShadowsOfDoubt.UIScaler.dll

manifest.json

README.md

LICENSE

Usage

Defaults

  • Enabled: true
  • Scale: UiScaleMultiplier = 1.00 (vanilla size)
  • Reference Resolution: 1920 × 1080
  • Match: 0.50 (balanced width/height)
  • Rescan: 2000 ms
  • Hotkeys:
  • Toggle: F9 (on/off)
  • ScaleUp: F11 (+5%)
  • ScaleDown: F10 (−5%)

In-game

  • Press F9 to enable/disable (when disabling, original Canvas settings are restored).
  • Press F11 / F10 to adjust the global UI scale by ±5%.
  • A small toast confirms the change (e.g., UI Scale: 1.15x).

Configuration

Location:

\BepInEx\config\khundian.sod.uiscaler.cfg

The file includes a readable header and per-setting comments. Saving the file hot-reloads and re-applies settings while the game is running—no restart needed.

Key Settings (overview)

[General]

  • Enabled — master switch

[CanvasScaler]

  • UiScaleMultiplier (0.10–5.00) — global UI size multiplier (1.00 = vanilla)
  • ReferenceWidth / ReferenceHeight — reference resolution (default 1920×1080)
  • MatchWidthOrHeight (0..1) — 0 = width, 1 = height, 0.5 = balanced

[Filter]

  • ActiveSceneOnly — consider canvases only from active scene
  • IncludeWorldSpaceCanvases — include World Space canvases (default false)
  • CanvasInclude / CanvasExclude — comma-separated name tokens; exclude wins over include

[Perf]

  • RescanEveryMilliseconds — periodic re-scan to catch newly spawned canvases

[Hotkeys] (names from Unity KeyCode)

  • Toggle (default F9)
  • ScaleUp (default F11)
  • ScaleDown (default F10)

How It Works (Technical)

  • Finds canvases (including inactive) and attaches/updates a CanvasScaler set to Scale With Screen Size.
  • Applies UiScaleMultiplier by adjusting the reference resolution inversely (preserves pixel density).
  • Stores original scaler settings and reverts them when disabling the plugin.
  • Watches the config file; on any save, it reloads and re-applies if still enabled.

Troubleshooting

  • World-space UI breaks

World-space canvases are excluded by default. Enab

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack_IL2CPP

File & checksum

Filename
ShadowsOfDoubt_UI_Scaler-1.0.1.zip
File size
132.3 KiB