mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:10:55 +00:00
Add structure icon size graphics override (#4270)
## Summary Adds a new **Structure icon size** option to `GraphicsOverrides`, exposed as a slider in the Graphics Settings modal. Players can now scale how large structure icons are drawn on the map. ## Changes - **`GraphicsOverrides.ts`** — add `iconSize: z.number()` to the `structure` override schema. - **`RenderOverrides.ts`** — apply the override onto `settings.structure.iconSize` (consumed by `StructurePass`/`StructureLevelPass` shaders). - **`GraphicsSettingsModal.ts`** — add a slider (range 20–120, step 5) in the "Structure Icons" section, with getter/handler following the existing pattern. Falls back to the `render-settings.json` default of 60 when unset. - **`resources/lang/en.json`** — add `icon_size_label` / `icon_size_desc` (English only, per i18n rules). - **`tests/GraphicsOverrides.test.ts`** — schema-validation cases plus application tests (override sets the value; absence keeps the default). The setting persists via the existing `userSettings.graphicsOverrides()` localStorage flow and takes effect live through the existing `regenerateRenderSettings` wiring. ## Testing - `npx vitest tests/GraphicsOverrides.test.ts --run` — 35 passed - `tsc --noEmit` — no new type errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -535,6 +535,8 @@
|
||||
"hover_glow_alpha_label": "Hover glow strength",
|
||||
"hover_glow_width_desc": "How far the white glow extends behind the hovered player's name",
|
||||
"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",
|
||||
"name_cull_desc": "Hide names smaller than this size",
|
||||
"name_cull_label": "Minimum name size",
|
||||
"name_scale_label": "Name Scale",
|
||||
|
||||
Reference in New Issue
Block a user