Skip to content

Cheats: a code cheat can be a one-click action (once = true gives it the panel's Apply button) - #2023

Open
UserDerezzed wants to merge 1 commit into
seedds:mainfrom
UserDerezzed:cheat-code-once
Open

UserDerezzed wants to merge 1 commit into
seedds:mainfrom
UserDerezzed:cheat-code-once

Conversation

@UserDerezzed

@UserDerezzed UserDerezzed commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What and why

cheat_anchor.py gets once = true for code entries, by @UserDerezzed. A code cheat marked with it is applied once: the meta file's once column is 1, so the Cheats panel shows an Apply button instead of a switch, and the host runs the cheat for one pass and then turns it off. This is what action = "set" already does for a data cheat. Until now a code program could not ask for it.

[[cheat]]
name = "Warp now: Kakariko Village (child)"
section = "Warp now: child Link"
once = true
code = """..."""

once is refused on any entry other than code, on a master, and with a value other than true or false. The host side is already in main (hle_cheats.c's once, the panel's Apply, the once column in the cheats folder), so this changes only the compiler, its test and one sentence in docs/development.md.

Map select (#1963)

This is for Ocarina of Time's map select, #1963. Each of its 48 locations is a Warp now row: Apply writes the location's strings, the warp cave and its hook, then the flag that starts the warp. The game warps as from a loading zone, and the row turns itself off. As a switch, the row would stay on and warp again on every pass; once makes it a single action. #1963 carries this commit so it compiles on its own; whichever of the two merges first, the other drops it.

#2014, which folds the panel's sections, also came out of that list's length.

Checked

  • Ocarina of Time's map select as 48 once = true Warp now rows, compiled with this branch: the cheat file's words are identical to the file played, the meta file is identical except for the compile date in its header, and all 48 rows have once 1.
  • Played in the Mac app on an M3 Max: Apply on a Warp now row warped Link to the location.
  • test_cheat_anchor.py has a new test, test_code_entry_applied_once: the meta row, and the refusals on a data entry, a master and a non-boolean value.
  • python3 -m unittest dm/tools/tests/test_cheat_anchor.py dm/tools/tests/test_docs.py: pass. test_dmsh_abi.py fails on main itself: 70b9a68 added a third "?" literal to nvn_mtl.m, where its ratchet allows two.
  • No host, chain or shader change, so no regression run.

…eta's once column, the panel's Apply), as action = "set" marks a data cheat; once on another entry, on a master or with a non-boolean value is refused
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant