Repository navigation
Launcher: a Controls page for keys and controller buttons, and one width for the settings' buttons and controls - #39
Conversation
…dth for the settings' buttons and controls Controls (asked for in LNPANDY#27): Settings has a Controls card whose Customize... opens a sheet with every keyboard function (sticks and D-pad, then buttons and Shake) and every controller button. A key is set by clicking its field and pressing the key (Esc keeps the old one, x leaves the function on no key); one key holds one function, so the function that had it is left on none, as the host does. A controller button picks the button it sends. The layout is kept in the user defaults, and Play passes only its changes as DM_KEYMAP / DM_PAD_MAP, which the host reads from seedds/nxnative#386 on (input_map.h); a build without it ignores them. The game's own launch options win over the layout if both ever set one variable. Widths: the Settings cards' buttons all have one minimum width, so they stand in one column (Refresh, Change folder..., Check for updates, Check again). In Launch options every control has one column of one width: the two- and three-way choices share it equally, the language list fills it, and the slider with its value fits it, so the controls of a card line up whatever their labels. ControlsTests checks the defaults (nothing passed), a move onto another function's key, a swap, a move back to the default, the controller map, persistence and the labels; the visual QA capture renders the sheet.
ce38302 to
6267bb7
Compare
…ke the buttons beside it The language choice (e82f60b) was the system's pop-up menu, the one control on the Settings page in the system's look. It is the launcher's list now (LauncherMenuPicker, as in Launch options), drawn as the secondary buttons are (buttonLike) and as wide, and the App card has its divider between the two rows like the other cards.
…bel is cut At 140 pt, Left stick press and Right stick press were cut short. The lists take the keyboard rows' width (168 pt: the clear button and the key field), which fits every label and lines both columns up.
…rts are repaired The launcher's Controls page (PR #39) writes DM_KEYMAP / DM_PAD_MAP at Play, but nothing on this side read them: the page moved the fields and every game kept its default keys. This brings seedds/nxnative#386's engine side here — dm/host/input_map.h (the key and button maps, pure so a test runs without a keyboard) and front_mac.m using it in place of the fixed key_bit() switch — so the page does what it says. #386 is still open upstream, so front_mac.m and input_map.h are carriers here (OURS for the two new files, patch_front_mac() for the changed one), and the day #386 merges, a sync finds every anchor applied already. Two more things surfaced while checking the suites: * patch_nso.py had lost the NRO header skip (issue #14). It was fixed in 4b86323 and then silently reverted by a sync, because the file was not a carrier: an NRO's text starts at 0x80, and scanning from 0 read the header's build ID as instructions and skipped the last 128 bytes of text. Restored, and patch_nso.py is a carrier now (patch_patch_nso). * patch_tests_makefile() opened with `if 'romfs_arc.c' in t: return skip(...)`, which made the touch-pad test block that follows dead code ever after. Its first addition skips on its own now, so the new t_input_map rule is not skipped as well. docs/env_switches.tsv gains the rows the tool asks for (DM_KEYMAP, DM_PAD_MAP), the two it listed with no meaning (DM_FULL_ROMFS, DM_PROFILE), and the mode change PR #41 needed. Checked: t_input_map 22/22; the full host suite (make -C dm/host/tests run) exits 0; dmhost builds; the Python suite is 350 passed, 17 skipped, 0 failed (test_env_switches and test_nro_header were both failing before this); the sync reports every patcher agreeing with the tree.
|
Merged as One thing you could not have known, and it was worth the wait: the engine side of your PR did not exist in this fork. Your PR description says the host reads So I brought #386's engine side over in
I also verified the chain end to end: Two smaller notes on the diff, neither blocking:
|
…who carries them The section said a build without the engine change ignores DM_KEYMAP / DM_PAD_MAP and plays with the default keys. That was true when PR #39 was written — seedds/nxnative#386 was open and nothing here read them — but 9f7d421 carried #386's engine side into this fork, so it reads them now. It also points at docs/env_switches.tsv, where both names are listed.
Two launcher changes: the controls remapping KohlerVG asked for in #27, and one width for the buttons and controls on the Settings and Launch options screens.
Controls
Settings → Controls → Customize… opens a sheet that lists every keyboard function and every controller button. The keyboard functions come first: the sticks and D-pad, then the buttons and Shake.
DM_KEYMAP/DM_PAD_MAP. The game's own launch options win if both ever set one variable.Engine side: the host reads these from seedds/nxnative#386 on (
dm/host/input_map.h), so the sync brings it and this fork carries no engine change. A build without it ignores both variables and plays with the default keys, which the sheet's footer says.One width
Checked
swift build -c releaseis clean.swift testgives 23 tests, 0 failures. The newControlsTestscovers:NX_LAUNCHER_CAPTURE_DIR) renders the Controls sheet as well now. I checked the Settings, Launch options (with Breath of the Wild'slauncher.json) and Controls captures by eye.frontend/changes, sopr-scopehas nothing to say.Screenshots
These are rendered by the visual QA test (
NX_LAUNCHER_CAPTURE_DIR). Launch options use Breath of the Wild'slauncher.json. The Controls sheet has right stick up moved to I, so Y is on none, and A/B swapped on the controller.The controller lists now take the keyboard rows' width (
ec36d40): at 140 pt the screenshot showed "Left stick press" cut short.