feat(menu): a Recomp Options button in the pause menu that opens the Insert menu #2304
Open
ProbBC wants to merge 9 commits from
ProbBC/menu/recomp-options into main
pull from: ProbBC/menu/recomp-options
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
2 participants
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/Hookshot!2304
Loading…
Reference in a new issue
No description provided.
Delete branch "ProbBC/menu/recomp-options"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Insert menu's settings can only be reached with a key (Insert, F1) or a pad chord, which a controller player may never find. This adds a sixth button, "Recomp Options", to the pause menu's Menu page, below Title Screen, drawn and moved to like the game's own; A on it opens the Insert menu.
What changed
nx2/pause_layout.py(new): addsPa_Button_05to everyPaSystemMenu_00layout inCommon.blarcat build time, a copy ofPa_Button_04188 units below it. The page draws only the panes its layout has (a copy made at run time is never drawn), so the layout itself gets the sixth pane. Everything that grows is appended after the end of the layout and of the archive: no other offset moves, and the prompts' runs overCommon.blarcstay valid.nx2/prompt_assets.py: writes the edited archive toprompts/Common.blarc(with aprompts/recomp_buttonmarker) and raises its entry in the resource size table.host/prompts.c: servesprompts/Common.blarcwith the button even when no prompt runs are written over it.host/oot_pause_menu.c,nx2/oot_pause_menu.py(new): when the page is made (f_80f99400) the sixth pane gets a button object like the other five, and its text ("Recomp Options", localized for pt/es/fr/it/de) is put on its text boxes. A while the cursor is on it (its state, noted atf_80ad5310) opens the Insert menu and is not passed to the game: the page's script has no end for a sixth button's decision, and passing it left the pause menu impossible to close.host/nn_hid.c: the buttons pass throughhos_pausebtn_buttons.host/nn_applet.c:hos_game_language()for the button's text.host/rx_backend.c) now exists on every platform, andhost/posix/display_sdl.cnotes each key on the look it goes down, ashost/display.c'sWM_KEYDOWNdoes on Windows. The Insert menu then reads its keys the same way on both, and the button's F1 request reaches it on Linux too.tests/test_oot_pause_menu.py(the lifted-C edits all or none; unknown layouts and archives left as they are);tests/test_linux_menu_keys.py(Linux keys reach the queue once on their way down, none while the window is not in front);tests/test_input_background.pygets a pass-through stub for the new call innpad_states.No game data is in the change: the layout is edited on the player's PC from their own files, and the original romfs is not modified.
How it was tested
Screenshots
Read through it and I like the approach: the button is a real pane added to the layout at build time from the player's own files, nothing game-derived is committed, the lift edits are all-or-none with a warning, and swallowing A (instead of letting the game see a decision its script has no end for) is the right call given the pause-menu-can't-close problem you describe. Screenshots are there, and the Linux key-queue change is small and covered by a test. Nothing blocking in the code; a few things before this can go in:
action_required, waiting on a maintainer to approve the workflow run. Only the title check is green, so the new tests are unproven in CI.build_layoutsinhost/prompts.c,size_table/maininnx2/prompt_assets.py,host/nn_hid.c,nx2/oot_patches.pyandhost/rx_backend.c. Both change howCommon.blarcis built and served (hereprompts/recomp_buttonplus a size/mtime hash; there the live reload), so whichever lands second needs a real merge, and the two should agree on who owns the served-archive key. Worth sorting out the order with the author of #2366 and @NotRexed.hos_vk_note_key_pressqueue, so it keeps working if the shortcut default changes.display_sdl.cchange now feeds every key-down into the Insert menu queue on Linux, which also means keys pressed while the menu is closed sit in the queue until it is next opened, same as on Windows today; fine, just worth a quick run by someone on Linux.Nit:
hos_pausebtn_buttonsreads the button state with a rawGP(control + 0x38)while the rest of the file usesrecomp_load*; consistent use would be a little safer if the object is ever freed whileour_controlis still set (it is cleared on the next page build, but not when the page is torn down).@hckrman101 Thanks for the review! Both points are addressed:
Button state read (nit): fixed in
9d678754.hos_pausebtn_buttonsnow reads the control's state withrecomp_load8instead of a rawGP().f_80aa2ad0, the base of the page's destructor (shared with other screens), callshos_pausebtn_goneon entry. When the page going is ours, that forgets the page, part, button and control, so nothing is read after the object is freed.tests/test_oot_pause_menu.pychecks both (no rawGP()read, and the control cleared on teardown).Overlap with #2366: merged
mainafter it landed (b5aa48ff). The conflicts were inhost/prompts.candnx2/prompt_assets.py:build_layoutsnow servesCommon.blarcon its own, so this PR's separate serving (theprompts/recomp_buttonmarker and thenruns || buttonpath) is gone. #2366 owns the served-archive key; this PR only foldsprompts/Common.blarc's size and mtime into it (layout_runs), so a build that adds the button rebuilds the served file.size_tabletakeslen(font)as in #2366 and still raises the layouts' entry by the bytes the button adds.The new test will fail on Linux once the workflows run:
tests/test_oot_pause_menu.py:130builds its include list withouthost/posix, sohost/oot_pause_menu.c:17(#include <windows.h>) isn't found. Add-I host/posixoff Windows.Also:
display_sdl.cchange routes every key-down into the Insert menu's queue, which moves Linux menu input from polled state to a queue. Nobody has run it on Linux yet.GP()nit is only fixed on paper (recomp_load8ignores its context). The real fix is thehos_pausebtn_goneteardown hook, which looks right.Whether a new entry belongs in the game's own pause menu is the maintainers' call.
This now conflicts with main in
nx2/oot_patches.py. Could you merge main into the branch (or rebase) when you get a chance? I'll take another look once it's up to date.@Joey-Magnus
Thanks! Addressed:
5cd55e09.tests/test_oot_pause_menu.pyadds-I host/posixoff Windows (astests/test_display_pointer.pydoes).GP()nit:recomp_load8is only for consistency with the rest of the file. The actual fix is thehos_pausebtn_goneteardown hook.@hckrman101 merged current
mainand fixed conflictsThanks. The Linux include fix (
5cd55e09) is right, and I'm fine with therecomp_load8reasoning, since the teardown hook is the real fix.One new problem from main: #2698 (merged this morning) keeps the button-prompt assets when nothing they're made from has changed, and
prompt_key()innx2/prompt_assets.pylists those sources. This PR'sprompt_assets.pynow importspause_layout, which isn't in that list. So after a change tonx2/pause_layout.py, a source build keeps the oldprompts/Common.blarc. Merged into main (51da0464),tests/test_prompt_skip.pycatches it:The fix is to add
"pause_layout.py"tosourceinprompt_key()and"pause_layout"tosourcesin that test. The rest oftests/run_all.pypasses here, apart from a lift-cache check that fails on main too.Still open from before: the
display_sdl.cchange moves Linux menu input from polled state to a queue, and nobody has said they ran it on Linux. A short run there (open the Insert menu from the new button, move around, bind a key) would settle it. CI hasn't built this head yet either (only the title check has run).