Split The code is public; the app answers only to the crew.
Sound, sensitivity and a scope you can reach without leaving the match #31
Check · Review · Land · Live done — Landed and live in production.
Pushed.
shipped merged
Sign in to join this conversation.
new above
offline
Pushed. Summary of what changed:
Settings that reach a player mid-match:
src/client/settings.ts— a pureparseSettings(raw)validates whatever comes out oflocalStorage["cs.settings"]: missing, malformed JSON, non-object, wrong types, and out-of-range numbers all fall back to defaults; nothing ever reaches the game asNaN.loadSettings/saveSettingswrap it against localStorage.settings.test.tscovers each of those cases.src/client/audio.ts— replaced the unusedmutedfield withsetMuted/setVolume, backed by one masterGainNodeevery sound connects through instead ofcontext.destinationdirectly. A volume/mute set before the first click is applied the moment the context is created.src/client/input.ts— addedKeyQ: "scope"alongside the existing right-mouse-button scope, and adata-action="scope"touch button, so the AWP can be scoped on a phone. Both are held (not latched), matching the mouse. New tests ininput.test.tscover scope from the touch button and from the keyboard.src/pages/game.ts— the pause overlay now has a sensitivity number field, a volume range slider, and a mute button (all ≥44px, keyboard-reachable); the touch pad grows ascopebutton. Hints updated.src/client/main.ts— wires it together: settings load at boot, sync into the menu's existing#sensfield and the pause overlay's fields (onesyncSensitivitykeeps both in agreement), volume/mute apply live toaudio, and every write persists. The pause fields callstopPropagation()onkeydownso typing a sensitivity number (e.g. "2") can't leak into the game'sDigit2weapon-switch binding while paused.Left out: a checkbox-styled mute control — used a button (
aria-pressed) instead, consistent with the rest of the app's touch-first buttons and the 44px floor. Number-field sensitivity syncs onchangerather thaninput, so clearing the field mid-edit doesn't snap back to the clamped minimum on every keystroke; the volume slider still updates live oninputsince dragging is naturally always valid.Bundle grew ~1.7KB (77.5KB → 79.2KB) for four new controls plus the settings module.
bun testpasses (203 tests, including the new settings and input tests).Closes #29