fix(cheats): no-clip's double-tap is opt-in, and mods can show on-screen notices #3201

Merged
HumanBean merged 3 commits from HumanBean/Longshot:fix/flight-double-tap into main 2026-12-04 20:58:14 +00:00
Owner

Summary

Players found No-clip flight switching itself on while they played. Enable cheats alone armed a hidden double-tap of B (the Steam Deck's bottom A button), even with the No-clip flight row Off, so closing a text box could set Link flying. A tester hit the same thing on #3044.

On main: turn Debug > Cheats > Enable cheats on, close the menu and press B twice quickly.

This PR:

  • adds Double-tap to fly (Cheats > Movement), off at every start; without it a double-tap does nothing;
  • moves the double-tap and the climb input to X, the game's Jump;
  • ignores the double-tap during events, and while the game waits for ocarina notes (X is one);
  • logs each toggle and says it on screen;
  • adds the notice API that message uses, for every mod: notify(text, { key, seconds }) in longshot/ui and ModApi::notify in Rust (ui.hud; 3 a mod, 5 in all, 1 to 10 s, 200 characters, three lines; gone when the mod stops).

Read first: host/nn_hid.c (flight_jump_shortcut), game/crates/api/src/services/notices.rs, game/mods/cheats/src/system_mod.rs, the docs.

Testing

Tested: Linux (CachyOS, kernel 7.3.3), RTX 3090, NVIDIA 620.70.06, in a window from the kokiri-start save, played by hand on a build from before the review fixes below:

  • with only cheats on, double-tapping did nothing;
  • with Double-tap to fly on, double-tap X took off and landed (the log has 3 hid: double-tap of Jump: no-clip flight on and 2 off);
  • the on-screen message showed;
  • a double-tap during NPC dialogue did not take off.

Checks:

  • tests/test_flight_shortcut.py fails on main and passes here.
  • A mod test case calls notify() from a script (drawn, replaced by its key, gone); unit tests cover the bounds.
  • A second read-only review of the diff found no crash or threading bug; its findings (the ocarina's X, tall notices, a replaced key's place, mod check not knowing notify, docs) are fixed. Those fixes were not played.
  • The Rust tests, mod test suite and Python checks this change reaches (dev.py test-changed's list), and a Linux build. Failures that also fail on main: build-driver's the_repository_s_lock_and_the_table_agree and modtool's the_mods_tab_passes_its_tests (both run on main too). Failures in files this change does not touch, not re-run on main: longshot-builder's one_copy, tests/test_no_game_title.py (it names tests/test_lower_cs2r_depbar.py), and test_device_policy.py / test_target_reuse_memory.py (no Vulkan headers on this PC). modtool's the_menu_passes_its_tests passed in the first run with this change's menu row, then failed its per-frame CPU limit twice (a search frame 3.59 ms against 2.77 ms); not run on main.
  • Clippy on the changed crates with -A clippy::large_const_arrays: host-sys's generated settings table fails that lint, unchanged from main.

Still to test:

  • Linux or Windows, Double-tap to fly on: take the ocarina out, on the ground and mid-flight, and play X twice quickly, expecting a note each time and no take-off or landing (by hand).
  • Windows: the same take-off and landing steps as above, expecting the same (by hand).
  • Steam Deck: double-tap the top button (Y on the Deck), expecting take-off only with Double-tap to fly on (by hand).

Measurements

Verdict: the accidental take-off is gone; no frame time was measured.

Setup: the game-free test above; the in-game run in Testing. The change adds a settings lookup to the controller read and an emptiness check each frame while no notice shows.

Before: main @ a66fa5fc After: this PR @ 13c8871f
tests/test_flight_shortcut.py fails (B toggles flight with cheats alone) passes
Double-tap with only Enable cheats on (in game) flight on (a tester on #3044; not re-run here) nothing

Risks

Anyone who used the double-tap has to turn Double-tap to fly on, once each start, and press X, not B. No saved setting changes. The notice API is new public mod API. A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). Not run whole yet: only the tests this change reaches.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Linux built; Windows is left to CI.
  • Screenshots of the same spot on main and here, for a change that shows on screen. None taken.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary Players found No-clip flight switching itself on while they played. **Enable cheats** alone armed a hidden double-tap of **B** (the Steam Deck's bottom A button), even with the No-clip flight row Off, so closing a text box could set Link flying. A tester hit the same thing on #3044. On `main`: turn Debug > Cheats > Enable cheats on, close the menu and press B twice quickly. This PR: - adds **Double-tap to fly** (Cheats > Movement), off at every start; without it a double-tap does nothing; - moves the double-tap and the climb input to **X**, the game's Jump; - ignores the double-tap during events, and while the game waits for ocarina notes (X is one); - logs each toggle and says it on screen; - adds the notice API that message uses, for every mod: `notify(text, { key, seconds })` in `longshot/ui` and `ModApi::notify` in Rust (`ui.hud`; 3 a mod, 5 in all, 1 to 10 s, 200 characters, three lines; gone when the mod stops). Read first: `host/nn_hid.c` (`flight_jump_shortcut`), `game/crates/api/src/services/notices.rs`, `game/mods/cheats/src/system_mod.rs`, [the docs](docs/modding/ui.md#notices). ## Testing **Tested:** Linux (CachyOS, kernel 7.3.3), RTX 3090, NVIDIA 620.70.06, in a window from the `kokiri-start` save, played by hand on a build from before the review fixes below: - with only cheats on, double-tapping did nothing; - with Double-tap to fly on, double-tap X took off and landed (the log has 3 `hid: double-tap of Jump: no-clip flight on` and 2 `off`); - the on-screen message showed; - a double-tap during NPC dialogue did not take off. Checks: - `tests/test_flight_shortcut.py` fails on `main` and passes here. - A `mod test` case calls `notify()` from a script (drawn, replaced by its key, gone); unit tests cover the bounds. - A second read-only review of the diff found no crash or threading bug; its findings (the ocarina's X, tall notices, a replaced key's place, `mod check` not knowing `notify`, docs) are fixed. Those fixes were not played. - The Rust tests, `mod test` suite and Python checks this change reaches (`dev.py test-changed`'s list), and a Linux build. Failures that also fail on `main`: `build-driver`'s `the_repository_s_lock_and_the_table_agree` and `modtool`'s `the_mods_tab_passes_its_tests` (both run on `main` too). Failures in files this change does not touch, not re-run on `main`: `longshot-builder`'s `one_copy`, `tests/test_no_game_title.py` (it names `tests/test_lower_cs2r_depbar.py`), and `test_device_policy.py` / `test_target_reuse_memory.py` (no Vulkan headers on this PC). `modtool`'s `the_menu_passes_its_tests` passed in the first run with this change's menu row, then failed its per-frame CPU limit twice (a search frame 3.59 ms against 2.77 ms); not run on `main`. - Clippy on the changed crates with `-A clippy::large_const_arrays`: `host-sys`'s generated settings table fails that lint, unchanged from `main`. **Still to test:** - Linux or Windows, Double-tap to fly on: take the ocarina out, on the ground and mid-flight, and play X twice quickly, expecting a note each time and no take-off or landing (by hand). - Windows: the same take-off and landing steps as above, expecting the same (by hand). - Steam Deck: double-tap the top button (Y on the Deck), expecting take-off only with Double-tap to fly on (by hand). ## Measurements **Verdict:** the accidental take-off is gone; no frame time was measured. Setup: the game-free test above; the in-game run in Testing. The change adds a settings lookup to the controller read and an emptiness check each frame while no notice shows. | | Before: main @ a66fa5fc | After: this PR @ 13c8871f | |---|---|---| | `tests/test_flight_shortcut.py` | fails (B toggles flight with cheats alone) | passes | | Double-tap with only Enable cheats on (in game) | flight on (a tester on #3044; not re-run here) | nothing | ## Risks Anyone who used the double-tap has to turn **Double-tap to fly** on, once each start, and press X, not B. No saved setting changes. The notice API is new public mod API. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). Not run whole yet: only the tests this change reaches. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Linux built; Windows is left to CI. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. None taken. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
One HUD tree of the engine's own draws every mod's notices: three a mod, five
in all, 1 to 10 seconds, a key replacing the mod's earlier one; they go when
the mod stops (ui.hud).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fix(cheats): the no-clip double-tap is its own opt-in, on Jump (X)
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
PR description / Title and description (pull_request_target) Failing after 9s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 19s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m23s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 10m40s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 13m16s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m5s
CI / Website build and checks (pull_request) Failing after 40s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 47m21s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m5s
13c8871f41
Enable cheats alone armed a double-tap of B that flipped No-clip flight, so
players closing a text box began to fly.

- New row Double-tap to fly, off at every start; the shortcut needs it.
- The shortcut and the climb are on X, the game's Jump, not B.
- Nothing happens while an event plays; each toggle is logged and said on
  screen (a notice).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Author
Owner

Tested in game: Linux (CachyOS 7.3.3), RTX 3090, NVIDIA 620.70.06, played by hand from kokiri-start on a build before the last review fixes: no take-off with only Enable cheats on; with Double-tap to fly on, double-tap X took off and landed; the notice showed; no take-off during NPC dialogue.

Tested in game: Linux (CachyOS 7.3.3), RTX 3090, NVIDIA 620.70.06, played by hand from kokiri-start on a build before the last review fixes: no take-off with only Enable cheats on; with Double-tap to fly on, double-tap X took off and landed; the notice showed; no take-off during NPC dialogue.
Member

Possibly related, for context:

  • issue #3186 Game: Jump input can make Link fly when pressed and held in sequence — Open report of unintended flight on repeated jump input.
Possibly related, for context: - issue #3186 Game: Jump input can make Link fly when pressed and held in sequence — Open report of unintended flight on repeated jump input.
HumanBean changed title from WIP: fix(cheats): no-clip's double-tap is opt-in, and mods can show on-screen notices to fix(cheats): no-clip's double-tap is opt-in, and mods can show on-screen notices 2026-12-04 20:58:10 +00:00
HumanBean deleted branch fix/flight-double-tap 2026-12-04 20:58:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3201
No description provided.