Add nuke fallout color graphics option (#4355)

## What

Adds a **Nuke fallout color** option to the in-game graphics settings
modal (Effects section), letting players recolor the fallout tint left
on territory after a nuke.

![modal](https://github.com/user-attachments/assets/placeholder)

## How

Mirrors the existing **Ocean color** override pattern:

- `GraphicsOverrides.ts` — adds `staleNukeColor` (hex string) to the
`mapOverlay` override schema.
- `RenderOverrides.ts` — `applyGraphicsOverrides` parses the hex and
writes the renderer's `staleNukeR/G/B` 0–1 float channels (`hexToRgb`
yields 0–255, so it divides by 255).
- `GraphicsSettingsModal.ts` — new hex-text + native color-picker row,
default computed from `render-settings.json`.
- `en.json` — `nuke_color_label` / `nuke_color_desc`.

The value persists via `UserSettings.graphicsOverrides()` and is cleared
by the modal's existing "Reset to defaults".

The render debug GUI already exposes the same setting as **Stale Nuke
Color** (Map Overlay), so no change was needed there.

## Testing

- `tsc --noEmit` clean.
- Verified in a headless solo game: the row renders with the green
default (`#0d8c12`), changing it persists `mapOverlay.staleNukeColor`,
and `applyGraphicsOverrides("#ff0000")` produces `staleNukeR=1, G=0,
B=0`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Evan
2026-06-19 20:28:11 -07:00
committed by evanpelle
parent cb0d79ed6d
commit 4ee68b4ea7
4 changed files with 73 additions and 0 deletions
@@ -27,6 +27,9 @@ export const GraphicsOverridesSchema = z
territorySaturation: z.number(),
territoryAlpha: z.number(),
coordinateGridOpacity: z.number(),
// "#rrggbb" hex string; overrides the lingering fallout ground tint
// left on territory after a nuke.
staleNukeColor: z.string(),
})
.partial(),
railroad: z
+10
View File
@@ -1,5 +1,6 @@
import type { GraphicsOverrides } from "./GraphicsOverrides";
import { createThemeSettings, type RenderSettings } from "./RenderSettings";
import { hexToRgb } from "./utils/ColorUtils";
/**
* Apply the user's graphics overrides onto a RenderSettings in place: name
@@ -64,6 +65,15 @@ export function applyGraphicsOverrides(
settings.mapOverlay.coordinateGridOpacity =
overrides.mapOverlay.coordinateGridOpacity;
}
if (overrides.mapOverlay?.staleNukeColor !== undefined) {
// hexToRgb yields 0-255 channels; the stale-nuke uniforms are 0-1 floats.
const rgb = hexToRgb(overrides.mapOverlay.staleNukeColor);
if (rgb !== null) {
settings.mapOverlay.staleNukeR = rgb[0] / 255;
settings.mapOverlay.staleNukeG = rgb[1] / 255;
settings.mapOverlay.staleNukeB = rgb[2] / 255;
}
}
if (overrides.railroad?.railMinZoom !== undefined) {
settings.railroad.railMinZoom = overrides.railroad.railMinZoom;
}