Skip to content

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

Merge pull request #593 from Silverhza/fix/sidestore-shader-resources

v0lumehi64831540e3df
diff --cc frontend-ios/Sources/ShellHost/ShellHostModel.swift
index 788b39c7,6c4e6a8b..90939e30
--- a/frontend-ios/Sources/ShellHost/ShellHostModel.swift
+++ b/frontend-ios/Sources/ShellHost/ShellHostModel.swift
@@@ -455,25 -458,15 +458,27 @@@ public struct ShellHostConfig: Sendabl
// Remembered when Play is triggered, even if the launcher then fails (the stub). The order changes at the next load.
LastPlayedStore(defaults: config.defaults(id)).record(config.now())
refresh(id)
- let game = LaunchableGame(
+ var game = LaunchableGame(
titleID: id, name: entry.title, manifest: manifest, directory: entry.directory, frameworkURL: framework, dataURL: dataURL,
appFolder: appFolder(for: id), environment: launchEnvironment(profile: profile, id: id), cloudSavesURL: cloud)
- do { try await launcher.launch(game) }
- catch { notice = error.localizedDescription }
+ do {
+ game.shaderResourcesURL = try await ShaderResources.shared.prepare(game)
+ try await launcher.launch(game)
+ } catch { notice = error.localizedDescription }
}
+ /// The right-stick hint's words: a few, no semicolon, short enough for the right third of a small phone.
+ static var touchHint: String { hostText("Right stick: drag here") }
+
+ /// DM_HOME_QUIT_TEXT: the game's quit prompt in the player's language, one text per line in the engine's order (home_quit.h): the hold
+ /// indicator, the title with the game's name, the note, Quit and Cancel. The engine draws it when Quit is picked in the in-game menu (the gear)
+ /// or Home is held. The menu item reads the title without its question mark.
+ static func quitPromptText(gameName: String) -> String {
+ [hostText("Keep holding to quit"), hostText("Quit \(gameName)?"),
+ hostText("Unsaved progress will be lost. The app closes and opens on your games next time."), hostText("Quit"), hostText("Cancel")]
+ .map { $0.replacingOccurrences(of: "\n", with: " ") }.joined(separator: "\n")
+ }
+
/// A game's values for the engine: its own choices, then the shell's defaults. A game whose settings list has no
/// performance overlay row still gets the shell's choice.
func launchEnvironment(profile: LauncherProfile, id: String) -> [String: String] {