Repository navigation
Mac: settings window before the game starts - #379
surajmandalcell wants to merge 1 commit into
Conversation
|
Heads-up: seedds asked in #388 to agree on one settings schema and one store for player choices before the launchers are extended. I posted a proposal there (#388 (comment)): one optional |
…ON Schema front ends read Draft for the discussion in seedds#388. Two open PRs want the ninth column of settings.tsv for different things (seedds#355: needs, seedds#399: level), and seedds#379 brings its own metadata. This makes the ninth column one optional meta column of key=value pairs, so any number of optional fields fit: - settings.py's META lists the keys with the pattern each value must match (level=basic, needs=<VAR>=<value>); an unknown key, a key given twice, a value that does not match, or needs naming a variable no row sets stops settings.py. The fields go into the row of launcher.json. - launcher.json gets "schema": 1. Schema 1 grows only by optional fields: a reader ignores fields it does not know, and a field keeps its meaning. docs/launcher.schema.json describes the file as a JSON Schema, so a front end can check it and generate types from it. - The five settings a front end shows first carry level=basic, and Rumble strength carries needs=DM_RUMBLE=1, as seedds#355 has it. The platform split stays the shown column's platform:<ios|mac> (seedds#352). test_launcher_settings.py: the fields and the version in a written list, the strict meta parsing, META agreeing with docs/frontends.md and the schema, and every list written for Breath of the Wild, Wonder and Hades (iOS and Mac) conforming to the schema (a small validator for the keywords the schema uses, as CI has no jsonschema package). test_docs, test_lint_python, test_launcher_storage, test_nsp_mac_app and test_pso_offline pass.
f1b0360 to
48e481d
Compare
|
@seedds rebased onto
Still a draft until I've played a game through from the window. |
The Mac .app now shows the launcher settings from dm/games/settings.tsv before it starts dmhost: a Basic view with an Advanced settings disclosure, resolution in real pixels, and a Window / Fullscreen row. Skip it with the check box, --no-launcher or DM_LAUNCHER=0; hold Option to show it again. Builds on seedds#352.
48e481d to
8686182
Compare
A Mac app now shows its settings in a native window before the host starts (dm/mac/Launcher.swift, linked into the launcher by pack_app.py with swiftc), drawn from its launcher.json with the iOS launcher's model and rows (LauncherSettings.swift, and LauncherRow.swift, moved out of the iOS launcher to be shared). The settings marked level=basic come first; the others are under a remembered Advanced settings disclosure, in the list's usual sections, with Reset to tested defaults. The render scale shows its size in pixels for the chosen console mode when the list carries the profile's base size. Play puts the settings into the environment the host inherits; Quit, Cmd-Q and closing the window end the app without the game. The window keeps its choices in the saved-choices store (#431), so a start from a front end or with the window turned off gets the same settings. A variable the launch environment or an env file set is shown fixed and left as it is: the launcher passes the names in DM_ENV_LAUNCH_KEYS and DM_ENV_FILE_KEYS. DM_LAUNCHER=0, --no-launcher (open <app> --args --no-launcher) and "Show this window at launch" turned off skip the window, and the launcher then applies the saved choices itself; Option at launch shows it again. The window's own state is window.show and window.advanced, outside the launcher. namespace a front end resets. Display mode is a Mac row, 0=Window,1=Fullscreen. front_mac.m now reads DM_FULLSCREEN by value (any value but 0 is fullscreen), so the row needs no special empty value that unsets the variable. Changes from #379: the Mac uses the same sections and labels as the iPhone instead of its own (one list, one set of names, as #388 agreed); the level, the base size and the platform split come from the meta column, render_base and platform:mac already on main; no api field. Checked: test_launcher_storage compiles the window with the model and rows and measures the real grouped Form (Basic and Advanced, fitting and growing from the top edge) and checks Basic/Advanced rows, Display mode, the size in pixels and launch overrides shown fixed; test_nsp_mac_app checks the launcher is linked from its C and Swift sources, the reuse key covers swiftc and the Swift files, and the launch and env-file keys and --no-launcher with saved choices. A Mario Wonder Mac app packed by the NSP script showed the window from Finder (open; 12 settings), and started without it with --no-launcher played on (2,700 frames presented). Play in the live window was not clicked: this session cannot send input to it. Co-authored-by: Suraj Mandal <[email protected]>
|
Thanks, @surajmandalcell. The settings window landed on What changed from this PR:
Checked:
Closing this PR. |
…ON Schema front ends read Draft for the discussion in seedds#388. Two open PRs want the ninth column of settings.tsv for different things (seedds#355: needs, seedds#399: level), and seedds#379 brings its own metadata. This makes the ninth column one optional meta column of key=value pairs, so any number of optional fields fit: - settings.py's META lists the keys with the pattern each value must match (level=basic, needs=<VAR>=<value>); an unknown key, a key given twice, a value that does not match, or needs naming a variable no row sets stops settings.py. The fields go into the row of launcher.json. - launcher.json gets "schema": 1. Schema 1 grows only by optional fields: a reader ignores fields it does not know, and a field keeps its meaning. docs/launcher.schema.json describes the file as a JSON Schema, so a front end can check it and generate types from it. - The five settings a front end shows first carry level=basic, and Rumble strength carries needs=DM_RUMBLE=1, as seedds#355 has it. The platform split stays the shown column's platform:<ios|mac> (seedds#352). test_launcher_settings.py: the fields and the version in a written list, the strict meta parsing, META agreeing with docs/frontends.md and the schema, and every list written for Breath of the Wild, Wonder and Hades (iOS and Mac) conforming to the schema (a small validator for the keywords the schema uses, as CI has no jsonschema package). test_docs, test_lint_python, test_launcher_storage, test_nsp_mac_app and test_pso_offline pass.
…#374, seedds#388) A Mac app now shows its settings in a native window before the host starts (dm/mac/Launcher.swift, linked into the launcher by pack_app.py with swiftc), drawn from its launcher.json with the iOS launcher's model and rows (LauncherSettings.swift, and LauncherRow.swift, moved out of the iOS launcher to be shared). The settings marked level=basic come first; the others are under a remembered Advanced settings disclosure, in the list's usual sections, with Reset to tested defaults. The render scale shows its size in pixels for the chosen console mode when the list carries the profile's base size. Play puts the settings into the environment the host inherits; Quit, Cmd-Q and closing the window end the app without the game. The window keeps its choices in the saved-choices store (seedds#431), so a start from a front end or with the window turned off gets the same settings. A variable the launch environment or an env file set is shown fixed and left as it is: the launcher passes the names in DM_ENV_LAUNCH_KEYS and DM_ENV_FILE_KEYS. DM_LAUNCHER=0, --no-launcher (open <app> --args --no-launcher) and "Show this window at launch" turned off skip the window, and the launcher then applies the saved choices itself; Option at launch shows it again. The window's own state is window.show and window.advanced, outside the launcher. namespace a front end resets. Display mode is a Mac row, 0=Window,1=Fullscreen. front_mac.m now reads DM_FULLSCREEN by value (any value but 0 is fullscreen), so the row needs no special empty value that unsets the variable. Changes from seedds#379: the Mac uses the same sections and labels as the iPhone instead of its own (one list, one set of names, as seedds#388 agreed); the level, the base size and the platform split come from the meta column, render_base and platform:mac already on main; no api field. Checked: test_launcher_storage compiles the window with the model and rows and measures the real grouped Form (Basic and Advanced, fitting and growing from the top edge) and checks Basic/Advanced rows, Display mode, the size in pixels and launch overrides shown fixed; test_nsp_mac_app checks the launcher is linked from its C and Swift sources, the reuse key covers swiftc and the Swift files, and the launch and env-file keys and --no-launcher with saved choices. A Mario Wonder Mac app packed by the NSP script showed the window from Finder (open; 12 settings), and started without it with --no-launcher played on (2,700 frames presented). Play in the live window was not clicked: this session cannot send input to it. Co-authored-by: Suraj Mandal <[email protected]>
Closes #374
Builds on #418 (
metacolumn, schema 1), #399 (base) and #431 (saved choices), as agreed in #388.The Mac app shows a settings window before
dmhoststarts, drawn only fromlauncher.json: a Basic view and an Advanced settings disclosure (levelinmeta), resolution shown in pixels frombase, and a Mac-only Display mode row (DM_FULLSCREEN,platform:macinshown). Sub-settings followneeds. The iPhone keeps its single list and shares the row code (LauncherRow.swift).launcher.<VAR>in the app's domain (Saved choices: one store and one order for every way a game starts (#388) #431). A variable already set by the launch environment or anenv.txtis shown locked and never written.DM_LAUNCHER=0or--no-launcherskips only the window; saved choices still apply. The "Show this window at launch" check box (launcher.show) does the same; holding Option shows the window again.docs/frontends.mdanddocs/launcher.schema.jsonlist the newmetakey and the optionalapifield.Tests: tools 346 passed, 16 skipped; iOS 31 passed.
Open: not played through from the window yet; BotW 1.6 has no registered render-scale stub, so its Resolution row is hidden.