Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

feat(setup): say what macOS asks for in Set Up; preview can open on a step

raymondchins157fbaa42409
diff --git a/app/Sources/BridgeplayApp/SetupAssistant.swift b/app/Sources/BridgeplayApp/SetupAssistant.swift
index 49178ef..684a4cd 100644
--- a/app/Sources/BridgeplayApp/SetupAssistant.swift
+++ b/app/Sources/BridgeplayApp/SetupAssistant.swift
@@ -71,7 +71,7 @@ final class SetupAssistant {
// so the assistant can be clicked through on a Mac that is already set up.
let isPreview: Bool
- init(preview: Preview? = nil) {
+ init(preview: Preview? = nil, startAt start: Step = .mac) {
isPreview = preview != nil
let located = preview == .fresh ? nil : WinecxD3DMetal.locate()
gptk = located
@@ -81,6 +81,16 @@ final class SetupAssistant {
signedIn = false
trust = .needed
}
+ // The preview can open on a later step; the steps before it count as passed, so a
+ // fresh Mac shows step 4 as someone who pressed Trust in step 3 would see it.
+ if isPreview, start != .mac {
+ step = start
+ if start.rawValue > Step.steam.rawValue {
+ rosettaInstalled = true
+ signedIn = true
+ trust = .done
+ }
+ }
}
enum Preview { case thisMac, fresh }
diff --git a/app/Sources/BridgeplayApp/Support/SetupPreview.swift b/app/Sources/BridgeplayApp/Support/SetupPreview.swift
index 6181e6e..9b3e3b5 100644
--- a/app/Sources/BridgeplayApp/Support/SetupPreview.swift
+++ b/app/Sources/BridgeplayApp/Support/SetupPreview.swift
@@ -16,6 +16,14 @@ struct SetupPreviewApp: App {
private static let mainFirst = CommandLine.arguments.contains("--main")
private let preview: SetupAssistant.Preview =
CommandLine.arguments.contains("--fresh") ? .fresh : .thisMac
+ // --step 4 opens on Set Up; numbers match the wizard's "Step N of 5".
+ private static let start: SetupAssistant.Step = {
+ let arguments = CommandLine.arguments
+ guard let index = arguments.firstIndex(of: "--step"), index + 1 < arguments.count,
+ let number = Int(arguments[index + 1]),
+ let step = SetupAssistant.Step(rawValue: number - 1) else { return .mac }
+ return step
+ }()
init() {
NSApplication.shared.setActivationPolicy(.regular)
@@ -24,7 +32,7 @@ struct SetupPreviewApp: App {
var body: some Scene {
Window("Bridgeplay Setup", id: "setup-preview") {
- PreviewWizard(preview: preview)
+ PreviewWizard(preview: preview, start: Self.start)
.environment(status)
}
.windowStyle(.hiddenTitleBar)
@@ -46,11 +54,12 @@ struct SetupPreviewApp: App {
private struct PreviewWizard: View {
let preview: SetupAssistant.Preview
+ let start: SetupAssistant.Step
@Environment(\.openWindow) private var openWindow
@Environment(\.dismissWindow) private var dismissWindow
var body: some View {
- SetupAssistantView(model: SetupAssistant(preview: preview)) {
+ SetupAssistantView(model: SetupAssistant(preview: preview, startAt: start)) {
openWindow(id: "main-preview")
dismissWindow(id: "setup-preview")
}
diff --git a/app/Sources/BridgeplayApp/Views/SetupAssistantView.swift b/app/Sources/BridgeplayApp/Views/SetupAssistantView.swift
index c3402bd..060b67d 100644
--- a/app/Sources/BridgeplayApp/Views/SetupAssistantView.swift
+++ b/app/Sources/BridgeplayApp/Views/SetupAssistantView.swift
@@ -270,6 +270,9 @@ struct SetupAssistantView: View {
private var finishStep: some View {
StepHeader(step: model.step, title: "Set up Bridgeplay",
detail: "Bridgeplay adds itself to Steam, sets up the WineCX engine and makes it Steam's default. Steam closes for a moment.")
+ if model.tasks.contains(where: { $0.state != .done }) {
+ approvals
+ }
Card {
ForEach(Array(model.tasks.enumerated()), id: \.element.id) { index, task in
if index > 0 { Hairline() }
@@ -301,6 +304,24 @@ struct SetupAssistantView: View {
}
}
+ // Told before Set Up is pressed, so the macOS dialogs that follow are expected. Signing
+ // Steam with the step 3 certificate can make macOS ask for the login password, once per
+ // signed file (the add-on, Steam's executable, Steam.app); App Management can ask too.
+ @ViewBuilder
+ private var approvals: some View {
+ Card {
+ if model.trust == .done {
+ WizardRow(row: StatusRow(title: String(localized: "Confirm the Steam update"),
+ value: String(localized: "macOS shows its usual confirmation while Steam is updated. Sign in as you do on your Mac and choose Always Allow."),
+ tone: .info))
+ Hairline()
+ }
+ WizardRow(row: StatusRow(title: String(localized: "Allow Bridgeplay in App Management"),
+ value: String(localized: "If macOS shows the switch, turn it on. Setup carries on by itself."),
+ tone: .info))
+ }
+ }
+
@ViewBuilder
private var doneStep: some View {
StepHeader(step: model.step, title: "You're all set",