Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

Three rc8 reports: the dropdown centres across the button, the cache note reads as written, and a foreground build announces itself

LNPANDY3b07d2c9d08d
diff --git a/frontend-qt/nspb_qt/localization.py b/frontend-qt/nspb_qt/localization.py
index b86ae7df..70b42877 100644
--- a/frontend-qt/nspb_qt/localization.py
+++ b/frontend-qt/nspb_qt/localization.py
@@ -216,7 +216,7 @@ TABLE: dict[str, tuple[str, str, str, str, str]] = {
'settings.note': ('游戏文件夹、构建工具和应用更新,都在这里。', 'Library location, build tools and updates.', 'Biblioteksplats, byggverktyg och uppdateringar.', 'Speicherort der Bibliothek, Build-Werkzeuge und Updates.', 'Emplacement de la bibliothèque, outils de compilation et mises à jour.'),
'shellCache.row': ('缓存文件', 'Cache files', 'Cachefiler', 'Cachedateien', 'Fichiers de cache'),
'shellCache.open': ('打开目录', 'Open folder', 'Öppna mapp', 'Ordner öffnen', 'Ouvrir le dossier'),
- 'shellCache.note': ('壳的 framework 镜像、shell.json 和横幅缓存。删除后:下次安装时每个游戏要从构建文件夹重新提供 framework;构建文件夹也删了的游戏需要重新构建。', "The shell's mirrored frameworks, its library file (shell.json) and the banner cache. Deleting it means every game's framework must come from its build folder again at the next install; a game whose build folder is also gone must be rebuilt.", 'Skalns speglade frameworks, shell.json och banner-cachen. Radering betyder: varje spels framework kommer igen från dess byggmapp vid nästa installation; är den också borta måste spelet byggas om.', 'Gespiegelte Frameworks, shell.json und der Banner-Cache. Löschen bedeutet: das Framework jedes Spiels kommt bei der nächsten Installation wieder aus dessen Build-Ordner. Ist der auch weg, muss das Spiel neu gebaut werden.', 'Les frameworks en miroir de la coque, shell.json et le cache des bannières. Les supprimer signifie que le framework de chaque jeu reviendra de son dossier de compilation à la prochaine installation ; un jeu dont le dossier a aussi disparu doit être recompilé.'),
+ 'shellCache.note': ('iPhone 端 Framework 缓存,多游戏安装需保留。删除缓存后,安装新游戏,老游戏会消失。', 'The cache of the iPhone frameworks, kept so several games can be installed. Delete it and installing a new game removes the older games from the shell.', 'iPhone-framework-cachen, bevarad för installation av flera spel. Raderar du den tar installationen av ett nytt spel bort äldre spel från skalet.', 'Der iPhone-Frameworks-Cache, aufbewahrt für die Installation mehrerer Spiele. Beim Löschen entfernt die Installation eines neuen Spiels die älteren Spiele aus der Shell.', 'Le cache des frameworks iPhone, conservé pour installer plusieurs jeux. Le supprimer fait qu’installer un nouveau jeu retire les jeux plus anciens de la coque.'),
'settings.appNote': ('为 Apple 设备构建游戏', 'Build your games for Apple devices', 'Bygg dina spel för Apple-enheter', 'Baue deine Spiele für Apple-Geräte', 'Compilez vos jeux pour les appareils Apple'),
'build.compatibility': ('兼容性选项', 'Older iPhone support', 'Stöd för äldre iPhone-modeller', 'Unterstützung für ältere iPhones', 'Prise en charge des anciens iPhone'),
'build.macNote': ('在这台 Mac 上直接运行。', 'Play directly on this Mac.', 'Spela direkt på den här Mac-datorn.', 'Direkt auf diesem Mac spielen.', 'Jouez directement sur ce Mac.'),
diff --git a/frontend/Sources/NSPortBuilder/BuildNotifications.swift b/frontend/Sources/NSPortBuilder/BuildNotifications.swift
index a2448a31..4adbbad8 100644
--- a/frontend/Sources/NSPortBuilder/BuildNotifications.swift
+++ b/frontend/Sources/NSPortBuilder/BuildNotifications.swift
@@ -27,9 +27,10 @@ enum BuildNotice {
static var hasBundleID: Bool { Bundle.main.bundleIdentifier != nil }
- /// A stopped build was stopped by someone at the app; a build in front of someone needs no notification.
+ /// A stopped build was stopped by someone at the app. The owner's rc8 report: a build that finishes while the
+ /// launcher is in front must still say so — success and failure alike, only a stop stays silent.
static func shouldNotify(_ outcome: Outcome, enabled: Bool, appActive: Bool, hasBundleID: Bool) -> Bool {
- outcome != .stopped && enabled && !appActive && hasBundleID
+ outcome != .stopped && enabled && hasBundleID
}
/// Title and body: the game, the target, and for a failure the reason (the build's own last word).
diff --git a/frontend/Sources/NSPortBuilder/LauncherDropdown.swift b/frontend/Sources/NSPortBuilder/LauncherDropdown.swift
index 31b11980..ce1a1495 100644
--- a/frontend/Sources/NSPortBuilder/LauncherDropdown.swift
+++ b/frontend/Sources/NSPortBuilder/LauncherDropdown.swift
@@ -242,14 +242,19 @@ struct LauncherDropdown: View {
let rounded = style == .button
let shape = RoundedRectangle(cornerRadius: rounded ? 9 : 99)
let width = fill ? nil : rowWidth
- return HStack(spacing: 8) {
- if fill || width != nil { Spacer(minLength: 0) } // the words centre in the space beside the chevron:
- Text(current).font(.manrope(rounded ? 13 : 12.5, .semibold)).lineLimit(1) // an equal leading spacer keeps
- .minimumScaleFactor(width == nil ? 1 : 0.85) // their centre on the button's
+ return HStack(spacing: 0) {
+ Text(current).font(.manrope(rounded ? 13 : 12.5, .semibold)).lineLimit(1)
+ .minimumScaleFactor(width == nil ? 1 : 0.85)
.fixedSize(horizontal: !fill && width == nil, vertical: false)
- if fill || width != nil { Spacer(minLength: 0) }
- Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold)).foregroundStyle(.secondary)
- .rotationEffect(.degrees(open ? 180 : 0)).frame(width: 14) // chevron reserves its width, so both spacers match
+ .frame(maxWidth: fill || width != nil ? .infinity : nil, alignment: .center) // the words centre across the whole button
+ .padding(.leading, fill || width != nil ? 14 : 0) // room so the chevron never crowds them
+ if fill || width != nil {
+ Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold)).foregroundStyle(.secondary)
+ .rotationEffect(.degrees(open ? 180 : 0)).padding(.trailing, 14)
+ } else {
+ Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold)).foregroundStyle(.secondary)
+ .rotationEffect(.degrees(open ? 180 : 0)).padding(.leading, 8)
+ }
}
.padding(.horizontal, rounded ? 15 : 14).padding(.vertical, rounded ? 9 : 7)
.frame(width: width, height: width == nil ? nil : LauncherControl.height)
diff --git a/frontend/Sources/NSPortBuilder/Localization.swift b/frontend/Sources/NSPortBuilder/Localization.swift
index 81b36e83..b5e84ee4 100644
--- a/frontend/Sources/NSPortBuilder/Localization.swift
+++ b/frontend/Sources/NSPortBuilder/Localization.swift
@@ -257,7 +257,7 @@ enum L10n {
"settings.note": ("\u{6e38}\u{620f}\u{6587}\u{4ef6}\u{5939}\u{3001}\u{6784}\u{5efa}\u{5de5}\u{5177}\u{548c}\u{5e94}\u{7528}\u{66f4}\u{65b0}\u{ff0c}\u{90fd}\u{5728}\u{8fd9}\u{91cc}\u{3002}", "Library location, build tools and updates."),
"shellCache.row": ("缓存文件", "Cache files"),
"shellCache.open": ("打开目录", "Open folder"),
- "shellCache.note": ("壳的 framework 镜像、shell.json 和横幅缓存。删除后:下次安装时每个游戏要从构建文件夹重新提供 framework;构建文件夹也删了的游戏需要重新构建。", "The shell's mirrored frameworks, its library file (shell.json) and the banner cache. Deleting it means every game's framework must come from its build folder again at the next install; a game whose build folder is also gone must be rebuilt."),
+ "shellCache.note": ("iPhone 端 Framework 缓存,多游戏安装需保留。删除缓存后,安装新游戏,老游戏会消失。", "The cache of the iPhone frameworks, kept so several games can be installed. Delete it and installing a new game removes the older games from the shell."),
"settings.appNote": ("\u{4e3a} Apple \u{8bbe}\u{5907}\u{6784}\u{5efa}\u{6e38}\u{620f}", "Build your games for Apple devices"),
"build.compatibility": ("\u{517c}\u{5bb9}\u{6027}\u{9009}\u{9879}", "Older iPhone support"),
"build.macNote": ("\u{5728}\u{8fd9}\u{53f0} Mac \u{4e0a}\u{76f4}\u{63a5}\u{8fd0}\u{884c}\u{3002}", "Play directly on this Mac."),
@@ -1257,7 +1257,7 @@ enum L10n {
"settings.heading": "Inställningar",
"shellCache.row": "Cachefiler",
"shellCache.open": "Öppna mapp",
- "shellCache.note": "Skalns speglade frameworks, shell.json och banner-cachen. Radering betyder: varje spels framework kommer igen från dess byggmapp vid nästa installation; är den också borta måste spelet byggas om.",
+ "shellCache.note": "iPhone-framework-cachen, bevarad för installation av flera spel. Raderar du den tar installationen av ett nytt spel bort äldre spel från skalet.",
"onboarding.welcome.title": "Välkommen.",
"onboarding.welcome.note": "Spela dina Switch-spel direkt på din Mac på ungefär 15 minuter.",
"onboarding.platform.title": "Var vill du spela?",
@@ -2324,7 +2324,7 @@ enum L10n {
"settings.heading": "Einstellungen",
"shellCache.row": "Cachedateien",
"shellCache.open": "Ordner öffnen",
- "shellCache.note": "Gespiegelte Frameworks, shell.json und der Banner-Cache. Löschen bedeutet: das Framework jedes Spiels kommt bei der nächsten Installation wieder aus dessen Build-Ordner. Ist der auch weg, muss das Spiel neu gebaut werden.",
+ "shellCache.note": "Der iPhone-Frameworks-Cache, aufbewahrt für die Installation mehrerer Spiele. Beim Löschen entfernt die Installation eines neuen Spiels die älteren Spiele aus der Shell.",
"settings.note": "Speicherort der Bibliothek, Build-Werkzeuge und Updates.",
"settings.appNote": "Baue deine Spiele für Apple-Geräte",
"build.compatibility": "Unterstützung für ältere iPhones",
@@ -3376,7 +3376,7 @@ enum L10n {
"settings.heading": "Réglages",
"shellCache.row": "Fichiers de cache",
"shellCache.open": "Ouvrir le dossier",
- "shellCache.note": "Les frameworks en miroir de la coque, shell.json et le cache des bannières. Les supprimer signifie que le framework de chaque jeu reviendra de son dossier de compilation à la prochaine installation ; un jeu dont le dossier a aussi disparu doit être recompilé.",
+ "shellCache.note": "Le cache des frameworks iPhone, conservé pour installer plusieurs jeux. Le supprimer fait qu’installer un nouveau jeu retire les jeux plus anciens de la coque.",
"settings.note": "Emplacement de la bibliothèque, outils de compilation et mises à jour.",
"settings.appNote": "Compilez vos jeux pour les appareils Apple",
"build.compatibility": "Prise en charge des anciens iPhone",
diff --git a/frontend/Tests/NSPortBuilderTests/BuildNotificationsTests.swift b/frontend/Tests/NSPortBuilderTests/BuildNotificationsTests.swift
index 34182f9d..c297441a 100644
--- a/frontend/Tests/NSPortBuilderTests/BuildNotificationsTests.swift
+++ b/frontend/Tests/NSPortBuilderTests/BuildNotificationsTests.swift
@@ -6,16 +6,14 @@ import SwiftUI
final class BuildNotificationsTests: XCTestCase {
private func en(_ key: String) -> String { L10n.string(key, .en) }
- func testOnlyAFinishedOrFailedBuildInTheBackgroundIsNotified() {
- let failed = BuildNotice.Outcome.failed(reason: "Build failed (exit code 1)")
- XCTAssertTrue(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: true))
- XCTAssertTrue(BuildNotice.shouldNotify(failed, enabled: true, appActive: false, hasBundleID: true))
- XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: true, appActive: true, hasBundleID: true), "a build someone is watching")
- XCTAssertFalse(BuildNotice.shouldNotify(.stopped, enabled: true, appActive: false, hasBundleID: true), "Stop was pressed at the app")
- XCTAssertFalse(BuildNotice.shouldNotify(failed, enabled: false, appActive: false, hasBundleID: true), "switched off in Settings")
- XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: false), "swift run: no bundle, no notification center")
+ func testOnlyAFinishedOrFailedBuildIsNotified() {
+ // The owner's rc8 report: a build that finishes in the foreground must announce itself too.
+ XCTAssertFalse(BuildNotice.shouldNotify(.stopped, enabled: true, appActive: true, hasBundleID: true), "a stop is silent")
+ XCTAssertTrue(BuildNotice.shouldNotify(.finished, enabled: true, appActive: true, hasBundleID: true), "success announces in the foreground")
+ XCTAssertTrue(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: true), "success announces in the background")
+ XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: false, appActive: false, hasBundleID: true), "disabled stays quiet")
+ XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: false), "no bundle ID stays quiet")
}
-
func testNotificationsAreOnUntilSwitchedOff() {
let saved = UserDefaults.standard.object(forKey: BuildNotice.defaultsKey)
defer { UserDefaults.standard.set(saved, forKey: BuildNotice.defaultsKey) }