mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 17:53:29 +00:00
Replace dark mode with player-adjustable lighting (#4280)
## What Removes the binary **dark mode** feature and replaces it with a player-adjustable **Lighting** section in graphics settings. ### In-game settings - Removed the Dark Mode toggle from both `SettingsModal` and `UserSettingModal`, and `darkMode()`/`toggleDarkMode()`/`DARK_MODE_KEY` from `UserSettings`. ### New Lighting section (Graphics Settings) - **Ambient light** slider (1–3): mapped to the renderer's ambient as `ambient = 1 / level`. **1.0 = no effect (unchanged look), 3.0 = darkest with the strongest structure glow.** - **Light falloff** slider (1–3): writes straight to `lighting.falloffPower`. - Lighting auto-enables only when ambient < 1, so the default (slider at 1) has zero GPU cost — off by default. ### Removed dark-mode overrides - Deleted `applyDarkModeOverride()` + `DARK_AMBIENT` and their wiring in `ClientGameRunner`, `gl/index.ts`, and the `DARK_MODE_KEY` listener. - Removed the `.dark` HUD-class toggle in `Main.ts` and the `userSettings.darkMode()` read in `PlayerIcons`. ### Train glow - `UT_TRAIN` light reduced (intensity `2.0 → 0.5`, radius `8 → 6`) so structures dominate the glow. ## Notes - Removing the dark-mode setting also retires the HUD's Tailwind dark theme (same setting). The dormant `dark:` CSS variants and unused white-icon assets are left in place (out of scope). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -537,6 +537,10 @@
|
||||
"hover_glow_width_label": "Hover glow size",
|
||||
"icon_size_desc": "How large structure icons are drawn on the map",
|
||||
"icon_size_label": "Structure icon size",
|
||||
"lighting_ambient_desc": "Darkens the map and adds a glow around structures (0 = off)",
|
||||
"lighting_ambient_label": "Ambient light",
|
||||
"lighting_unit_glow_desc": "How far the glow spreads around units and structures",
|
||||
"lighting_unit_glow_label": "Unit glow",
|
||||
"name_cull_desc": "Hide names smaller than this size",
|
||||
"name_cull_label": "Minimum name size",
|
||||
"name_scale_label": "Name Scale",
|
||||
@@ -550,6 +554,7 @@
|
||||
"reset_label": "Reset to defaults",
|
||||
"section_accessibility": "Accessibility",
|
||||
"section_effects": "Effects",
|
||||
"section_lighting": "Lighting",
|
||||
"section_map": "Map",
|
||||
"section_name_labels": "Name Labels",
|
||||
"section_structure_icons": "Structure Icons",
|
||||
@@ -1345,8 +1350,6 @@
|
||||
"coordinate_grid_label": "Coordinate Grid",
|
||||
"cursor_cost_label_desc": "Show a cost pill under the build cursor icon",
|
||||
"cursor_cost_label_label": "Cursor Build Cost",
|
||||
"dark_mode_desc": "Toggle the site’s appearance between light and dark themes",
|
||||
"dark_mode_label": "Dark Mode",
|
||||
"development_only": "Development Only",
|
||||
"easter_bug_count_desc": "How many bugs you're okay with (0–1000, emotionally)",
|
||||
"easter_bug_count_label": "Bug Count",
|
||||
|
||||
Reference in New Issue
Block a user