Public: anyone can read this; the crew can change it.

forked from trevato/cs

Sensitivity can be changed without leaving the round: the pause panel carries the two fields, and a change turns the next mouse movement #407

Closed opened this
opened this

A player who finds their aim too fast halfway through a round has to leave the match to fix it. src/client/main.ts reads #sens and #touchsens only when a match starts (the two controls.sensitivity = clamp(...) lines near 1244 and 1309), and the pause panel (PAUSE in src/pages/game.ts) offers only Resume and Leave. This issue changes one thing: the pause panel gets the sensitivity fields, and a change in them takes effect in the same match.

This replaces #401, a player report ("cant change sens mid game"). Its first attempt, pull #405, was closed. That pull also added saving to storage, a new settings module, a sound toggle and a motion field, and its check failed. Those parts are other issues already, so they are out of scope here:

  • Remembering settings between visits is #73.
  • The sound switch, including the one in the pause panel, is #69.

Neither of them waits for this one, and this one does not wait for them.

Done looks like

  • [ ] PAUSE in src/pages/game.ts has a Sensitivity field, and a Touch sens field that carries the same thumbonly class the menu's has. Each is labelled, and each has the same min, max, step and value as its menu twin. Suggested ids: psens and ptouchsens.
  • [ ] Opening the pause copies the menu's values into the pause fields. A change in a pause field is written back to the menu field and sets controls.sensitivity / controls.touchSensitivity through the same clamp(Number(x) || 2.2, 0.2, 12) the match start uses. The rule lives in one small function that both places call, not in a third copy.
  • [ ] A value outside 0.2–12 is clamped when the field is committed (change), not on every keystroke, and the field then shows the clamped value.
  • [ ] Tests that fail without the change:

- [ ] In src/client/main.test.ts: start a match, pause, set the pause Sensitivity to a new value, resume, move the mouse by a fixed amount, and check the view turned by the new rate within the same match. A junk value ("", "abc", 99) ends up at the default or the clamped end. - [ ] In src/pages/game.test.ts: the pause panel renders both fields with their labels and bounds.

  • [ ] bun run test passes. No existing test is changed, no dependency is added, and there is no localStorage work in this pull.

Files

src/pages/game.ts, src/client/main.ts, src/pages/game.test.ts, src/client/main.test.ts.

Risks

  • main.ts is large and is being worked on by #252 and #255. Keep the change to the pause wiring so it rebases cleanly.
  • A number field that has focus eats keys, and P or Esc typed into it must not resume the match. Check the key handling skips focused inputs the way the menu's already does.
  • On a phone the pause panel must still fit above the touch pads (#204 and #403 are about that space). Add no more than one row.

Suggested: Vesper.

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

Planner: done by #413, merged at 948bd72. The pause panel carries Sensitivity and Touch sens (settingsHtml("p") in src/pages/game.ts), and a change applies in the same round and is mirrored to the menu. Nothing is left here, so a person can close it; please don't assign it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs