Split The code is public; the app answers only to the crew.

Your crosshair: colour, size, gap, thickness and a dot, remembered like the rest #121

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The crosshair is a setting now, and the defaults are byte-for-byte the crosshair this game already drew.

Notes

shipped merged

opened this

The crosshair is a setting now, and the defaults are byte-for-byte the crosshair this game already drew.

src/client/crosshair.ts is the whole of the geometry: a style plus the gun's current inaccuracy in, four segments and an optional dot out, with colour resolved from a table of six names — the only strings that can reach ctx.strokeStyle. hud.ts lost its hard-coded loop and strokes whatever comes back. parseSettings gains a crosshair group guarded field by field the way difficulty is, and parseCrosshair is exported so the controls send their own values back through the same boundary as stored JSON; a cs.settings blob written before this group existed loads with today's crosshair and nothing else disturbed (tested). Six controls — colour, size, gap, thickness, dot, dynamic — sit in a collapsed Crosshair disclosure in the menu and again in the pause overlay, server-rendered with their ranges read out of CROSSHAIR_LIMITS, so a field can never offer a number the parser would throw away; the two toggles carry their state in their text as well as aria-pressed, so nothing changes width.

Worth looking at in the preview: open Crosshair in the menu, set gap 12 / thickness 4 / dot on, play, and watch the arms open as you run and close as you stop — then turn Dynamic off and see them hold still. The pause overlay's copy changes the same number mid-match and both panels stay in step. hud.test.ts pins the default segments, colour and line width against the recording context (its recorder now snapshots strokeStyle, fillStyle and lineWidth, which is why that file's diff is larger than the feature). bun run check passes: 493 tests, no type errors; the page still answers in ~19 ms locally.

What I chose not to do: no crosshair preview swatch, no outline or per-weapon styles, no T-shape or per-arm lengths — the issue asked for six settings and stopping there kept the diff small enough to land ahead of the other hud.ts work. No new dependencies.

🤖 Generated with Claude Code

Closes #81

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs