Skip to content

launcher: sub-settings that appear only when they can do anything (needs column) - #355

Closed
Xipzer wants to merge 4 commits into
seedds:mainfrom
Xipzer:launcher-needs
Closed

Xipzer wants to merge 4 commits into
seedds:mainfrom
Xipzer:launcher-needs

Conversation

@Xipzer

@Xipzer Xipzer commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

This is what is left of #316 after @v0lumehi's review. DM_FPS_HOLD is already on the screen, DM_NVN_BARRIER and DM_NVN_TBDR were correctly called developer switches and are dropped, and the render scale ceiling became #354. What remains is one column.

The problem

The screen draws every row the game supports, including rows that cannot change anything in the state the screen is in. Rumble strength is offered with Game rumble off. With #345 an upscaler's detail setting would be offered with the upscaler off. At 15 rows and growing, that is worth fixing.

The change

A ninth, optional column in settings.tsv naming a setting and a value:

DM_RUMBLE_GAIN   range  0:3:0.1  1.0  always  Controls  Rumble strength     DM_RUMBLE=1

The row is drawn only while that setting has that value, and reappears the moment it changes back.

  • A row naming a setting this game does not have stays drawn, since there is nothing for it to hide behind.
  • A section whose rows are all hidden draws no heading.
  • Hidden settings keep their values, so turning the parent off and on does not lose a choice.

Only rumble strength uses it in this PR. The column is optional, so every other row is untouched.

Changes

  • dm/ios/Sources/LauncherSettings.swift: needs on Setting, visible(_:) and rows(in:) on the model
  • dm/ios/Sources/Launcher.swift: sections draw m.rows(in:) and skip an empty one
  • dm/games/settings.py: the ninth column
  • dm/games/settings.tsv: the column documented in the header, used by rumble strength
  • dm/ios/tests/launcher_storage_check.swift: three cases (drawn while on, hidden while off, the parent stays)
  • docs/settings.md

test_launcher_storage (which compiles the Swift), test_docs, test_env_switches and test_launcher_settings all pass.

Happy to drop this if you would rather the screen stayed flat, as I said on #316. I will close #316 once this and #354 are up.

@v0lumehi

Copy link
Copy Markdown
Contributor

Sorry, I am having a hard time following. As you said, the fps hold flag is already implemented.

Your proposal is to hide flags a game doesn't use (in this case rumble an its strength which BotW doesn't use) in the launcher from the user?

@v0lumehi

v0lumehi commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Ah I think I unterstand it. When the toggle for game rumble is turned off, the strength slider disappears. That makes sense and I consider that a good change.

@v0lumehi

Copy link
Copy Markdown
Contributor

Heads-up so this doesn't get lost: 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 meta column (key=value;…) in settings.tsv, a versioned launcher.json, and one store with one precedence. needs is one of the keys in it, so #355 and #399 would no longer compete for the ninth column. Would you move needs onto it? Your view on the format is welcome there.

…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.
seedds and others added 3 commits October 27, 2026 21:39
A reader draws a section it does not know under its name, as the iPhone
app already does (sections in the order of their first rows). A new kind
stays a schema change, since a reader cannot draw it.

Co-authored-by: v0lumehi <[email protected]>
A needs value the parent row never takes (needs=DM_RUMBLE=on, when the
toggle takes 1 and 0) would hide the sub-setting for good. settings.py
now stops on it, for toggles and choices; a range or the game's languages
take any value.

