Files
OpenFrontIO/src/client/render/gl/GraphicsOverrides.ts
T
Evan Pelle d30385fc56 Add structure dots toggle to graphics settings
Add an on/off toggle in the graphics settings modal's Structure Icons
section that controls whether structures collapse into small dots when
zoomed out. When disabled, applyGraphicsOverrides forces the renderer's
structure.dotsZoomThreshold to 0 — since zoom is always > 0, the dots LOD
never triggers and structures keep their full icon at every zoom level.

The debug GUI already exposes the underlying dotsZoomThreshold slider for
fine control; this surfaces a simple player-facing toggle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 03:35:05 +00:00

73 lines
2.1 KiB
TypeScript

import { z } from "zod";
export const GraphicsOverridesSchema = z
.object({
name: z
.object({
nameScaleFactor: z.number(),
cullThreshold: z.number(),
darkNames: z.boolean(),
hoverFadeAlpha: z.number(),
hoverGlowWidth: z.number(),
hoverGlowAlpha: z.number(),
})
.partial(),
structure: z
.object({
iconSize: z.number(),
classicIcons: z.boolean(),
classicNumbers: z.boolean(),
// When false, structures keep their full icon at any zoom instead of
// collapsing to dots when zoomed out (forces dotsZoomThreshold to 0).
showDots: z.boolean(),
})
.partial(),
mapOverlay: z
.object({
highlightFillBrighten: z.number(),
highlightBrighten: z.number(),
highlightThicken: z.number(),
territorySaturation: z.number(),
territoryAlpha: z.number(),
coordinateGridOpacity: z.number(),
})
.partial(),
railroad: z
.object({
railMinZoom: z.number(),
railThickness: z.number(),
})
.partial(),
passEnabled: z
.object({
fx: z.boolean(),
// Nuclear fallout effects: the broiling green territory bloom and its
// light emission in day/night mode. Disable to improve performance.
fallout: z.boolean(),
})
.partial(),
accessibility: z
.object({
colorblind: z.boolean(),
})
.partial(),
terrain: z
.object({
// "#rrggbb" hex string; overrides the base ocean (deep water) color.
oceanColor: z.string(),
})
.partial(),
lighting: z
.object({
// Scene brightness multiplier in the day/night composite. <1 darkens
// the map and reveals the glow around structures/units; 1 is identity.
ambient: z.number(),
// Exponent controlling how sharply a light fades with distance.
falloffPower: z.number(),
})
.partial(),
})
.partial();
export type GraphicsOverrides = z.infer<typeof GraphicsOverridesSchema>;