Repository navigation
Console mode: a full-screen, controller-first view of the library (view layer, previewable with NSPB_CONSOLE_DEMO), and the player-mode setting - #169
Merged
Conversation
… input, player-mode setting - Remove the 12 bundled cover JPGs and the SwiftPM resources change. The demo loads covers from the repository's docs/images through GameLibrary.artwork (the launcher's own lookup), with a generated placeholder (palette gradient and title) as the fallback. - Identity: hint glyphs follow the input used last (ConsoleGlyphs: the controller's own symbols, key caps for the keyboard, a neutral letter otherwise) instead of fixed A/B/Y/+ circles. Controller kinds are named fullSize and paired, not after a console's products. - The controller works in console mode through the launcher's LauncherGamepad (D-pad and stick move, A activates, B backs out, + and X open options, Y opens Controllers). - Home is one status row (controller chips and the clock), the focused game's title appears once, and the NX2Apple wordmark is gone. - The "Console mode" entry button, the connection prompt and the controller strip stay hidden until the console is wired, so the launcher looks as before. - New launcher setting "All controllers are player 1" (off by default, UserDefaults): Play passes DM_PAD_MERGE=1. In Settings and in the Controllers sheet. - Tests for the environment plumbing, the glyph resolution and the pad path into the view.
…ins, Starting backdrop - Focus changes cross-fade in place: the title slot has a fixed height and fades in 0.15 s, the background art fades in 0.38 s, the tile scale stays at 1.025 and the row scroll eases without overshoot. A new focus replaces the running animation. - Face buttons are read by label in one place (LauncherGamepad.face): A confirms, B backs out, Y opens Controllers. On Xbox and PlayStation that is the bottom button, on a Nintendo-layout controller the one printed A, as GameController reports them. The glyphs take the element from the same mapping. The Controls page layout for games (#70) is unchanged. - The lone glyph beside the clock is gone. - The focus ring hugs its control in console mode (PadRingStyle.hug), in the control's own shape. The desktop launcher keeps its outset ring. - Identify, Assign player and Disconnect are three equal tiles with the icon above the label. - The tile row is clipped to the page margins, and the version label has a fixed width so the platform badges do not move. - Starting shows the cover aspect-filled, blurred and darkened behind the unchanged text.
…ter version column
…ttery icon, layout fixes - LiveConsoleDriver runs the console over the real library, saved choices, GameStart.environment (shared with the desktop Play button), controllers from GameController and the player-mode setting. Starting ends when the game window takes the front, and the console comes back when the game quits. - Entry: a Console mode button in the top bar, the controller prompt (once per launch, setting to turn it off) and View, Console Mode (Option-Command-K). The window goes full screen for the mode and back. - The desktop pad hints use the same ConsoleGlyphs as the console. - Battery drawn as a proportional icon (red at 20 percent or less, bolt while charging). - Equal-width hint slots, tile focus ring and image as one unit, edge captions hidden when clipped, Starting shows only the blurred cover with the text centered. - Top nav tabs no longer change width when the selection moves (the selected tab is bold).
…r row - The connect prompt has one button row, macOS order, both buttons the launcher's standard size, glyphs of the controller in use, and a Don't ask again checkbox tied to the Settings switch. - The desktop controller chips sit in the top bar row itself, before the Console mode button, and never clip: a short bar drops the battery and folds the rest into a +N chip. - A controller with no player shows a dash in its chip, the full word stays in the Controllers list.
…versions, calmer scrolling, wide hint bar - A controller that connects without a player takes the next free one (P1, P2, ...) with a toast, so players never see Unassigned. With all four taken the toast says to open Controllers, with the button glyph. - Statuses say what this Mac can do: built for Mac is ready, built for iPhone only says iPhone only and explains how to build for Mac, then Not built yet and Needs game data. - The version comes from the Mac app, the iPhone app or the IPA, and the label is hidden only when none states one. - The row scrolls only when the focused tile would leave the visible area, by the least needed, in 0.2 s without overshoot. The title cross-fade is 0.12 s, opacity only. - Wide layout: inline hints centered as a group with the active one a cream pill. Compact keeps equal pills.
…ngs row - The controller's Home button opens console mode while the launcher is in front (GameController's preferredSystemGestureState on buttonHome, restored when the launcher is not active so a game keeps its own). Settings, Controls has a switch for it. The connect prompt and the desktop hints show the Home glyph. - The desktop shows no controller status. The Console mode button and the Home hint are at the bottom right while a controller is connected, and Settings, Controls has a Controllers row next to the player-mode switch. - Identify uses what the controller has: player lights, light bar, a rumble that keeps its haptics engine alive, and is hidden when it has none. - A battery that reports 0 with an unknown state (a DualShock 4 over Bluetooth) is shown as unknown, not as a red 0%. The levels are read again every 20 seconds.
…ment by press, battery rules - Select (buttonOptions, the system does not claim it) opens console mode from the desktop, and the desktop hint shows the controller's own glyph with Console mode. Home is not touched. The connect prompt mentions Select. Select does nothing in console mode. - Every controller GameController lists drives the launcher (per controller press edges, a handler on each physical input profile) and is published the moment its connect notification arrives, with a debug log of what macOS reports. - Picking a player turns All controllers are player 1 off. The next press from any controller takes that player, is not used to navigate, swaps the former holder to the freed number and sets the controller's player lights. B cancels, 8 seconds time out. The merge row is a switch with its state spelled out. - The battery icon is built from one geometry (outline stroked inside its frame, fill inside the inner rect, snapped to pixels) with a test. Charging and full show the bolt, an unknown or unreported battery is an outline only. - Controller chips take their own width, an overflowing row fades. The wide hint bar is spaced like the original and centered. Controllers settings row in Settings, Controls.
- A controller with no battery object is shown as wired (a plug symbol, no number). A battery object with an unknown state stays an outline. The fill grows smoothly between reads. - IOKit registry matching (no device is opened) reports game pads the moment they are plugged in. They show as Connecting until GameController reports them, or for ten seconds, and disappear on the hardware detach even before GameController lets go. GameController's connect and disconnect notifications still publish at once. - A disconnect tears down the old instance (input handler, haptics engine, Identify). A controller coming back takes its old player when that is free, and its battery is read again 2 and 5 seconds after a connect. - Debug logs with timestamps under subsystem NX2Apple, category console.controllers.
…ery logged per read - A controller without a battery object is called wired only after the object has been missing for six seconds, so a battery GameController hands over a moment after the connect shows its level (and is never labelled wired). - Battery reads happen at launch and at 2, 5 and 8 seconds after a connect, then every 20 seconds, from the current instance, and each read is logged (identity, object present, level, state) under category console.controllers.
- The IOKit watcher, the Connecting placeholders and the safety-net polling are removed. Controllers come from GCController.controllers() and the GameController connect and disconnect notifications, published at once, keyed by the instance, torn down on disconnect and rebuilt on connect. A returning controller gets its old player back. - Battery is read from the current instance on every refresh (at launch, 2 s and 5 s after a connect, then every 20 s), and a controller counts as wired only when it still has no battery object at the 5 s read. - The connect prompt's scrim ignores the safe area, so it covers the strip behind the hidden title bar as well.
…ith KVO - A controller without a usable battery reading (no battery object, or 0 with an unknown state) shows nothing: no outline, no plug, no Battery not reported. A known level shows the icon and the percentage, charging and full show the bolt. - GCDeviceBattery's batteryLevel and batteryState are key-value observed, so a change refreshes the list at once. The reads at launch, 2 s and 5 s after a connect and every 20 s stay, and each read is still logged.
…m enter and leave - Every connected controller is sent its player (player lights and light bar in a calm colour per player) once per assignment right after it connects. A DualShock 4 over Bluetooth only reports its battery after an output report, so the battery now appears without pressing Identify. No rumble on connect. - GameController posts the connect notification two or three times per connect and the disconnect twice. The handling is idempotent per instance: one entry, one toast, one set of writes, one assignment. - Entering and leaving console mode is a short calm transition (0.4 s, no bounce): the desktop settles back from 0.97 and the console arrives from a soft blur. It is sequenced with the macOS full screen animation (the content follows when the window has entered full screen, and the window leaves after the console faded out). Reduce Motion gets a plain fade.
2 tasks done
subyoung
added a commit
to subyoung/NX2Apple
that referenced
this pull request
Oct 29, 2026
Play opens the game's app and the launcher stayed where it was: after a session there was nothing in front to pick the next game with. Console mode (LNPANDY#169) already came back on its own, with its own watcher; the desktop Play did not. One watcher now serves both (GameReturnWatcher, ReturnAfterPlay.swift). The desktop Play and console mode register the process they opened, by its process ID, as LNPANDY#169 matched it; a game opened from Finder is left alone. When one quits, the caller's own bookkeeping runs (console mode ends its Starting state and keeps the selected game), and the launcher comes forward (unhidden, activated, its window in front) when Settings > App leaves "Come back when a game quits" on, the default. Console mode's own terminate observer and activation are gone, so the two ways of starting a game behave the same and the one switch covers both. The setting has its Swedish entry. Checked: swift build; swift test, 364 tests, 0 failures (ReturnAfterPlayTests: a started game comes back once, another process changes nothing, switched off the bookkeeping still runs; ConsoleLiveTests unchanged, including testStartingEndsWhenTheGameQuits).
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 players see now
Console mode works. With a controller connected, press its Select-type button (DualShock Share, DualSense Create, Xbox View, Nintendo Minus) on the desktop: the bottom hint row shows that controller's own glyph with "Console mode". You can also answer the connect prompt (once per launch, switch it off in Settings) or use View, Console Mode (Option-Command-K, since Control-Command-F is the system's full screen). The window goes full screen for the mode and goes back when you leave. The Home button is not touched, and in console mode Select does nothing special (B goes back). The desktop shows no controller status. Settings, Controls has the Controllers list (identify, assign players) and All controllers are player 1 (makes Play pass
DM_PAD_MERGE=1).What is added
A full-screen, controller-first view of the library (notes in
frontend/Console.md):LiveConsoleDriver): games and status fromGameLibrary, covers throughGameLibrary.artwork, launch options throughSavedChoices(the store LaunchOptionsView uses), controllers from GameController (kind, player, battery, connect and disconnect toasts, Identify as a short rumble when the controller has haptics). Play goes throughGameStart.environment, the function the desktop Play button now uses too, so saved choices andDM_PAD_MERGEmatch. Starting ends when the game window takes the front, and when the game quits the console comes back to the front. PR The launcher comes back to the front when a game it started quits #110 (the launcher returns to the front when a game quits) only observes the same termination and does not conflict. A Bluetooth controller cannot be dropped by an app, so Disconnect says where to do it.LauncherGamepad. D-pad and left stick move, A activates, B backs out, + and X open game options, Y opens Controllers, and the keyboard works as well. Face buttons are read by label in one place (LauncherGamepad.face): A is the bottom button on Xbox and PlayStation (the cross) and the one printed A on a Nintendo-layout controller, as GameController reports them. This also changes the desktop launcher's pad navigation from the old by-position reading. The in-game mapping setting (By label / By position, Controls: one-click layouts (Nintendo, Xbox, by label) #70) is unchanged.ConsoleGlyphs), in console mode and in the desktop pad hints: the controller's own symbols (sfSymbolsName, with a per-family table as fallback), key caps after the keyboard, a neutral letter if nothing is known. The glyph is the element the same mapping reads.docs/imagesthroughGameLibrary.artwork(for:repo:)and draws a generated placeholder when an image is missing. The first commit still carries Codex's 12 JPGs in history, so squash on merge.Demo scenarios (still available)
Identity rules
The console view is our own design, not a copy of a console home menu. No round system-button row under the tiles, no console fonts, icons, sounds or wording, no brand logos. It uses the launcher palette, Manrope and generic SF Symbols. Changed in review: the fixed A/B/Y/+ circle icons in the hint bar became glyphs that follow the controller in use, the controller kinds are named
fullSizeandpaired("Full-size pad", "Paired controllers"), and the mock "Pro controller" became "Full-size controller". There is no semicolon in any user-facing string (en or zh), and a test checks it.Screenshots (offscreen capture, 1920x1080 and compact 390 wide)
Checks
swift build -c releaseandswift testinfrontend/pass (300 tests, 11 opt-in captures skipped),python3 scripts/patches.py checkis ok, and each demo scenario starts from the release binary.Manual checks I still do
buttonOptions), glyphs for your controller family. Identify, battery, Home-free launch and the DualShock 4 were checked by the author on hardware in earlier rounds, the rest of this list has not been.GCController.controllers()and the connect and disconnect notifications), keyed by instance, published at once, torn down on disconnect and rebuilt on connect, with the old player back for a returning controller. An earlier IOKit watcher was removed because it produced a phantom "GamePad-1" entry, and a test keeps IOKit out of the controller code. Debug logs: subsystem NX2Apple, category console.controllers.Type: feature, 48h.