Repository navigation
Conversation
…ontends Settings › Library › Frontend folder: pick a folder, and the app keeps one small entry per game that is ready to play, named "<game name> [<title ID>].nutshell". A frontend such as Cocoon lists the entries as games on its next rescan and starts them through the launch alias, as it does a .nup. A game Peanuts built often has no file of its own to list (a dump folder, a .nup inside the app), so a pinned shortcut per game was the only way into a frontend's list until now. - An entry appears once a build has made the game ready to play, goes when the game leaves Home, and is renamed when the game's name changes. Picking the folder adds every game at once. - The app changes only its own entries (their text carries its marker and application ID), never another file in the folder or a subfolder. Turn off takes its entries out again. - Starting an entry is a title-ID launch (one marked line in FrontendLaunch), so it behaves as a home screen shortcut: a ready game starts at once, anything else opens Home with the game. Closes igawa6#475
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Closes #475.
A frontend such as Cocoon lists files. A game you built in Peanuts often has no file of its own it could list: it is a dump folder, or a
.nupkept inside the app. Until now, the only way into a frontend's list was one pinned shortcut per game.Settings › Library › Frontend folder fixes that. Pick a folder once, and every game that is ready to play shows up in the frontend on its next rescan. The frontend finds the cover and details by the game's name, and starting it there starts the game in this app.
1. The entries
<game name> [<title ID>].nutshell, for examplePokémon Legends Z-A [0100F43008C44000].nutshell. Characters a file name cannot hold on shared storage are left out.Peanuts Native <application ID>and the title ID. The first line is how the app knows the file is its own. The second still starts the game after someone renamed the file.2. When they change
3. Only its own files
4. Starting an entry
gamewith its path, or asACTION_VIEWwith its URI. Both aliases take it, upstream'sLaunchanddev.peanuts.launch.LaunchActivity.FrontendLaunchreads the title ID from the name, or from the text if the name has none, and then does what a home screen shortcut does. A ready game starts at once. Anything else opens Home with the game.adb shell am start -n dev.nxnative.android.peanuts/dev.nxnative.android.peanuts.Launch -e game "/storage/emulated/0/ROMs/switch/Pokémon Legends Z-A [0100F43008C44000].nutshell"nutshellgoes besidenupin its file extensions.5. The row
Code
dev.peanuts.launch.FrontendEntry, plain Java: the names, the text, and the title ID from a name or a text.dev.peanuts.launch.FrontendFolder: the sync runs on one thread, after Home's list is saved (through itsgamespreferences), after Home is first drawn, after a scan, after a build, and when a folder is picked. It also givesFrontendLaunchan entry's title ID.LibrarySettings,SettingsSections,SettingsHelp: the row, its sheet and its explanation (request code 74).PeanutsPrefs.frontendDir.LibraryandBuildService: one call each to bring the folder up to date.FrontendLaunch.onCreate(PEANUTS.md,peanuts/UPSTREAM-EDITS.mdRound 66).peanuts/docs/LAUNCHERS.md: a "Frontend folder" section.Tested
peanuts/tests/test_frontend_folder.py, with the newFrontendEntryJvmTest: the names (characters taken out, long names cut but never the title ID), the title ID from a name or from a renamed entry's text, and another app's text left alone.check-min-api.pyon the APK: nothing newer than API 33.check-publish.shandupstream-update.sh --checkpass.