Skip to content

Mac cheats: sections fold in the panel and become submenus in the menu - #2014

Open
UserDerezzed wants to merge 1 commit into
seedds:mainfrom
UserDerezzed:mac-cheat-sections
Open

UserDerezzed wants to merge 1 commit into
seedds:mainfrom
UserDerezzed:mac-cheat-sections

Conversation

@UserDerezzed

@UserDerezzed UserDerezzed commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What and why

A cheat file with many EdiZon sections ([--SectionStart:Name--] … [--SectionEnd:Name--]) made the Mac cheats panel and menu one long list. The case that prompted it is the Ocarina of Time map select from #1963: its section has 49 rows (48 locations and the Instant warp switch), so the cheats after it were a long scroll away. With this change it starts folded, and in the menu it is one submenu. This PR doesn't depend on #1963, and either can merge first. This change makes the sections fold:

  • Panel (⌘⇧C). A section header is a disclosure row: a chevron, the section name in bold, then "N cheats, M on". Clicking it folds or opens the section, and the rows inside are indented.
    • A section of more than 10 rows starts folded.
    • Each choice is stored per game build in user defaults, under DmCheatsPanel.folded.<build ID>, as {section name: folded}.
    • While a search is active, headers are plain labels and the matching rows show even in folded sections.
  • Cheats menu. Each section's cheats are in a submenu titled with the section name, cut after 60 characters, with " (N on)" when some are on. The full name is in the tooltip. This replaces the old disabled "— name —" header items.

Rows outside sections are unchanged. Labels, on/off pairs, "set" and "ask" cheats work as before. The header counts update in place as cheats are turned on and off.

The rebuild after a click is deferred to the next main-queue turn, because it removes the button whose action is still running.

docs/development.md (Cheats) describes the folders and the submenus.

Checked

  • Tests:
    • python3 -m unittest dm/tools/tests/test_docs.py passes.
    • make -C dm/host GAME=0400486024DEC000 dmhost builds.
    • dm/tools/lint_c.py tidy dm/host/front_mac.m (LLVM 23.1.1) reports 0 findings.
  • Offscreen harness: the real hle_cheats.c and front_mac.o, run on a copy of Ocarina of Time's cheat file and its .enabled file. It checked:
    • the default folds (map select folded, small sections open) and a click folding and opening a section;
    • the fold kept per build in user defaults;
    • a search showing matches in a folded section;
    • the counts;
    • the menu's submenus and their titles.
  • Games run: The Legend of Zelda: Ocarina of Time (0400486024DEC000). The panel was built into the Mac app's host, but I have not yet played with it in the game.
  • Devices and OS: MacBook Pro M3 Max.
  • regress.py: none. The change is limited to the Cheats panel and menu in front_mac.m, with no graphics, timing or HLE code, so no game's route reaches it.

Docs

  • No game files, keys or data extracted from a game in the change or the attachments

… a disclosure row with its name and how many cheats it has and how many are on, a click folds or opens it, a section of more than 10 rows starts folded, the choice is kept per build in user defaults (DmCheatsPanel.folded.<build ID>), and a search shows the matches inside folded sections; the Cheats menu puts each section's cheats in a submenu titled with its name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) mac The Mac front end and app (dm/mac, front_mac.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant