Skip to content

In-game menus Part A: Everything about the session one press away, the game's settings beside it - #678

Open
davdxpx wants to merge 1 commit into
igawa6:mainfrom
davdxpx:ingame-menus
Open

davdxpx wants to merge 1 commit into
igawa6:mainfrom
davdxpx:ingame-menus

Conversation

@davdxpx

@davdxpx davdxpx commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Today the game has one side panel with five text tabs, and Pause, Stop and Back to the game sit at the bottom of its last tab. This PR gives the game two menus, as a console has them: the game menu at the left for this session (back to the game, pause, back up the save, button mapping, share log, stop), and the quick menu at the right for what tunes the running game (Performance, Display, Cheats, Mods, Controls). The game keeps running behind both, and every live change shows at once.

On main 0.1.8, with no other pull request under it.

What players get

  • Home opens the game menu, Home held opens the quick menu. − and + held, Back and a swipe in from the left edge open the game menu too; a swipe in from the right edge and a long press on the on-screen controls' button open the quick menu. Home again closes either.
  • On the AYN Thor, whose Home belongs to Android (it goes to the launcher and closes the game), the controller's Back does what Home does: pressed the game menu, with the selection shown at once, held the quick menu. When a tool of the system's takes Back held for itself (a screen swap), Back still opens the game menu with the selection, and its Quick menu row opens the quick menu.
  • The game menu shows the game's cover, name, version and how long this session has run. Its rows: Back to the game, Pause the game, Quick menu, Back up the save, Button mapping, Share log. Stop the game sits apart at the bottom with the power sign and asks once, inline, with Keep playing first.
  • Back up the save while playing. The save the game runs on is copied where Back up saves puts its copies, checked before and after the copy. The host writes a save only at the game's Commit, by an atomic swap, so a Commit during the copy fails it, and it is tried again.
  • The quick menu has its tabs on a rail of icons at the left: Performance, Display, Cheats, Mods, Controls, and the menu's own settings at the bottom. Cheats and Mods are two tabs now, each only when the game has some: cheats act at once and have values, mods mostly apply at the next start. The selected tab is a block across the rail that slides to the next one. Up and down on the rail switch the tab at once, right goes into the rows, left comes back. A header with Back and the tab's name; B goes back to the game menu when that opened the quick menu.
  • A calmer, clearer look: section heads in capitals, short choices as one segmented control, switches at the row's end, a slider's value at its right, a bolder icon set for the menus (the same icons as the rest of the app, a step heavier, the seed still banana yellow).
  • Made for a controller, like a console's menus: the yellow focus frame keeps clear of the text and shows on every row and choice; the focus lands on the chosen value of a choice, not the nearest one; right from the rail goes into the rows, left from any row back to the tab on the rail; a tab's own action sits in its header with its button (the Cheats tab's X All off) instead of taking a row; a Value cheat's − and + always fit, also in the small menu size.
  • Feel: a fine vibration tick for each step and a firmer one for a choice, through the app's own haptics (it follows the system's touch feedback, battery saver and heat), and optional soft menu sounds. Both in the menu's own settings: Vibrate on each step (on) and Menu sounds (off).
  • Smooth motion: in 240 ms, decelerating, out 180 ms, on hardware layers, so the game's frames are not touched.

Pictures

The game menu (Home) Stop asks once The quick menu (Home held)
01-game-menu 02-stop-question 03-quick-menu
Cheats: All off in the header Mods The menu's own settings
04-cheats 05-mods 06-menu-settings
A choice with the controller's focus Opening and closing (clip)
07-short-choice 08-open-close

How it is built

Upstream's SidePanel stays the quick menu and keeps building its tabs. A few one-line hooks, each marked PEANUTS, hand its sheet to the rail, its tab bar to the rail, its open and close to the new motion, and what it built to the place it moved to. GameActivity gets the game menu and the keys that open it. All new code is Peanuts' own: dev.peanuts.ingame (GameMenu, Rail, Look), dev.peanuts.ui.MenuFeel and InGamePanel in the launcher's package, as ModsPanel. PEANUTS.md and peanuts/UPSTREAM-EDITS.md list every hook.

Tested

  • Thor, test app, Pokémon Legends: Z-A on a copy of the save: the controller's Back opens the game menu with the selection shown, its first D-pad press moves it; Home pressed and held on a controller with Home (BTN_MODE); this session's time in the header; Stop asks inline with Keep playing first; the quick menu over the game, L and R step the tabs, B goes back to the game menu; the focus lands on the chosen choice; each step asks the system for its tick (dumpsys vibrator_manager lists them; the Thor's own Vibration setting was off, so the system dropped them, as it should).
  • Emulator (dual-screen Thor AVD, and at phone size): the game menu opens and moves with the D-pad from the first press; Stop asks inline; the quick menu's rail switches tabs with up and down, right goes into the rows, left comes back; B goes back to the game menu when that opened it; tabs by touch; Back; a swipe in from the left edge opens the game menu (kept out of the system's back gesture); at phone size the header and Stop stay while the rows scroll.
  • peanuts/tests/test_ingame_menus.py (also the feel and the console details), test_cheat_loader.py, test_separators.py; upstream-update.sh --check; check-publish.sh; check-min-api.py on the APK.

Upstream's one in-game panel with five text tabs becomes two menus, as on a
console: everything about this session at the left, everything that tunes the
running game at the right. The game keeps running behind both.

- The game menu: the game's cover, name, version and this session's time;
  Back to the game, Pause the game, Quick menu, Back up the save (copied while
  the game runs, checked before and after the copy), Button mapping, Share log,
  and Stop the game set apart at the bottom, asked once inline.
- The quick menu: the panel's tabs on a rail of solid icons at the left
  (Performance, Display, Cheats, Mods, Controls, the menu's own settings at the
  bottom). Cheats and Mods are two tabs now. A header with Back and the tab's
  name, section heads in capitals, a slider's value at its right.
- Home pressed, - and + held, Back and a swipe in from the left edge open the
  game menu; Home held opens the quick menu, as do a swipe in from the right
  edge and a long press on the on-screen controls' button.
- Calm motion: in 240 ms decelerating, out 180 ms, on hardware layers.
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