Co-authored-by: v0lumehi <[email protected]>
The settings screen draws every row the game supports, including rows that
cannot change anything in the state the screen is in: Rumble strength is
offered with rumble off. A row whose launcher.json entry has needs
(<VAR>=<value>, from settings.tsv's meta column, seedds#418) is drawn only while
that setting has that value, and reappears at once when it changes back.
A row naming a setting this game does not have stays drawn, since there is
nothing for it to hide behind. A section whose rows are all hidden draws
no heading. Settings keep their values while hidden.

dm/ios/tests/launcher_storage_check.swift covers the three cases.

Co-authored-by: Xipzer <[email protected]>
seedds added a commit that referenced this pull request Oct 27, 2026
… Schema for front ends (#418, #388)

settings.tsv's ninth column becomes one optional meta column of
key=value pairs separated by ;, so the optional fields #355 (needs) and
#399 (level) wanted no longer compete for it. settings.py's META lists
the keys with the pattern each value must match. It stops on an unknown
or repeated key, a value that does not match, and a needs that names a
variable no row sets or a value that row never takes (needs=DM_RUMBLE=on,
when the toggle takes 1 and 0, would hide the row for good). The fields
go into the row of launcher.json.

launcher.json gets "schema": 1, described by docs/launcher.schema.json,
so a front end can validate the list and generate its types. Schema 1
grows only by optional fields and new sections: a reader ignores fields
it does not know and draws a section it does not know under its name, as
the iPhone app already does; a new kind would be schema 2.
docs/frontends.md documents the fields and these rules.

The five settings a front end shows first carry level=basic, and Rumble
strength carries needs=DM_RUMBLE=1.

test_launcher_settings.py checks the fields and the version, the strict
meta parsing, that META agrees with docs/frontends.md and the schema,
that the lists written for Breath of the Wild, Wonder and Hades (iOS and
Mac) conform to the schema, and that a new section conforms while a new
kind does not.

Co-authored-by: v0lumehi <[email protected]>
seedds added a commit that referenced this pull request Oct 27, 2026
The settings screen drew every row the game supports, including rows
that cannot change anything in the state the screen is in: Rumble
strength was offered with rumble off. A row whose launcher.json entry
has needs (<VAR>=<value>, from settings.tsv's meta column) is now drawn
only while that setting has that value, and reappears at once when it
changes back. A row naming a setting this game does not have stays
drawn, since there is nothing for it to hide behind. A section whose
rows are all hidden draws no heading. Settings keep their values while
hidden. launcher_storage_check.swift covers the three cases.

Co-authored-by: Xipzer <[email protected]>
@seedds

seedds commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks, @Xipzer. This landed on main as ab85f03, with you as co-author.

Following #388, needs comes from the optional meta column that #418 added (f646545), in your format: needs=DM_RUMBLE=1. So this PR's own ninth column and settings.py change were dropped. The iOS part is unchanged: visible(_:), rows(in:), no heading for an empty section, and the three cases in launcher_storage_check.swift. settings.py now also stops on a needs value the row can never take, so a typo can't hide a sub-setting for good.

test_launcher_storage (which compiles and runs the Swift check against a list written by settings.py) passes, as do the other dm/tools/tests and dm/ios/tests files. Closing this PR.

@seedds seedds closed this Oct 27, 2026
Xipzer pushed a commit to Xipzer/nxnative that referenced this pull request Oct 27, 2026
…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.
@Xipzer

Xipzer commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @seedds, and for moving it onto the meta column. Agreed on stopping at a needs value the row can never take.

Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
… Schema for front ends (seedds#418, seedds#388)

settings.tsv's ninth column becomes one optional meta column of
key=value pairs separated by ;, so the optional fields seedds#355 (needs) and
seedds#399 (level) wanted no longer compete for it. settings.py's META lists
the keys with the pattern each value must match. It stops on an unknown
or repeated key, a value that does not match, and a needs that names a
variable no row sets or a value that row never takes (needs=DM_RUMBLE=on,
when the toggle takes 1 and 0, would hide the row for good). The fields
go into the row of launcher.json.

launcher.json gets "schema": 1, described by docs/launcher.schema.json,
so a front end can validate the list and generate its types. Schema 1
grows only by optional fields and new sections: a reader ignores fields
it does not know and draws a section it does not know under its name, as
the iPhone app already does; a new kind would be schema 2.
docs/frontends.md documents the fields and these rules.

The five settings a front end shows first carry level=basic, and Rumble
strength carries needs=DM_RUMBLE=1.

test_launcher_settings.py checks the fields and the version, the strict
meta parsing, that META agrees with docs/frontends.md and the schema,
that the lists written for Breath of the Wild, Wonder and Hades (iOS and
Mac) conform to the schema, and that a new section conforms while a new
kind does not.

Co-authored-by: v0lumehi <[email protected]>
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…dds#355)

The settings screen drew every row the game supports, including rows
that cannot change anything in the state the screen is in: Rumble
strength was offered with rumble off. A row whose launcher.json entry
has needs (<VAR>=<value>, from settings.tsv's meta column) is now drawn
only while that setting has that value, and reappears at once when it
changes back. A row naming a setting this game does not have stays
drawn, since there is nothing for it to hide behind. A section whose
rows are all hidden draws no heading. Settings keep their values while
hidden. launcher_storage_check.swift covers the three cases.

Co-authored-by: Xipzer <[email protected]>
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.

3 participants