Skip to content

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

Launcher: the update is a small icon at the end of the top bar

v0lumehi60aff909bd09
diff --git a/frontend-qt/nspb_qt/localization.py b/frontend-qt/nspb_qt/localization.py
index 8962222a..2aecb5cb 100644
--- a/frontend-qt/nspb_qt/localization.py
+++ b/frontend-qt/nspb_qt/localization.py
@@ -504,7 +504,7 @@ TABLE: dict[str, tuple[str, str, str, str]] = {
'app.staging': ('正在后台下载 %@…', 'Downloading %@ in the background…', 'Hämtar %@ i bakgrunden …', '%@ wird im Hintergrund geladen …'),
'app.ready': ('%@ 已下载并校验:退出 App 时安装,或点「立即重启」', '%@ is downloaded and verified: it installs when you quit, or Restart now', '%@ är hämtad och verifierad. Den installeras när du avslutar eller när du väljer Starta om nu.', '%@ ist geladen und geprüft: Es wird beim Beenden installiert, oder klicke auf „Jetzt neu starten“'),
'app.restartNow': ('立即重启', 'Restart now', 'Starta om nu', 'Jetzt neu starten'),
- 'update.pill': ('更新 v%@', 'Update v%@', 'Uppdatera v%@', 'Update v%@'),
+ 'update.pill': ('更新 %@', 'Update %@', 'Uppdatera %@', 'Update %@'),
'update.pillHelp': ('查看这个版本更新了什么,并下载。', 'See what changed in this release and download it.', 'Se vad den här versionen ändrar och hämta den.', 'Was diese Version ändert und sie laden.'),
'update.readOnlyHint': ('这个副本所在的位置无法自我更新。把 NX2Apple.app 移到「应用程序」文件夹后再更新。', 'This copy cannot update where it is. Move NX2Apple.app into Applications first.', 'Den här kopian kan inte uppdatera där den är. Flytta NX2Apple.app till Program-programmen först.', 'Diese Kopie kann sich nicht dort aktualisieren. Lege NX2Apple.app zuerst in Programme.'),
'uninstall.title': ('卸载 NX2Apple', 'Uninstall NX2Apple', 'Avinstallera NX2Apple', 'NX2Apple deinstallieren'),
diff --git a/frontend/Sources/NSPortBuilder/ConsoleView.swift b/frontend/Sources/NSPortBuilder/ConsoleView.swift
index fae42a65..36012c82 100644
--- a/frontend/Sources/NSPortBuilder/ConsoleView.swift
+++ b/frontend/Sources/NSPortBuilder/ConsoleView.swift
@@ -28,20 +28,15 @@ enum ConsoleInput {
var inputs: AnyPublisher<ConsoleInput, Never> = Empty().eraseToAnyPublisher()
/// Set by the real launcher: leaving the mode calls it instead of showing the preview's "Back on desktop" screen.
var onExit: (() -> Void)?
- /// A newer release is out (the launcher's update check): the top bar shows a pill for it. Tapping says what to do —
- /// the update itself runs from Settings, after leaving console mode.
- var updateTag: String? = nil
@StateObject private var pad = PadFocus()
@StateObject private var gamepad: LauncherGamepad
@State private var tileFrames: [String: CGRect] = [:]
- @State private var updateAlert: String?
/// The glyph set follows the input used last: a controller's own buttons, or key caps after the keyboard.
@State private var glyphs: ConsoleGlyphs
/// `gamepad` is the one the root view owns (the controller has a single handler, so two would fight); without one the view makes its own.
- init(driver: Driver, lang: Lang = .initial(), inputs: AnyPublisher<ConsoleInput, Never> = Empty().eraseToAnyPublisher(), gamepad: LauncherGamepad? = nil, glyphs: ConsoleGlyphs? = nil, onExit: (() -> Void)? = nil, updateTag: String? = nil) {
+ init(driver: Driver, lang: Lang = .initial(), inputs: AnyPublisher<ConsoleInput, Never> = Empty().eraseToAnyPublisher(), gamepad: LauncherGamepad? = nil, glyphs: ConsoleGlyphs? = nil, onExit: (() -> Void)? = nil) {
self.onExit = onExit
- self.updateTag = updateTag
_glyphs = State(initialValue: glyphs ?? .current())
self.driver = driver
self.lang = lang
@@ -129,14 +124,6 @@ enum ConsoleInput {
let inset: CGFloat = compact ? 24 : 64
return VStack(alignment: .leading, spacing: 0) {
topBar(compact: compact).padding(.horizontal, inset).padding(.top, compact ? 24 : 40)
- .alert(String(format: lang == .zh ? "更新 %@" : "Update %@", updateAlert ?? ""),
- isPresented: Binding(get: { updateAlert != nil }, set: { if !$0 { updateAlert = nil } })) {
- Button("OK") { updateAlert = nil }
- } message: {
- Text(String(format: lang == .zh
- ? "新版本 %@ 已发布。退出主机模式后,在设置 → 应用 中更新。"
- : "Version %@ is out. Leave console mode and update in Settings → App.", updateAlert ?? ""))
- }
if state.games.isEmpty {
empty(compact: compact).frame(maxWidth: .infinity, maxHeight: .infinity)
} else {
@@ -179,21 +166,6 @@ enum ConsoleInput {
private func topBar(compact: Bool) -> some View {
HStack(spacing: compact ? 12 : 20) {
ConsoleControllerChips(controllers: state.controllers, merged: state.padMerge, lang: lang, compact: compact) { driver.openControllers() }
- if let updateTag {
- Button { updateAlert = updateTag } label: {
- HStack(spacing: 6) {
- Image(systemName: "arrow.down.circle").font(.system(size: compact ? 12 : 14, weight: .medium))
- Text(String(format: lang == .zh ? "更新 %@" : lang == .de ? "Update %@" : "Update %@", updateTag))
- .font(.manrope(compact ? 13 : 15, .semibold))
- }
- .padding(.horizontal, 11).padding(.vertical, compact ? 5 : 7)
- .background(LauncherPalette.ready.opacity(0.16), in: Capsule())
- .overlay(Capsule().strokeBorder(LauncherPalette.ready.opacity(0.4)))
- .contentShape(Capsule())
- }
- .buttonStyle(.plain)
- .accessibilityLabel(String(format: lang == .zh ? "更新 %@" : "Update %@", updateTag))
- }
Text(state.time, style: .time).font(.manrope(compact ? 17 : 22, .medium)).monospacedDigit()
.foregroundStyle(.white.opacity(0.65)).fixedSize()
}
diff --git a/frontend/Sources/NSPortBuilder/LauncherView.swift b/frontend/Sources/NSPortBuilder/LauncherView.swift
index 8b64016c..b2017f68 100644
--- a/frontend/Sources/NSPortBuilder/LauncherView.swift
+++ b/frontend/Sources/NSPortBuilder/LauncherView.swift
@@ -345,27 +345,6 @@ struct ContentView: View {
.padTarget("tab." + destination.rawValue, scope: "main") { page = destination }
}
Spacer(minLength: 8)
- // The update pill: one tap opens the update sheet (what changed, download). Gone once
- // the release is installed or the app learns there is nothing newer.
- if let update = m.appUpdate {
- let readOnly = m.appInstallability == .readOnly
- Button { m.showUpdateSheet = true } label: {
- HStack(spacing: 7) {
- Image(systemName: readOnly ? "exclamationmark.arrow.circlepath" : "arrow.down.circle")
- .font(.system(size: 13, weight: .medium))
- Text(String(format: m.t("update.pill"), update.tag)).font(.manrope(13, .semibold))
- }
- .padding(.horizontal, 13).padding(.vertical, 8)
- .background((readOnly ? LauncherPalette.building : LauncherPalette.ready).opacity(0.16),
- in: Capsule())
- .overlay(Capsule().strokeBorder((readOnly ? LauncherPalette.building : LauncherPalette.ready).opacity(0.4)))
- .contentShape(Capsule())
- }
- .buttonStyle(.plain)
- .help(m.t(readOnly ? "update.readOnlyHint" : "update.pillHelp"))
- .accessibilityLabel(String(format: m.t("update.pill"), update.tag))
- .padding(.trailing, 4)
- }
searchField
Button { newBuild() } label: {
Group {
@@ -380,6 +359,22 @@ struct ContentView: View {
.buttonStyle(.plain).disabled(m.running).help(m.t("library.newBuild")).accessibilityLabel(m.t("library.newBuild"))
.padTarget("top.build", scope: "main", radius: 8) { if !m.running { newBuild() } }
.padding(.leading, 12)
+ // A newer release is out: a small icon, last in the bar, opens the update sheet. Without one the bar
+ // stays as it is.
+ if let update = m.appUpdate {
+ let readOnly = m.appInstallability == .readOnly
+ Button { m.showUpdateSheet = true } label: {
+ Image(systemName: readOnly ? "exclamationmark.arrow.circlepath" : "arrow.down.circle")
+ .font(.system(size: 18, weight: .medium))
+ .foregroundStyle(readOnly ? LauncherPalette.building : LauncherPalette.ready)
+ .frame(width: 34, height: 34).contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ .padTarget("top.update", scope: "main", radius: 17) { m.showUpdateSheet = true }
+ .padding(.leading, 16.5).padding(.trailing, -7.5)
+ .help(String(format: m.t("update.pill"), update.tag) + "\n" + m.t(readOnly ? "update.readOnlyHint" : "update.pillHelp"))
+ .accessibilityLabel(String(format: m.t("update.pill"), update.tag))
+ }
}
.padding(.leading, 90).padding(.trailing, 24)
.frame(height: 64)
diff --git a/frontend/Sources/NSPortBuilder/Localization.swift b/frontend/Sources/NSPortBuilder/Localization.swift
index 293b1c35..67d467af 100644
--- a/frontend/Sources/NSPortBuilder/Localization.swift
+++ b/frontend/Sources/NSPortBuilder/Localization.swift
@@ -565,7 +565,7 @@ enum L10n {
"app.staging": ("正在后台下载 %@…", "Downloading %@ in the background…"),
"app.ready": ("%@ 已下载并校验:退出 App 时安装,或点「立即重启」", "%@ is downloaded and verified: it installs when you quit, or Restart now"),
"app.restartNow": ("立即重启", "Restart now"),
- "update.pill": ("更新 v%@", "Update v%@"),
+ "update.pill": ("更新 %@", "Update %@"),
"update.pillHelp": ("查看这个版本更新了什么,并下载。", "See what changed in this release and download it."),
"update.readOnlyHint": ("这个副本所在的位置无法自我更新。把 NX2Apple.app 移到「应用程序」文件夹后再更新。", "This copy cannot update where it is. Move NX2Apple.app into Applications first."),
"uninstall.title": ("卸载 NX2Apple", "Uninstall NX2Apple"),
@@ -1438,7 +1438,7 @@ enum L10n {
"uninstall.button": "Avinstallera…",
"uninstall.confirm": "Skriv NX2Apple för att bekräfta. Inställningar och engine-träd tas bort och själva appen läggs i papperskorgen.",
"uninstall.done": "Tog bort %ld poster. Du kan avsluta appen nu.",
- "uninstall.failed": "Några poster kunde inte tas bort:", "update.pill": "Uppdatera v%@",
+ "uninstall.failed": "Några poster kunde inte tas bort:", "update.pill": "Uppdatera %@",
"update.pillHelp": "Se vad den här versionen ändrar och hämta den.",
"update.readOnlyHint": "Den här kopian kan inte uppdatera där den är. Flytta NX2Apple.app till Program-programmen först.",
"app.waitForBuild": "Ett bygge körs. Uppdateringen väntar tills det är klart.",
@@ -2310,7 +2310,7 @@ enum L10n {
"uninstall.button": "Deinstallieren…",
"uninstall.confirm": "Tippe NX2Apple zur Bestätigung. Einstellungen und Engine-Bäume werden entfernt, die App selbst kommt in den Papierkorb.",
"uninstall.done": "%ld Einträge entfernt. Du kannst die App jetzt beenden.",
- "uninstall.failed": "Einige Einträge konnten nicht entfernt werden:", "update.pill": "Update v%@",
+ "uninstall.failed": "Einige Einträge konnten nicht entfernt werden:", "update.pill": "Update %@",
"update.pillHelp": "Was diese Version ändert und sie laden.",
"update.readOnlyHint": "Diese Kopie kann sich nicht dort aktualisieren. Lege NX2Apple.app zuerst in Programme.",
"app.waitForBuild": "Ein Build läuft: Das Update wartet, bis er fertig ist",
diff --git a/frontend/Sources/NSPortBuilder/OnboardingRoot.swift b/frontend/Sources/NSPortBuilder/OnboardingRoot.swift
index 029e07a9..4a315ebb 100644
--- a/frontend/Sources/NSPortBuilder/OnboardingRoot.swift
+++ b/frontend/Sources/NSPortBuilder/OnboardingRoot.swift
@@ -29,8 +29,7 @@ struct RootView: View {
case .launcher:
ZStack {
if console.active {
- ConsoleView(driver: shared.console, lang: model.lang, onExit: { console.exit(); shared.console.returnFromGame() },
- updateTag: model.appUpdate?.tag)
+ ConsoleView(driver: shared.console, lang: model.lang, onExit: { console.exit(); shared.console.returnFromGame() })
.onAppear { shared.console.reloadCovers() }
.transition(CalmTransition.console)
} else {