Skip to content

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

feat(ui): bridgeplay.dev look for the setup assistant and main window

raymondchins668cf489d258
diff --git a/NOTICE b/NOTICE
index 65a7fd2..aa8b617 100644
--- a/NOTICE
+++ b/NOTICE
@@ -101,6 +101,12 @@ The app bundle embeds Sparkle, which checks for and installs updates. Sparkle is
MIT licensed, see
https://github.com/sparkle-project/Sparkle/blob/2.10.0/LICENSE
+The app's interface uses the Geist and Unbounded typefaces, bundled in
+app/Sources/NotProtonApp/Resources/Fonts/ under the SIL Open Font License 1.1
+(OFL-Geist.txt, OFL-Unbounded.txt there). Game covers shown in the app are read
+from the user's own Steam library cache or Steam's CDN at run time; none ship
+with Bridgeplay.
+
/fonts/ contains the font sources from Valve's Proton repo. Fonts are licensed
under their original licenses, see the LICENSE file in each folder. The build
files from Proton are covered by LICENSE.fonts.
diff --git a/app/Package.swift b/app/Package.swift
index 029e6e0..8bc621a 100644
--- a/app/Package.swift
+++ b/app/Package.swift
@@ -26,6 +26,7 @@ let package = Package(
path: "Sources/NotProtonApp",
resources: (hasPayload ? [.copy("Resources/payload")] : []) + [
.process("Resources/Localization"),
+ .copy("Resources/Fonts"),
.copy("Resources/payload.manifest"),
.copy("Resources/valve-packages.manifest"),
.copy("Resources/detour2.bin"),
diff --git a/app/Sources/NotProtonApp/App.swift b/app/Sources/NotProtonApp/App.swift
index b33d0ea..1a6239b 100644
--- a/app/Sources/NotProtonApp/App.swift
+++ b/app/Sources/NotProtonApp/App.swift
@@ -19,7 +19,7 @@ struct NotProtonApp: App {
RootView(pane: $pane)
.environment(status)
.environment(prefixes)
- .frame(minWidth: 720, minHeight: 460)
+ .frame(minWidth: 800, minHeight: 600)
.onChange(of: pane) { prefixes.forgetOutcome() }
.onChange(of: status.snapshot?.installedRunners.map(\.id)) {
if prefixes.hasLoaded { Task { await prefixes.load() } }
diff --git a/app/Sources/NotProtonApp/Resources/Fonts/OFL-Geist.txt b/app/Sources/NotProtonApp/Resources/Fonts/OFL-Geist.txt
new file mode 100644
index 0000000..04e95fc
--- /dev/null
+++ b/app/Sources/NotProtonApp/Resources/Fonts/OFL-Geist.txt
@@ -0,0 +1,93 @@
+Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file
diff --git a/app/Sources/NotProtonApp/Resources/Fonts/OFL-Unbounded.txt b/app/Sources/NotProtonApp/Resources/Fonts/OFL-Unbounded.txt
new file mode 100644
index 0000000..1c7db28
--- /dev/null
+++ b/app/Sources/NotProtonApp/Resources/Fonts/OFL-Unbounded.txt
@@ -0,0 +1,93 @@
+Copyright 2022 The Unbounded Project Authors (https://github.com/googlefonts/unbounded)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/app/Sources/NotProtonApp/Resources/Fonts/geist.woff2 b/app/Sources/NotProtonApp/Resources/Fonts/geist.woff2
new file mode 100644
index 0000000..93552f5
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/Fonts/geist.woff2 differ
diff --git a/app/Sources/NotProtonApp/Resources/Fonts/unbounded.woff2 b/app/Sources/NotProtonApp/Resources/Fonts/unbounded.woff2
new file mode 100644
index 0000000..3260a19
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/Fonts/unbounded.woff2 differ
diff --git a/app/Sources/NotProtonApp/SetupAssistant.swift b/app/Sources/NotProtonApp/SetupAssistant.swift
index 98bccfd..6db1e56 100644
--- a/app/Sources/NotProtonApp/SetupAssistant.swift
+++ b/app/Sources/NotProtonApp/SetupAssistant.swift
@@ -67,10 +67,26 @@ final class SetupAssistant {
SetupTask(id: "default", title: String(localized: "Make WineCX Steam's default")),
]
- init() {
- let located = WinecxD3DMetal.locate()
+ // Set by the debug-only --setup-preview window: actions pretend instead of installing,
+ // so the assistant can be clicked through on a Mac that is already set up.
+ let isPreview: Bool
+
+ init(preview: Preview? = nil) {
+ isPreview = preview != nil
+ let located = preview == .fresh ? nil : WinecxD3DMetal.locate()
gptk = located
- gptkImages = GPTKImport.candidatesIfMissing(installed: located != nil)
+ gptkImages = preview == .fresh ? [] : GPTKImport.candidatesIfMissing(installed: located != nil)
+ if preview == .fresh {
+ rosettaInstalled = false
+ signedIn = false
+ trust = .needed
+ }
+ }
+
+ enum Preview { case thisMac, fresh }
+
+ private func pretend(_ seconds: Double = 0.9) async {
+ try? await Task.sleep(for: .seconds(seconds))
}
var macReady: Bool { appleSilicon && macOSSupported && rosettaInstalled && hasSpace }
@@ -106,6 +122,7 @@ final class SetupAssistant {
func installRosetta() async {
isWorking = true
defer { isWorking = false }
+ if isPreview { await pretend(); rosettaInstalled = true; return }
do {
try await Task.detached(priority: .userInitiated) { try SetupChecks.installRosetta() }.value
} catch {
@@ -133,6 +150,7 @@ final class SetupAssistant {
func installSteam() async {
isWorking = true
defer { isWorking = false }
+ if isPreview { await pretend(); steamInstalled = true; return }
message = nil
do {
try await SetupChecks.installSteam { _ in }
@@ -143,13 +161,14 @@ final class SetupAssistant {
}
func openSteam() {
+ if isPreview { Task { await pretend(1.5); signedIn = true }; return }
NSWorkspace.shared.open(SupportPaths.Steam.app)
watchSignIn()
}
private func watchSignIn() {
signInWatch?.cancel()
- guard !signedIn else { return }
+ guard !signedIn, !isPreview else { return }
signInWatch = Task { [weak self] in
while !Task.isCancelled {
try? await Task.sleep(for: .seconds(3))
@@ -173,6 +192,7 @@ final class SetupAssistant {
func trustThisMac() async {
guard trust != .working, trust != .done else { return }
trust = .working
+ if isPreview { await pretend(); trust = .done; return }
do {
_ = try await Task.detached(priority: .userInitiated) { try LocalSigning.ensure() }.value
trust = .done
@@ -195,6 +215,16 @@ final class SetupAssistant {
message = nil
tasks = Self.plannedTasks
+ if isPreview {
+ for task in Self.plannedTasks {
+ set(task.id, .running)
+ await pretend(1.2)
+ set(task.id, .done)
+ }
+ step = .done
+ return
+ }
+
set("steam", .running)
await status.installIntoSteam()
if let failure = status.failure {
@@ -271,12 +301,14 @@ final class SetupAssistant {
}
func openSteamAndClose() {
+ guard !isPreview else { return }
NSWorkspace.shared.open(SupportPaths.Steam.app)
}
func dismiss() {
signInWatch?.cancel()
permissionWatch?.cancel()
+ guard !isPreview else { return }
UserDefaults.standard.set(true, forKey: Self.finishedKey)
}
}
diff --git a/app/Sources/NotProtonApp/Support/Launch.swift b/app/Sources/NotProtonApp/Support/Launch.swift
index 49e7fd2..31f7862 100644
--- a/app/Sources/NotProtonApp/Support/Launch.swift
+++ b/app/Sources/NotProtonApp/Support/Launch.swift
@@ -12,6 +12,12 @@ enum Launch {
if CommandLine.arguments.dropFirst().contains(SetupWinecxCommand.flag) {
SetupWinecxCommand.run()
}
+ #if DEBUG
+ if CommandLine.arguments.dropFirst().contains(SetupPreviewApp.flag) {
+ SetupPreviewApp.main()
+ return
+ }
+ #endif
NotProtonApp.main()
}
}
diff --git a/app/Sources/NotProtonApp/Support/SetupPreview.swift b/app/Sources/NotProtonApp/Support/SetupPreview.swift
new file mode 100644
index 0000000..3a83e96
--- /dev/null
+++ b/app/Sources/NotProtonApp/Support/SetupPreview.swift
@@ -0,0 +1,59 @@
+#if DEBUG
+import AppKit
+import SwiftUI
+
+// Debug builds only: `.build/debug/NotProtonApp --setup-preview [--fresh]` opens the Setup
+// Assistant by itself for design review, then the main window once it closes. The assistant
+// reads this Mac's state and only pretends to act (--fresh shows a Mac that still needs
+// setup; --main skips straight to the main window). The main window is the real one: its
+// buttons do what they do in the app.
+struct SetupPreviewApp: App {
+ static let flag = "--setup-preview"
+
+ @State private var status = SystemStatus()
+ @State private var prefixes = PrefixesModel()
+ @State private var pane: Pane = .status
+ private static let mainFirst = CommandLine.arguments.contains("--main")
+ private let preview: SetupAssistant.Preview =
+ CommandLine.arguments.contains("--fresh") ? .fresh : .thisMac
+
+ init() {
+ NSApplication.shared.setActivationPolicy(.regular)
+ DispatchQueue.main.async { NSApp.activate() }
+ }
+
+ var body: some Scene {
+ Window("Bridgeplay Setup", id: "setup-preview") {
+ PreviewWizard(preview: preview)
+ .environment(status)
+ }
+ .windowStyle(.hiddenTitleBar)
+ .windowResizability(.contentSize)
+ .defaultLaunchBehavior(Self.mainFirst ? .suppressed : .presented)
+ .restorationBehavior(.disabled)
+
+ Window("Bridgeplay", id: "main-preview") {
+ RootView(pane: $pane)
+ .environment(status)
+ .environment(prefixes)
+ .frame(minWidth: 800, minHeight: 600)
+ }
+ .defaultSize(width: 900, height: 760)
+ .defaultLaunchBehavior(Self.mainFirst ? .presented : .suppressed)
+ .restorationBehavior(.disabled)
+ }
+}
+
+private struct PreviewWizard: View {
+ let preview: SetupAssistant.Preview
+ @Environment(\.openWindow) private var openWindow
+ @Environment(\.dismissWindow) private var dismissWindow
+
+ var body: some View {
+ SetupAssistantView(model: SetupAssistant(preview: preview)) {
+ openWindow(id: "main-preview")
+ dismissWindow(id: "setup-preview")
+ }
+ }
+}
+#endif
diff --git a/app/Sources/NotProtonApp/Views/BridgeplayTheme.swift b/app/Sources/NotProtonApp/Views/BridgeplayTheme.swift
new file mode 100644
index 0000000..29cfa64
--- /dev/null
+++ b/app/Sources/NotProtonApp/Views/BridgeplayTheme.swift
@@ -0,0 +1,179 @@
+import CoreText
+import SwiftUI
+
+// The look of bridgeplay.dev (styles.css :root) for the app's own surfaces: black canvas,
+// near-white type in Geist, hairline borders, small radii, and the violet-blue-pink
+// gradient kept for emphasis only (progress, the last step, one word of a headline).
+enum BP {
+ static let bg = Color(hex: 0x000000)
+ static let raise = Color(hex: 0x0D0D0F)
+ static let raise2 = Color(hex: 0x161618)
+ static let fg = Color(hex: 0xF5F5F7)
+ static let fg2 = Color(hex: 0xA1A1A6)
+ static let fg3 = Color(hex: 0x86868B)
+ static let line = Color.white.opacity(0.08)
+ static let lineStrong = Color.white.opacity(0.18)
+ static let violet = Color(hex: 0x8B7BFF)
+ static let blue = Color(hex: 0x4FB3FF)
+ static let pink = Color(hex: 0xFF7AC6)
+ static let green = Color(hex: 0x30D158)
+ static let orange = Color(hex: 0xFF9F0A)
+ static let red = Color(hex: 0xFF453A)
+
+ static let iridescent = LinearGradient(colors: [violet, blue, pink], startPoint: .leading, endPoint: .trailing)
+ static let iridescentDiagonal = LinearGradient(colors: [violet, blue, pink], startPoint: .topLeading, endPoint: .bottomTrailing)
+
+ static let radius: CGFloat = 12
+ static let controlRadius: CGFloat = 8
+
+ // cubic-bezier(0.16, 1, 0.3, 1), the site's --ease-out.
+ static let easeOut = Animation.timingCurve(0.16, 1, 0.3, 1, duration: 0.5)
+
+ static func sans(_ size: CGFloat, _ weight: Font.Weight = .regular) -> Font {
+ registerFonts()
+ return .custom("Geist", size: size).weight(weight)
+ }
+
+ static func display(_ size: CGFloat) -> Font {
+ registerFonts()
+ return .custom("Unbounded", size: size).weight(.semibold)
+ }
+
+ // Process-scoped, so nothing is installed on the Mac. Missing glyphs (Chinese) fall
+ // back to the system font.
+ private static let registered: Void = {
+ for name in ["geist", "unbounded"] {
+ guard let url = Bundle.module.url(forResource: name, withExtension: "woff2", subdirectory: "Fonts") else { continue }
+ CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil)
+ }
+ }()
+
+ static func registerFonts() { _ = registered }
+}
+
+extension Color {
+ init(hex: UInt32) {
+ self.init(.sRGB,
+ red: Double((hex >> 16) & 0xFF) / 255,
+ green: Double((hex >> 8) & 0xFF) / 255,
+ blue: Double(hex & 0xFF) / 255)
+ }
+}
+
+// .pill on the site: white with black text, fully round. The secondary kind is a
+// hairline capsule in the foreground colour.
+struct PillButtonStyle: ButtonStyle {
+ enum Kind { case primary, secondary, plain }
+ var kind: Kind = .primary
+ var large = false
+
+ @Environment(\.isEnabled) private var isEnabled
+
+ func makeBody(configuration: Configuration) -> some View {
+ configuration.label
+ .font(BP.sans(large ? 14 : 13, .semibold))
+ .tracking(-0.15)
+ .lineLimit(1)
+ .padding(.horizontal, kind == .plain ? 4 : (large ? 18 : 13))
+ .frame(height: large ? 34 : 28)
+ .foregroundStyle(foreground)
+ .background {
+ switch kind {
+ case .primary:
+ Capsule().fill(configuration.isPressed ? Color.white.opacity(0.85) : (isEnabled ? Color.white : BP.raise2))
+ case .secondary:
+ Capsule().fill(configuration.isPressed ? BP.raise2 : Color.clear)
+ .overlay(Capsule().strokeBorder(BP.lineStrong, lineWidth: 1))
+ case .plain:
+ Color.clear
+ }
+ }
+ .contentShape(Capsule())
+ .scaleEffect(configuration.isPressed ? 0.97 : 1)
+ .animation(.easeOut(duration: 0.18), value: configuration.isPressed)
+ }
+
+ private var foreground: Color {
+ switch kind {
+ case .primary: isEnabled ? .black : BP.fg3
+ case .secondary: isEnabled ? BP.fg : BP.fg3
+ case .plain: isEnabled ? BP.fg2 : BP.fg3.opacity(0.6)
+ }
+ }
+}
+
+extension ButtonStyle where Self == PillButtonStyle {
+ static var pill: PillButtonStyle { PillButtonStyle() }
+ static var pillLarge: PillButtonStyle { PillButtonStyle(large: true) }
+ static var pillSecondary: PillButtonStyle { PillButtonStyle(kind: .secondary) }
+ static var pillSecondaryLarge: PillButtonStyle { PillButtonStyle(kind: .secondary, large: true) }
+ static var pillPlain: PillButtonStyle { PillButtonStyle(kind: .plain, large: true) }
+}
+
+// The Bridgeplay mark (helpers/icon/bridgeplay-mark.svg) as shapes in a 24-unit box, so the
+// art can draw it in stroke by stroke: the deck and towers, the suspension cable, and the
+// cable's reflection.
+enum BridgePart { case deck, cable, echo }
+
+struct BridgeShape: Shape {
+ let part: BridgePart
+
+ func path(in rect: CGRect) -> Path {
+ let s = min(rect.width, rect.height) / 24
+ func p(_ x: CGFloat, _ y: CGFloat) -> CGPoint {
+ CGPoint(x: rect.minX + (2.4 + x * 0.8) * s, y: rect.minY + (2.4 + y * 0.8) * s)
+ }
+ var path = Path()
+ switch part {
+ case .deck:
+ path.move(to: p(2, 14)); path.addLine(to: p(22, 14))
+ path.move(to: p(6.5, 4)); path.addLine(to: p(6.5, 14))
+ path.move(to: p(17.5, 4)); path.addLine(to: p(17.5, 14))
+ case .cable:
+ path.move(to: p(2, 7))
+ path.addCurve(to: p(6.5, 4), control1: p(4.5, 7), control2: p(5.5, 4))
+ path.addCurve(to: p(12, 11), control1: p(7.5, 4), control2: p(9.5, 11))
+ path.addCurve(to: p(17.5, 4), control1: p(14.5, 11), control2: p(16.5, 4))
+ path.addCurve(to: p(22, 7), control1: p(18.5, 4), control2: p(19.5, 7))
+ case .echo:
+ path.move(to: p(6.5, 16.5)); path.addLine(to: p(6.5, 19.5))
+ path.move(to: p(17.5, 16.5)); path.addLine(to: p(17.5, 19.5))
+ path.move(to: p(2, 21))
+ path.addCurve(to: p(6.5, 19.4), control1: p(4.5, 21), control2: p(5.5, 19.4))
+ path.addCurve(to: p(12, 17.3), control1: p(7.5, 19.4), control2: p(9.5, 17.3))
+ path.addCurve(to: p(17.5, 19.4), control1: p(14.5, 17.3), control2: p(16.5, 19.4))
+ path.addCurve(to: p(22, 21), control1: p(18.5, 19.4), control2: p(19.5, 21))
+ }
+ return path
+ }
+
+ // Stroke widths from the SVG, scaled to a mark drawn `size` points wide.
+ static func width(_ part: BridgePart, size: CGFloat) -> CGFloat {
+ let unit = size / 24 * 0.8
+ switch part {
+ case .deck: return 1.8 * unit
+ case .cable: return 1.4 * unit
+ case .echo: return 1.2 * unit
+ }
+ }
+}
+
+// The mark drawn flat on its black tile, as in the nav bar and favicon.
+struct BridgeplayMark: View {
+ var size: CGFloat = 22
+
+ var body: some View {
+ ZStack {
+ BridgeShape(part: .deck)
+ .stroke(BP.fg, style: StrokeStyle(lineWidth: BridgeShape.width(.deck, size: size), lineCap: .round))
+ BridgeShape(part: .cable)
+ .stroke(BP.fg, style: StrokeStyle(lineWidth: BridgeShape.width(.cable, size: size), lineCap: .round, lineJoin: .round))
+ BridgeShape(part: .echo)
+ .stroke(BP.fg.opacity(0.35), style: StrokeStyle(lineWidth: BridgeShape.width(.echo, size: size), lineCap: .round))
+ }
+ .frame(width: size, height: size)
+ .background(RoundedRectangle(cornerRadius: size * 0.25, style: .continuous).fill(.black))
+ .overlay(RoundedRectangle(cornerRadius: size * 0.25, style: .continuous).strokeBorder(BP.lineStrong, lineWidth: 1))
+ .accessibilityHidden(true)
+ }
+}
diff --git a/app/Sources/NotProtonApp/Views/RootView.swift b/app/Sources/NotProtonApp/Views/RootView.swift
index e121290..2e68302 100644
--- a/app/Sources/NotProtonApp/Views/RootView.swift
+++ b/app/Sources/NotProtonApp/Views/RootView.swift
@@ -28,6 +28,7 @@ struct RootView: View {
@Binding var pane: Pane
@Environment(SystemStatus.self) private var status
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
var body: some View {
NavigationSplitView {
@@ -38,6 +39,33 @@ struct RootView: View {
}
}
.listStyle(.sidebar)
+ .listItemTint(.monochrome)
+ .scrollContentBackground(.hidden)
+ .background(BP.bg)
+ .safeAreaInset(edge: .top, spacing: 0) {
+ HStack(spacing: 9) {
+ BridgeplayMark(size: 22)
+ Text(verbatim: "Bridgeplay")
+ .font(BP.display(13))
+ .foregroundStyle(BP.iridescent)
+ Spacer()
+ }
+ .padding(.horizontal, 12)
+ .padding(.top, 6)
+ .padding(.bottom, 10)
+ }
+ .safeAreaInset(edge: .bottom, spacing: 0) {
+ VStack(alignment: .leading, spacing: 10) {
+ libraryCard
+ Text(verbatim: ProductVersion.display)
+ .font(BP.sans(11, .medium))
+ .foregroundStyle(BP.fg3)
+ .lineLimit(1)
+ .padding(.horizontal, 6)
+ }
+ .padding(.horizontal, 12)
+ .padding(.bottom, 12)
+ }
.navigationSplitViewColumnWidth(min: 180, ideal: 200, max: 260)
} detail: {
Group {
@@ -52,6 +80,37 @@ struct RootView: View {
PatchBanner(banner: banner)
}
}
+ .scrollContentBackground(.hidden)
+ .background(BP.bg)
+ .toolbarBackground(BP.bg, for: .windowToolbar)
+ }
+ .font(BP.sans(13))
+ .tint(BP.blue)
+ .preferredColorScheme(.dark)
+ }
+
+ // The landing page's games marquee in miniature, under the hero line.
+ private var libraryCard: some View {
+ TimelineView(.animation(minimumInterval: 1 / 30, paused: reduceMotion)) { context in
+ let t = reduceMotion ? 1.2 : context.date.timeIntervalSinceReferenceDate
+ ZStack(alignment: .bottomLeading) {
+ Aurora(t: t * 0.6, lean: 0.5)
+ GameWall(t: t * 0.8)
+ LinearGradient(stops: [.init(color: .clear, location: 0.35), .init(color: .black.opacity(0.92), location: 0.8)],
+ startPoint: .top, endPoint: .bottom)
+ VStack(alignment: .leading, spacing: 1) {
+ Text("Windows games.").foregroundStyle(BP.fg)
+ Text("In your Mac's Steam.").foregroundStyle(BP.iridescent)
+ }
+ .font(BP.sans(13, .semibold))
+ .tracking(-0.2)
+ .shadow(color: .black.opacity(0.8), radius: 6)
+ .padding(12)
+ }
}
+ .frame(height: 190)
+ .clipShape(RoundedRectangle(cornerRadius: BP.radius, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: BP.radius, style: .continuous).strokeBorder(BP.line, lineWidth: 1))
+ .accessibilityHidden(true)
}
}
diff --git a/app/Sources/NotProtonApp/Views/SetupArt.swift b/app/Sources/NotProtonApp/Views/SetupArt.swift
new file mode 100644
index 0000000..bd6d22f
--- /dev/null
+++ b/app/Sources/NotProtonApp/Views/SetupArt.swift
@@ -0,0 +1,568 @@
+import AppKit
+import SwiftUI
+
+// The Setup Assistant's art rail, in bridgeplay.dev's motifs: an aurora of the brand gradient
+// over a faint grid, the hero line, and one illustration per step (the checker's scan line,
+// the DirectX to Metal flow, the controller's rings, the bridge drawing itself in, the
+// spinning gradient edge). Reduce Motion freezes all of it on a still frame.
+struct SetupArt: View {
+ let step: SetupAssistant.Step
+ var progress: Double = 0
+ var running = false
+
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+
+ var body: some View {
+ TimelineView(.animation(paused: reduceMotion)) { context in
+ let t = reduceMotion ? 1.2 : context.date.timeIntervalSinceReferenceDate
+ ZStack {
+ Aurora(t: t, lean: Float(step.rawValue) / 4)
+ GridLines()
+ illustration(t: t)
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
+ .padding(.bottom, 70)
+ .id(step)
+ .transition(.asymmetric(insertion: .scale(scale: 0.9).combined(with: .opacity),
+ removal: .opacity))
+ VStack(alignment: .leading, spacing: 2) {
+ Spacer()
+ Text("Windows games.")
+ .foregroundStyle(BP.fg)
+ Text("In your Mac's Steam.")
+ .foregroundStyle(BP.iridescent)
+ }
+ .font(BP.sans(19, .semibold))
+ .tracking(-0.5)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(24)
+ }
+ }
+ .background(BP.bg)
+ .clipped()
+ .accessibilityHidden(true)
+ }
+
+ @ViewBuilder
+ private func illustration(t: Double) -> some View {
+ switch step {
+ case .mac: GameWall(t: t)
+ case .graphics: HUDArt(t: t)
+ case .steam: SteamArt(t: t)
+ case .finish: LightUpArt(t: t, progress: progress, running: running)
+ case .done: DoneArt(t: t)
+ }
+ }
+}
+
+// MARK: - Backdrop
+
+// The brand gradient as a slow aurora. `lean` (0...1) moves the bright pool along the
+// bottom edge; the Setup Assistant shifts it per step so moving on is felt.
+struct Aurora: View {
+ let t: Double
+ var lean: Float = 0.5
+
+ var body: some View {
+ MeshGradient(
+ width: 3, height: 3,
+ points: [
+ [0, 0], [0.5, 0], [1, 0],
+ [0, 0.45 + wave(1, 0.31)], [0.5 + wave(2, 0.27), 0.5 + wave(3, 0.23)], [1, 0.55 + wave(4, 0.29)],
+ [0, 1], [0.35 + 0.3 * lean + wave(5, 0.21), 1], [1, 1],
+ ],
+ colors: [
+ .black, .black, .black,
+ BP.violet.opacity(0.42), .black, BP.blue.opacity(0.30),
+ BP.violet.opacity(0.18), BP.pink.opacity(0.34), BP.blue.opacity(0.16),
+ ],
+ smoothsColors: true
+ )
+ .blur(radius: 20)
+ .animation(.easeInOut(duration: 0.9), value: lean)
+ }
+
+ private func wave(_ seed: Double, _ speed: Double) -> Float {
+ Float(sin(t * speed + seed) * 0.09)
+ }
+}
+
+struct GridLines: View {
+ var body: some View {
+ Canvas { context, size in
+ var path = Path()
+ let step: CGFloat = 24
+ var x: CGFloat = 0
+ while x <= size.width { path.move(to: CGPoint(x: x, y: 0)); path.addLine(to: CGPoint(x: x, y: size.height)); x += step }
+ var y: CGFloat = 0
+ while y <= size.height { path.move(to: CGPoint(x: 0, y: y)); path.addLine(to: CGPoint(x: size.width, y: y)); y += step }
+ context.stroke(path, with: .color(.white.opacity(0.045)), lineWidth: 0.5)
+ }
+ .mask(RadialGradient(colors: [.white, .clear], center: .init(x: 0.5, y: 0.4), startRadius: 10, endRadius: 260))
+ }
+}
+
+// MARK: - Steps
+
+// Check your Mac: the hero's games marquee, turned on its side. Two columns of covers drift
+// in opposite directions under the aurora.
+struct GameWall: View {
+ let t: Double
+ @State private var covers = GameCovers.shared
+
+ var body: some View {
+ let images = covers.images
+ GeometryReader { proxy in
+ // Wider and taller than the rail, so the tilt never shows an empty corner.
+ let wallWidth = proxy.size.width * 1.5
+ let wallHeight = proxy.size.height * 1.5
+ let columns = 4
+ let gap: CGFloat = 8
+ let cardWidth = (wallWidth - gap * CGFloat(columns - 1)) / CGFloat(columns)
+ HStack(alignment: .top, spacing: gap) {
+ ForEach(0..<columns, id: \.self) { column in
+ let picks = images.enumerated().filter { $0.offset % columns == column }.map(\.element)
+ self.column(picks.isEmpty ? images : picks, width: cardWidth, gap: gap, visible: wallHeight,
+ speed: column % 2 == 0 ? 12 + Double(column) : -(10 + Double(column)),
+ phase: Double(column) * 0.37)
+ }
+ }
+ .frame(width: wallWidth, height: wallHeight, alignment: .top)
+ .clipped()
+ .rotationEffect(.degrees(-10))
+ .position(x: proxy.size.width / 2, y: proxy.size.height / 2)
+ }
+ .overlay {
+ LinearGradient(stops: [.init(color: .black.opacity(0.85), location: 0), .init(color: .black.opacity(0.15), location: 0.22),
+ .init(color: .black.opacity(0.1), location: 0.55), .init(color: .black.opacity(0.95), location: 0.86)],
+ startPoint: .top, endPoint: .bottom)
+ }
+ .padding(.bottom, -70)
+ .opacity(images.isEmpty ? 0 : 1)
+ .animation(.easeOut(duration: 0.6), value: images.count)
+ .task { await covers.load() }
+ }
+
+ private func column(_ images: [NSImage], width: CGFloat, gap: CGFloat, visible: CGFloat, speed: Double, phase: Double) -> some View {
+ let height = width * 1.5
+ let span = CGFloat(max(images.count, 1)) * (height + gap)
+ // Enough copies that a full span of scrolling still fills the wall.
+ let copies = images.isEmpty ? 0 : Int((visible / span).rounded(.up)) + 2
+ let travel = (t * speed + phase * Double(span)).truncatingRemainder(dividingBy: Double(span))
+ let shift = CGFloat(travel < 0 ? travel + Double(span) : travel)
+ return VStack(spacing: gap) {
+ ForEach(0..<(images.count * copies), id: \.self) { index in
+ Image(nsImage: images[index % images.count])
+ .resizable()
+ .aspectRatio(contentMode: .fill)
+ .frame(width: width, height: height)
+ .clipShape(RoundedRectangle(cornerRadius: 6, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: 6, style: .continuous).strokeBorder(.white.opacity(0.08), lineWidth: 1))
+ }
+ }
+ .offset(y: -shift)
+ .frame(width: width, alignment: .top)
+ }
+}
+
+// Covers for the wall: the games installed in this Mac's Steam, from Steam's own library
+// cache. A Mac without them gets a fixed set from Steam's CDN, so no game art ships with
+// Bridgeplay.
+@MainActor
+@Observable
+final class GameCovers {
+ static let shared = GameCovers()
+
+ struct Cover {
+ let image: NSImage
+ let name: String?
+ }
+
+ private(set) var covers: [Cover] = []
+ var images: [NSImage] { covers.map(\.image) }
+ @ObservationIgnored private var started = false
+
+ // Windows-only games shown on bridgeplay.dev.
+ static let fallback = [1139900, 1151640, 1222700, 1364780, 1426210, 1778820, 1850570, 1888930,
+ 1971870, 2001120, 2138710, 2651280, 292030, 2968420, 3405340, 3669870]
+
+ func load() async {
+ guard !started else { return }
+ started = true
+ let local = await Task.detached(priority: .utility) { Self.localCovers(limit: 16) }.value
+ if local.count >= 6 {
+ covers = local
+ return
+ }
+ var fetched: [Cover] = local
+ await withTaskGroup(of: NSImage?.self) { group in
+ for id in Self.fallback {
+ group.addTask {
+ guard let url = URL(string: "https://cdn.cloudflare.steamstatic.com/steam/apps/\(id)/library_600x900.jpg"),
+ let (data, response) = try? await URLSession.shared.data(from: url),
+ (response as? HTTPURLResponse)?.statusCode == 200 else { return nil }
+ return NSImage(data: data)
+ }
+ }
+ for await image in group { if let image { fetched.append(Cover(image: image, name: nil)) } }
+ }
+ covers = fetched
+ }
+
+ nonisolated static func localCovers(limit: Int) -> [Cover] {
+ let cache = SupportPaths.Steam.userData.appending(path: "appcache/librarycache")
+ let fm = FileManager.default
+ var titles: [String: String?] = [:]
+ for library in PrefixStore.libraries() {
+ let names = (try? fm.contentsOfDirectory(atPath: library.steamapps.path(percentEncoded: false))) ?? []
+ for name in names where name.hasPrefix("appmanifest_") && name.hasSuffix(".acf") {
+ let id = String(name.dropFirst("appmanifest_".count).dropLast(".acf".count))
+ let text = try? String(contentsOf: library.steamapps.appending(path: name), encoding: .utf8)
+ titles[id] = text.flatMap(Self.title(inManifest:))
+ }
+ }
+ var images: [Cover] = []
+ for id in titles.keys.sorted() {
+ let folder = cache.appending(path: id)
+ let direct = folder.appending(path: "library_600x900.jpg")
+ var file: URL? = fm.fileExists(atPath: direct.path(percentEncoded: false)) ? direct : nil
+ if file == nil, let subfolders = try? fm.contentsOfDirectory(at: folder, includingPropertiesForKeys: nil) {
+ file = subfolders.lazy.map { $0.appending(path: "library_600x900.jpg") }
+ .first { fm.fileExists(atPath: $0.path(percentEncoded: false)) }
+ }
+ if let file, let image = NSImage(contentsOf: file) { images.append(Cover(image: image, name: titles[id] ?? nil)) }
+ if images.count == limit { break }
+ }
+ return images
+ }
+
+ // The "name" value of a Steam appmanifest_<id>.acf.
+ nonisolated static func title(inManifest text: String) -> String? {
+ for line in text.split(separator: "\n") {
+ let fields = line.split(separator: "\"", omittingEmptySubsequences: true)
+ .map { $0.trimmingCharacters(in: .whitespaces) }.filter { !$0.isEmpty }
+ if fields.count >= 2, fields[0] == "name" { return fields[1] }
+ }
+ return nil
+ }
+}
+
+// Graphics: the hero's look, a game on screen with the Metal HUD over it. Covers cycle from
+// the same set as the wall; the frame rate hovers around 90 like the site's demo.
+private struct HUDArt: View {
+ let t: Double
+ @State private var covers = GameCovers.shared
+
+ private static let fpsGreen = Color(hex: 0x7DFF8A)
+
+ var body: some View {
+ let images = covers.images
+ let index = images.isEmpty ? 0 : Int(t / 4).quotientAndRemainder(dividingBy: images.count).remainder
+ ZStack(alignment: .bottom) {
+ ZStack {
+ RoundedRectangle(cornerRadius: 10, style: .continuous).fill(BP.raise)
+ if !images.isEmpty {
+ Image(nsImage: images[index])
+ .resizable()
+ .aspectRatio(contentMode: .fill)
+ .id(index)
+ .transition(.opacity)
+ .animation(.easeInOut(duration: 0.8), value: index)
+ }
+ }
+ .frame(width: 172, height: 258)
+ .clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: 10, style: .continuous).strokeBorder(BP.lineStrong, lineWidth: 1))
+ .shadow(color: BP.violet.opacity(0.35), radius: 36, y: 12)
+
+ hud
+ .offset(x: 26, y: 34)
+ }
+ .padding(.trailing, 20)
+ .task { await covers.load() }
+ }
+
+ private var fps: Int {
+ Int((90 + sin(t * 1.7) * 3 + sin(t * 4.3) * 1.8).rounded())
+ }
+
+ private var hud: some View {
+ VStack(alignment: .leading, spacing: 3) {
+ row(SetupChecks.chipName, "D3DMetal")
+ row("Direct3D 12", "Metal")
+ row("MetalFX upscale", "On")
+ row("Frame generation", "2x")
+ HStack(alignment: .firstTextBaseline, spacing: 4) {
+ Text("\(fps)")
+ .font(.system(size: 18, weight: .bold, design: .monospaced))
+ .foregroundStyle(Self.fpsGreen)
+ .contentTransition(.numericText(value: Double(fps)))
+ Text(verbatim: "FPS").foregroundStyle(BP.fg3)
+ }
+ .padding(.top, 3)
+ HStack(alignment: .bottom, spacing: 1.5) {
+ ForEach(0..<22, id: \.self) { bar in
+ let past = t - Double(22 - bar) * 0.18
+ let value = 0.62 + sin(past * 1.7) * 0.12 + sin(past * 4.3) * 0.08
+ RoundedRectangle(cornerRadius: 1).fill(Self.fpsGreen.opacity(0.7))
+ .frame(height: 16 * value)
+ }
+ }
+ .frame(height: 16, alignment: .bottom)
+ }
+ .font(.system(size: 9, weight: .medium, design: .monospaced))
+ .foregroundStyle(Color(hex: 0xE8E8EA))
+ .padding(.horizontal, 10)
+ .padding(.vertical, 9)
+ .frame(width: 168)
+ .background(Color(hex: 0x0A0A0C).opacity(0.82), in: RoundedRectangle(cornerRadius: 8, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: 8, style: .continuous).strokeBorder(BP.line, lineWidth: 1))
+ .shadow(color: .black.opacity(0.6), radius: 16, y: 8)
+ }
+
+ private func row(_ key: String, _ value: String) -> some View {
+ HStack {
+ Text(verbatim: key).foregroundStyle(Color(hex: 0x9A9AA0)).lineLimit(1)
+ Spacer(minLength: 6)
+ Text(verbatim: value).lineLimit(1)
+ }
+ }
+}
+
+// Steam: the landing page's library demo. The cursor goes to Play, presses it, and the button
+// turns into Running, with "Runs with Bridgeplay" beside it.
+private struct SteamArt: View {
+ let t: Double
+ @State private var covers = GameCovers.shared
+
+ private static let green = Color(hex: 0x59BF40)
+ private static let blue = Color(hex: 0x1A9FFF)
+ private static let ink = Color(hex: 0xE6ECF2)
+ private static let muted = Color(hex: 0x8F98A0)
+
+ var body: some View {
+ let cycle = 4.2
+ let phase = t.truncatingRemainder(dividingBy: cycle) / cycle
+ let list = Array(covers.covers.prefix(4))
+ let featured = list.first
+ let running = phase > 0.49 && phase < 0.92
+ let pressed = phase > 0.47 && phase < 0.51
+ ZStack(alignment: .topLeading) {
+ VStack(alignment: .leading, spacing: 0) {
+ ZStack(alignment: .bottomLeading) {
+ Group {
+ if let featured {
+ Image(nsImage: featured.image).resizable().aspectRatio(contentMode: .fill)
+ } else {
+ LinearGradient(colors: [Color(hex: 0x2C2F4A), Color(hex: 0x12131F)], startPoint: .topLeading, endPoint: .bottomTrailing)
+ }
+ }
+ .frame(width: 204, height: 96, alignment: .top)
+ .clipped()
+ LinearGradient(colors: [.clear, Color(hex: 0x131B26)], startPoint: .center, endPoint: .bottom)
+ Text(verbatim: featured?.name ?? "Windows game")
+ .font(BP.sans(13, .semibold))
+ .foregroundStyle(Self.ink)
+ .lineLimit(1)
+ .padding(.horizontal, 10)
+ .padding(.bottom, 7)
+ }
+ .frame(width: 204, height: 96)
+
+ HStack(spacing: 10) {
+ HStack(spacing: 5) {
+ Image(systemName: "play.fill").font(.system(size: 8, weight: .bold))
+ Text(verbatim: running ? "RUNNING" : "PLAY")
+ .font(BP.sans(10, .bold))
+ .tracking(0.5)
+ }
+ .foregroundStyle(.white)
+ .frame(width: 78, height: 24)
+ .background(running ? Self.blue : Self.green, in: RoundedRectangle(cornerRadius: 2))
+ .scaleEffect(pressed ? 0.95 : 1)
+ .animation(.easeOut(duration: 0.15), value: running)
+ VStack(alignment: .leading, spacing: 1) {
+ Text(verbatim: "RUNS WITH").font(BP.sans(8, .semibold)).tracking(0.4).foregroundStyle(Self.muted)
+ Text(verbatim: "Bridgeplay").font(BP.sans(11, .semibold)).foregroundStyle(BP.iridescent)
+ }
+ }
+ .padding(.horizontal, 10)
+ .padding(.vertical, 10)
+
+ Rectangle().fill(.white.opacity(0.06)).frame(height: 1)
+
+ VStack(alignment: .leading, spacing: 2) {
+ Text(verbatim: "LIBRARY")
+ .font(BP.sans(8, .semibold)).tracking(0.5).foregroundStyle(Self.muted)
+ .padding(.horizontal, 6).padding(.bottom, 3)
+ ForEach(Array(list.enumerated()), id: \.offset) { index, cover in
+ HStack(spacing: 8) {
+ Image(nsImage: cover.image).resizable().aspectRatio(contentMode: .fill)
+ .frame(width: 16, height: 16).clipShape(RoundedRectangle(cornerRadius: 2))
+ Text(verbatim: cover.name ?? " ")
+ .font(BP.sans(10, .medium))
+ .foregroundStyle(index == 0 ? Self.ink : Self.muted)
+ .lineLimit(1)
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, 6).padding(.vertical, 3)
+ .background(index == 0 ? Color.white.opacity(0.07) : .clear, in: RoundedRectangle(cornerRadius: 4))
+ }
+ }
+ .padding(8)
+ }
+ .frame(width: 204)
+ .background(LinearGradient(colors: [Color(hex: 0x1B2838), Color(hex: 0x131B26)], startPoint: .top, endPoint: .bottom))
+ .clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: 10, style: .continuous).strokeBorder(.white.opacity(0.1), lineWidth: 1))
+ .shadow(color: BP.blue.opacity(running ? 0.45 : 0.2), radius: 36, y: 12)
+ .animation(.easeOut(duration: 0.4), value: running)
+
+ cursor(phase: phase)
+ }
+ .frame(width: 204)
+ .task { await covers.load() }
+ }
+
+ // cursor-go: in from the top right, onto Play, a press, a pause, then gone.
+ private func cursor(phase: Double) -> some View {
+ let start = CGPoint(x: 170, y: 40)
+ let end = CGPoint(x: 52, y: 112)
+ let travel = min(1, phase / 0.42)
+ let eased = 1 - pow(1 - travel, 3)
+ let x = start.x + (end.x - start.x) * eased
+ let y = start.y + (end.y - start.y) * eased
+ let opacity = phase < 0.1 ? phase / 0.1 : (phase > 0.9 ? max(0, (1 - phase) / 0.1) : 1)
+ return CursorShape()
+ .fill(.white)
+ .overlay(CursorShape().stroke(.black, lineWidth: 1))
+ .frame(width: 16, height: 16)
+ .scaleEffect(phase > 0.47 && phase < 0.52 ? 0.82 : 1)
+ .shadow(color: .black.opacity(0.6), radius: 3, y: 2)
+ .offset(x: x, y: y)
+ .opacity(opacity)
+ }
+}
+
+private struct CursorShape: Shape {
+ func path(in rect: CGRect) -> Path {
+ let s = rect.width / 24
+ func p(_ x: CGFloat, _ y: CGFloat) -> CGPoint { CGPoint(x: rect.minX + x * s, y: rect.minY + y * s) }
+ var path = Path()
+ path.move(to: p(5, 3.2)); path.addLine(to: p(5, 18.8)); path.addLine(to: p(9.3, 14.7))
+ path.addLine(to: p(12, 20.8)); path.addLine(to: p(14.6, 19.7)); path.addLine(to: p(11.9, 13.7))
+ path.addLine(to: p(17.9, 13.7)); path.closeSubpath()
+ return path
+ }
+}
+
+// Set Up: a tilted grid of the library's covers, dimmed. Each finished task lights its share
+// of them in colour; a band of light sweeps across while setup works.
+private struct LightUpArt: View {
+ let t: Double
+ let progress: Double
+ let running: Bool
+ @State private var covers = GameCovers.shared
+
+ private let columns = 4
+ private let rows = 5
+ // A fixed scatter, so tiles light across the grid rather than row by row.
+ private static let order = [7, 2, 13, 18, 4, 11, 0, 16, 9, 14, 6, 19, 1, 12, 17, 3, 10, 15, 5, 8]
+
+ var body: some View {
+ let images = covers.images
+ let count = columns * rows
+ let lit = Int((progress * Double(count)).rounded())
+ GeometryReader { proxy in
+ let width = proxy.size.width * 1.45
+ let gap: CGFloat = 8
+ let tile = (width - gap * CGFloat(columns - 1)) / CGFloat(columns)
+ ZStack {
+ VStack(spacing: gap) {
+ ForEach(0..<rows, id: \.self) { row in
+ HStack(spacing: gap) {
+ ForEach(0..<columns, id: \.self) { column in
+ let index = row * columns + column
+ let on = (Self.order.firstIndex(of: index) ?? count) < lit
+ cover(images, index: index, on: on, size: CGSize(width: tile, height: tile * 1.5))
+ }
+ }
+ .offset(x: row.isMultiple(of: 2) ? 0 : tile * 0.35)
+ }
+ }
+ if running {
+ let sweep = (t / 2.2).truncatingRemainder(dividingBy: 1)
+ LinearGradient(colors: [.clear, .white.opacity(0.16), BP.blue.opacity(0.12), .clear],
+ startPoint: .leading, endPoint: .trailing)
+ .frame(width: 120)
+ .blendMode(.plusLighter)
+ .offset(x: (sweep * 2 - 1) * width * 0.7)
+ }
+ }
+ .frame(width: width)
+ .rotationEffect(.degrees(-10))
+ .position(x: proxy.size.width / 2, y: proxy.size.height / 2 - 20)
+ }
+ .overlay {
+ LinearGradient(stops: [.init(color: .black.opacity(0.85), location: 0), .init(color: .black.opacity(0.1), location: 0.22),
+ .init(color: .black.opacity(0.1), location: 0.55), .init(color: .black.opacity(0.95), location: 0.86)],
+ startPoint: .top, endPoint: .bottom)
+ }
+ .padding(.bottom, -70)
+ .animation(.easeOut(duration: 0.7), value: lit)
+ .task { await covers.load() }
+ }
+
+ @ViewBuilder
+ private func cover(_ images: [NSImage], index: Int, on: Bool, size: CGSize) -> some View {
+ ZStack {
+ RoundedRectangle(cornerRadius: 6, style: .continuous).fill(BP.raise2)
+ if !images.isEmpty {
+ Image(nsImage: images[index % images.count])
+ .resizable()
+ .aspectRatio(contentMode: .fill)
+ .saturation(on ? 1 : 0)
+ .opacity(on ? 1 : 0.28)
+ }
+ }
+ .frame(width: size.width, height: size.height)
+ .clipShape(RoundedRectangle(cornerRadius: 6, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: 6, style: .continuous)
+ .strokeBorder(on ? AnyShapeStyle(BP.iridescentDiagonal) : AnyShapeStyle(Color.white.opacity(0.06)), lineWidth: on ? 1.2 : 1))
+ .shadow(color: on ? BP.violet.opacity(0.35) : .clear, radius: 10)
+ .scaleEffect(on ? 1 : 0.96)
+ }
+}
+
+// Done: the finished mark on its tile, the gradient edge turning (hl-spin) and a soft glow.
+private struct DoneArt: View {
+ let t: Double
+
+ var body: some View {
+ ZStack {
+ Circle()
+ .fill(RadialGradient(colors: [BP.violet.opacity(0.45), BP.blue.opacity(0.15), .clear], center: .center, startRadius: 0, endRadius: 120))
+ .frame(width: 260, height: 260)
+ .scaleEffect(1 + sin(t * 1.2) * 0.04)
+ RoundedRectangle(cornerRadius: 30, style: .continuous)
+ .fill(.black)
+ .frame(width: 124, height: 124)
+ .overlay {
+ RoundedRectangle(cornerRadius: 30, style: .continuous)
+ .strokeBorder(AngularGradient(colors: [BP.violet, BP.blue, BP.pink, BP.violet], center: .center, angle: .degrees(t * 60)), lineWidth: 2)
+ }
+ .overlay {
+ ZStack {
+ BridgeShape(part: .deck)
+ .stroke(BP.fg, style: StrokeStyle(lineWidth: BridgeShape.width(.deck, size: 96), lineCap: .round))
+ BridgeShape(part: .cable)
+ .stroke(BP.iridescent, style: StrokeStyle(lineWidth: BridgeShape.width(.cable, size: 96), lineCap: .round, lineJoin: .round))
+ BridgeShape(part: .echo)
+ .stroke(BP.fg.opacity(0.35), style: StrokeStyle(lineWidth: BridgeShape.width(.echo, size: 96), lineCap: .round))
+ }
+ .frame(width: 96, height: 96)
+ }
+ .shadow(color: BP.violet.opacity(0.5), radius: 30)
+ .offset(y: sin(t * 1.1) * 4)
+ }
+ }
+}
diff --git a/app/Sources/NotProtonApp/Views/SetupAssistantView.swift b/app/Sources/NotProtonApp/Views/SetupAssistantView.swift
index 271bed4..c3402bd 100644
--- a/app/Sources/NotProtonApp/Views/SetupAssistantView.swift
+++ b/app/Sources/NotProtonApp/Views/SetupAssistantView.swift
@@ -13,43 +13,86 @@ struct SetupAssistantView: View {
@State private var revealed: Int
@State private var forward = true
private let fixedReveal: Int?
+ private let onClose: (() -> Void)?
- init(model: SetupAssistant = SetupAssistant(), revealed: Int? = nil) {
+ init(model: SetupAssistant = SetupAssistant(), revealed: Int? = nil, onClose: (() -> Void)? = nil) {
_model = State(initialValue: model)
_revealed = State(initialValue: revealed ?? 0)
fixedReveal = revealed
+ self.onClose = onClose
+ }
+
+ private func close() {
+ if let onClose { onClose() } else { dismiss() }
}
static let pageSpring = Animation.spring(response: 0.42, dampingFraction: 0.86)
static let rowSpring = Animation.spring(response: 0.32, dampingFraction: 0.8)
var body: some View {
+ HStack(spacing: 0) {
+ SetupArt(step: model.step, progress: finishedFraction, running: model.step == .finish && model.isWorking)
+ .overlay(alignment: .topLeading) {
+ HStack(spacing: 9) {
+ BridgeplayMark(size: 22)
+ Text(verbatim: "Bridgeplay")
+ .font(BP.display(13))
+ .foregroundStyle(BP.iridescent)
+ }
+ .padding(22)
+ }
+ .frame(width: 240)
+ .animation(Self.pageSpring, value: model.step)
+ Rectangle().fill(BP.line).frame(width: 1)
+ main
+ }
+ .frame(width: 780, height: 580)
+ .background(BP.bg)
+ .foregroundStyle(BP.fg)
+ .environment(\.colorScheme, .dark)
+ .tint(BP.blue)
+ .task(id: model.step) { await wave() }
+ }
+
+ private var finishedFraction: Double {
+ switch model.step {
+ case .mac, .graphics, .steam: 0
+ case .finish: Double(model.tasks.filter { $0.state == .done }.count) / Double(max(model.tasks.count, 1))
+ case .done: 1
+ }
+ }
+
+ private var main: some View {
VStack(spacing: 0) {
StepBar(current: model.step)
- .padding(.horizontal, 24)
- .padding(.top, 18)
+ .padding(.horizontal, 28)
+ .padding(.top, 26)
.padding(.bottom, 4)
ZStack {
- Form {
- content
- if let message = model.message {
- Section {
- StatusRow(title: String(localized: "Something went wrong"), value: message, tone: .bad)
+ ScrollView {
+ VStack(alignment: .leading, spacing: 14) {
+ content
+ if let message = model.message {
+ Card {
+ WizardRow(row: StatusRow(title: String(localized: "Something went wrong"), value: message, tone: .bad))
+ }
}
}
+ .padding(.horizontal, 28)
+ .padding(.top, 20)
+ .padding(.bottom, 24)
+ .frame(maxWidth: .infinity, alignment: .leading)
}
- .formStyle(.grouped)
+ .scrollIndicators(.never)
.id(model.step)
.transition(pageTransition)
}
.clipped()
- Divider()
+ Rectangle().fill(BP.line).frame(height: 1)
footer
- .padding(.horizontal, 20)
- .padding(.vertical, 12)
+ .padding(.horizontal, 24)
+ .padding(.vertical, 14)
}
- .frame(width: 640, height: 560)
- .task(id: model.step) { await wave() }
}
private var pageTransition: AnyTransition {
@@ -92,13 +135,8 @@ struct SetupAssistantView: View {
shown.secondaryAction = nil
shown.trailing = nil
}
- return shown
- .frame(maxWidth: .infinity, alignment: .leading)
- .overlay(alignment: .trailing) {
- if pending {
- ProgressView().controlSize(.small).transition(.opacity)
- }
- }
+ return WizardRow(row: shown, pending: pending)
+ .animation(Self.rowSpring, value: pending)
}
@ViewBuilder
@@ -116,78 +154,92 @@ struct SetupAssistantView: View {
@ViewBuilder
private var macStep: some View {
- Section {
+ StepHeader(step: model.step, title: "Check your Mac",
+ detail: "Bridgeplay runs Windows games from your Steam library. First, a few quick checks.")
+ Card {
checked(0, StatusRow(title: String(localized: "Apple silicon"),
value: model.appleSilicon ? SetupChecks.chipName : String(localized: "Bridgeplay doesn't run on Intel Macs."),
tone: model.appleSilicon ? .ok : .bad))
+ Hairline()
checked(1, StatusRow(title: String(localized: "macOS \(SetupChecks.minimumMacOS) or later"),
value: model.macOSSupported ? SetupChecks.macOSDisplay : String(localized: "\(SetupChecks.macOSDisplay). Update macOS first."),
tone: model.macOSSupported ? .ok : .bad))
+ Hairline()
checked(2, StatusRow(title: String(localized: "Free space"),
value: model.freeBytes.map { String(localized: "\(ByteCountFormatter.string(fromByteCount: $0, countStyle: .file)) available, 3 GB needed") },
tone: model.hasSpace ? .ok : .bad))
+ Hairline()
checked(3, StatusRow(title: String(localized: "Rosetta 2"),
value: model.rosettaInstalled ? String(localized: "Installed.") : String(localized: "Apple's translator for Windows games. Asks for your Mac password."),
tone: model.rosettaInstalled ? .ok : .warning,
action: model.rosettaInstalled ? nil : StatusAction(
label: String(localized: "Install"), isProminent: true, isEnabled: !model.isWorking
) { Task { await model.installRosetta() } }))
- } header: {
- StepHeader(title: "Check your Mac",
- detail: "Bridgeplay runs Windows games from your Steam library. First, a few quick checks.")
}
}
@ViewBuilder
private var graphicsStep: some View {
- Section {
+ StepHeader(step: model.step, title: "Add Apple's game graphics",
+ detail: "Apple's Game Porting Toolkit includes D3DMetal, which runs DirectX 11 and 12 games on Metal, with MetalFX upscaling. It's free, but only Apple can hand it out, so you download it once with your Apple Account.")
+ Card {
if let gptk = model.gptk {
- StatusRow(title: String(localized: "Game Porting Toolkit"),
+ WizardRow(row: StatusRow(title: String(localized: "Game Porting Toolkit"),
value: String(localized: "Ready from \(gptk.libRoot.path(percentEncoded: false))."),
- tone: .ok, trailing: gptk.version)
+ tone: .ok, trailing: gptk.version))
} else {
+ WizardRow(row: StatusRow(title: String(localized: "Download it from Apple"),
+ value: String(localized: "Sign in, then download the latest Game Porting Toolkit .dmg."),
+ action: StatusAction(label: String(localized: "Open Apple Downloads")) {
+ NSWorkspace.shared.open(URL(string: "https://developer.apple.com/download/all/?q=Game%20Porting%20Toolkit")!)
+ }), number: 1)
+ Hairline()
if let image = model.gptkImages.first {
- StatusRow(title: image.lastPathComponent, value: String(localized: "Found in Downloads."), tone: .info,
+ WizardRow(row: StatusRow(title: String(localized: "Use the one in Downloads"),
+ value: image.lastPathComponent,
action: StatusAction(label: String(localized: "Use This"), isProminent: true, isEnabled: !model.isWorking) {
Task { await model.importGPTK(image) }
- })
+ }), number: 2)
+ } else {
+ WizardRow(row: StatusRow(title: String(localized: "Add the disk image"),
+ value: String(localized: "Drag the .dmg onto this window, or choose it."),
+ action: StatusAction(label: String(localized: "Choose…"), isProminent: true, isEnabled: !model.isWorking) { chooseImage() }),
+ number: 2)
}
- StatusRow(title: String(localized: "Choose a disk image"),
- value: String(localized: "Drop Game_Porting_Toolkit .dmg on this window, or pick it from a folder."),
- tone: .neutral,
- secondaryAction: StatusAction(label: String(localized: "Get It from Apple")) {
- NSWorkspace.shared.open(URL(string: "https://developer.apple.com/download/all/?q=Game%20Porting%20Toolkit")!)
- },
- action: StatusAction(label: String(localized: "Choose…"), isEnabled: !model.isWorking) { chooseImage() })
}
- } header: {
- StepHeader(title: "Add Apple's game graphics",
- detail: "The Game Porting Toolkit (D3DMetal) runs DirectX 11 and 12 games on Metal. Apple gives it away for free with an Apple Account. Without it, games use DXMT.")
}
.dropDestination(for: URL.self) { urls, _ in
guard let url = urls.first(where: { $0.pathExtension.lowercased() == "dmg" }) else { return false }
Task { await model.importGPTK(url) }
return true
}
+ if model.gptk == nil {
+ Text("Optional. If you skip it, games use DXMT, which runs DirectX 10 and 11 games only. You can add the toolkit later from Status.")
+ .font(BP.sans(12))
+ .foregroundStyle(BP.fg3)
+ .fixedSize(horizontal: false, vertical: true)
+ .padding(.horizontal, 2)
+ }
}
@ViewBuilder
private var steamStep: some View {
- Section {
+ StepHeader(step: model.step, title: "Sign in to Steam",
+ detail: "Sign in with your account in Steam. Bridgeplay continues on its own once you're in.")
+ Card {
checked(0, StatusRow(title: String(localized: "Steam"),
value: model.steamInstalled ? SupportPaths.Steam.app.path(percentEncoded: false) : String(localized: "Not installed."),
tone: model.steamInstalled ? .ok : .warning,
action: model.steamInstalled ? nil : StatusAction(
label: String(localized: "Install Steam"), isProminent: true, isEnabled: !model.isWorking
) { Task { await model.installSteam() } }))
+ Hairline()
checked(1, StatusRow(title: String(localized: "Steam account"),
value: model.signedIn ? String(localized: "Signed in.") : String(localized: "Waiting for you to sign in. Bridgeplay never sees your password."),
tone: model.signedIn ? .ok : .info,
- action: model.signedIn || !model.steamInstalled ? nil : StatusAction(label: String(localized: "Open Steam")) { model.openSteam() }))
+ action: model.signedIn || !model.steamInstalled ? nil : StatusAction(label: String(localized: "Open Steam"), isProminent: true) { model.openSteam() }))
+ Hairline()
checked(2, trustRow)
- } header: {
- StepHeader(title: "Sign in to Steam",
- detail: "Sign in with your account in Steam. Bridgeplay continues on its own once you're in.")
}
}
@@ -216,60 +268,57 @@ struct SetupAssistantView: View {
@ViewBuilder
private var finishStep: some View {
- Section {
- ForEach(model.tasks) { task in
- StatusRow(title: task.title, value: value(of: task), tone: tone(of: task))
- .frame(maxWidth: .infinity, alignment: .leading)
- .overlay(alignment: .trailing) {
- if task.state == .running {
- ProgressView().controlSize(.small).transition(.opacity)
- }
- }
+ 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.")
+ Card {
+ ForEach(Array(model.tasks.enumerated()), id: \.element.id) { index, task in
+ if index > 0 { Hairline() }
+ WizardRow(row: StatusRow(title: task.title, value: value(of: task), tone: tone(of: task)),
+ pending: task.state == .running)
.animation(Self.rowSpring, value: task.state)
}
- } header: {
- StepHeader(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.")
- } footer: {
- let done = model.tasks.filter { $0.state == .done }.count
- HStack(spacing: 12) {
- ProgressView(value: Double(done), total: Double(model.tasks.count))
- .tint(.accentColor)
- .animation(Self.rowSpring, value: done)
- Text("\(done) of \(model.tasks.count)")
- .monospacedDigit()
- .contentTransition(.numericText(value: Double(done)))
- .animation(Self.rowSpring, value: done)
- .foregroundStyle(.secondary)
- }
- .padding(.top, 6)
}
+ let done = model.tasks.filter { $0.state == .done }.count
+ HStack(spacing: 12) {
+ GradientProgress(fraction: Double(done) / Double(max(model.tasks.count, 1)))
+ .animation(Self.rowSpring, value: done)
+ Text("\(done) of \(model.tasks.count)")
+ .font(BP.sans(12, .medium))
+ .monospacedDigit()
+ .contentTransition(.numericText(value: Double(done)))
+ .animation(Self.rowSpring, value: done)
+ .foregroundStyle(BP.fg3)
+ }
+ .padding(.horizontal, 2)
if model.needsAppManagement {
- Section {
- StatusRow(title: String(localized: "App Management"),
+ Card {
+ WizardRow(row: StatusRow(title: String(localized: "App Management"),
value: String(localized: "Turn on Bridgeplay in Privacy & Security › App Management. Setup continues by itself once it's on."),
tone: .warning,
detail: String(localized: "After a Bridgeplay update the switch can look on but no longer work. Turn it off and on again, or remove Bridgeplay from the list with − and add it back with +."),
- action: StatusAction(label: Remedy.settingsButton, isProminent: true) { model.openAppManagement() })
+ action: StatusAction(label: Remedy.settingsButton, isProminent: true) { model.openAppManagement() }))
}
}
}
@ViewBuilder
private var doneStep: some View {
- Section {
+ StepHeader(step: model.step, title: "You're all set",
+ detail: "Open Steam, install a Windows game and press Play. Status, Prefixes and Prefix Backups in this window change engines, fix a game or undo everything.",
+ emphasized: true)
+ Card {
checked(0, StatusRow(title: String(localized: "Bridgeplay"), value: String(localized: "Installed into Steam."), tone: .ok))
+ Hairline()
checked(1, StatusRow(title: String(localized: "WineCX Engine"), value: String(localized: "Steam's default for Windows games."), tone: .ok))
+ Hairline()
checked(2, StatusRow(title: String(localized: "Game Porting Toolkit"),
value: model.gptk == nil ? String(localized: "Skipped. Games use DXMT; add it later from Status.") : String(localized: "Linked."),
tone: model.gptk == nil ? .neutral : .ok))
+ Hairline()
checked(3, StatusRow(title: String(localized: "Controllers"),
value: String(localized: "The first time a game uses a controller, macOS asks to let Steam use Input Monitoring. Click Allow. If you missed it, turn on Steam in Input Monitoring."),
tone: .info,
action: StatusAction(label: String(localized: "Open Input Monitoring")) { SystemStatus.openInputMonitoring() }))
- } header: {
- StepHeader(title: "You're all set",
- detail: "Open Steam, install a Windows game and press Play. Status, Prefixes and Prefix Backups in this window change engines, fix a game or undo everything.")
}
}
@@ -302,38 +351,48 @@ struct SetupAssistantView: View {
// MARK: Footer
private var footer: some View {
- HStack {
+ HStack(spacing: 10) {
if model.step == .mac {
- Button("Not Now") { model.dismiss(); dismiss() }
+ Button("Not Now") { model.dismiss(); close() }
+ .buttonStyle(.pillPlain)
} else if model.step != .done {
Button("Back") { go(forward: false) { model.back() } }
+ .buttonStyle(.pillPlain)
.disabled(model.isWorking)
}
Spacer()
- if model.isWorking { ProgressView().controlSize(.small).padding(.trailing, 6) }
+ if model.isWorking { ProgressView().controlSize(.small).padding(.trailing, 4) }
switch model.step {
case .mac:
Button("Continue") { go(forward: true) { model.advance() } }
+ .buttonStyle(.pillLarge)
.disabled(!model.macReady || model.isWorking)
.keyboardShortcut(.defaultAction)
case .graphics:
if model.gptk == nil {
- Button("Skip") { go(forward: true) { model.skippedGraphics = true; model.advance() } }.disabled(model.isWorking)
+ Button("Skip") { go(forward: true) { model.skippedGraphics = true; model.advance() } }
+ .buttonStyle(.pillSecondaryLarge)
+ .disabled(model.isWorking)
}
Button("Continue") { go(forward: true) { model.advance() } }
+ .buttonStyle(.pillLarge)
.disabled(model.gptk == nil || model.isWorking)
.keyboardShortcut(.defaultAction)
case .steam:
Button("Continue") { go(forward: true) { model.advance() } }
+ .buttonStyle(.pillLarge)
.disabled(!model.steamInstalled || !model.signedIn || model.isWorking)
.keyboardShortcut(.defaultAction)
case .finish:
Button(model.failed ? "Try Again" : "Set Up") { Task { await model.finish(with: status) } }
+ .buttonStyle(.pillLarge)
.disabled(model.isWorking || !(model.failed || model.notStarted))
.keyboardShortcut(.defaultAction)
case .done:
- Button("Close") { model.dismiss(); dismiss() }
- Button("Open Steam") { model.openSteamAndClose(); model.dismiss(); dismiss() }
+ Button("Close") { model.dismiss(); close() }
+ .buttonStyle(.pillSecondaryLarge)
+ Button("Open Steam") { model.openSteamAndClose(); model.dismiss(); close() }
+ .buttonStyle(.pillLarge)
.keyboardShortcut(.defaultAction)
}
}
@@ -342,27 +401,25 @@ struct SetupAssistantView: View {
// MARK: - Pieces
+// One continuous gradient across the five segments, revealed up to the current step.
private struct StepBar: View {
let current: SetupAssistant.Step
private let steps = SetupAssistant.Step.allCases
var body: some View {
VStack(alignment: .leading, spacing: 8) {
- GeometryReader { proxy in
- let fraction = CGFloat(current.rawValue + 1) / CGFloat(steps.count)
- ZStack(alignment: .leading) {
- Capsule().fill(.quaternary)
- Capsule().fill(Color.accentColor)
- .frame(width: max(6, proxy.size.width * fraction))
- }
+ ZStack {
+ segments { _ in BP.raise2 }
+ BP.iridescent
+ .mask(segments { step in step.rawValue <= current.rawValue ? Color.white : Color.clear })
}
.frame(height: 3)
.animation(SetupAssistantView.pageSpring, value: current)
- HStack(spacing: 0) {
+ HStack(spacing: 6) {
ForEach(steps) { step in
Text(step.title)
- .font(.caption.weight(step == current ? .semibold : .regular))
- .foregroundStyle(step.rawValue <= current.rawValue ? .primary : .tertiary)
+ .font(BP.sans(11, step == current ? .semibold : .medium))
+ .foregroundStyle(step == current ? BP.fg : (step.rawValue < current.rawValue ? BP.fg2 : BP.fg3))
.frame(maxWidth: .infinity, alignment: .leading)
.animation(.easeOut(duration: 0.2), value: current)
}
@@ -371,18 +428,195 @@ private struct StepBar: View {
.accessibilityElement(children: .ignore)
.accessibilityLabel("Step \(current.rawValue + 1) of \(steps.count), \(current.title)")
}
+
+ private func segments(_ fill: @escaping (SetupAssistant.Step) -> Color) -> some View {
+ HStack(spacing: 6) {
+ ForEach(steps) { step in Capsule().fill(fill(step)) }
+ }
+ }
}
private struct StepHeader: View {
+ let step: SetupAssistant.Step
let title: LocalizedStringKey
let detail: LocalizedStringKey
+ var emphasized = false
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ Text("Step \(step.rawValue + 1) of \(SetupAssistant.Step.allCases.count)")
+ .font(BP.sans(11, .semibold))
+ .tracking(0.9)
+ .textCase(.uppercase)
+ .foregroundStyle(BP.fg3)
+ Text(title)
+ .font(BP.sans(28, .semibold))
+ .tracking(-0.9)
+ .foregroundStyle(emphasized ? AnyShapeStyle(BP.iridescent) : AnyShapeStyle(BP.fg))
+ Text(detail)
+ .font(BP.sans(14))
+ .lineSpacing(2)
+ .foregroundStyle(BP.fg2)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ .padding(.bottom, 6)
+ }
+}
+
+// .tile on the site: one raised panel, hairline border, small radius.
+private struct Card<Content: View>: View {
+ @ViewBuilder let content: Content
+
+ var body: some View {
+ VStack(spacing: 0) { content }
+ .background(BP.raise, in: RoundedRectangle(cornerRadius: BP.radius, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: BP.radius, style: .continuous).strokeBorder(BP.line, lineWidth: 1))
+ }
+}
+private struct Hairline: View {
var body: some View {
- VStack(alignment: .leading, spacing: 6) {
- Text(title).font(.title2.weight(.semibold)).foregroundStyle(.primary)
- Text(detail).font(.body).foregroundStyle(.secondary).fixedSize(horizontal: false, vertical: true)
+ Rectangle().fill(BP.line).frame(height: 1).padding(.leading, 54)
+ }
+}
+
+// A StatusRow's content in the wizard's style: a tone badge, the title and value, and pill
+// buttons on the right.
+private struct WizardRow: View {
+ let row: StatusRow
+ var pending = false
+ // A step number in place of the tone, for rows that are instructions.
+ var number: Int?
+
+ var body: some View {
+ HStack(alignment: .center, spacing: 14) {
+ if let number {
+ Text("\(number)")
+ .font(BP.sans(12, .semibold))
+ .foregroundStyle(.black)
+ .frame(width: 24, height: 24)
+ .background(BP.iridescentDiagonal, in: RoundedRectangle(cornerRadius: 7, style: .continuous))
+ } else {
+ ToneBadge(tone: row.tone, pending: pending)
+ }
+ VStack(alignment: .leading, spacing: 3) {
+ HStack(alignment: .firstTextBaseline, spacing: 8) {
+ Text(row.title)
+ .font(BP.sans(14, .semibold))
+ .tracking(-0.2)
+ .foregroundStyle(BP.fg)
+ if let trailing = row.trailing {
+ Text(trailing)
+ .font(BP.sans(11, .semibold))
+ .foregroundStyle(BP.fg2)
+ .padding(.horizontal, 7)
+ .padding(.vertical, 2)
+ .background(BP.raise2, in: Capsule())
+ }
+ }
+ if let value = row.value {
+ Text(value)
+ .font(BP.sans(13))
+ .foregroundStyle(BP.fg2)
+ .fixedSize(horizontal: false, vertical: true)
+ .contentTransition(.opacity)
+ }
+ if let detail = row.detail {
+ Text(detail)
+ .font(BP.sans(12))
+ .foregroundStyle(BP.fg3)
+ .fixedSize(horizontal: false, vertical: true)
+ .textSelection(.enabled)
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ if row.secondaryAction != nil || row.action != nil {
+ HStack(spacing: 8) {
+ if let secondary = row.secondaryAction { button(secondary, prominent: false) }
+ if let action = row.action { button(action, prominent: action.isProminent) }
+ }
+ .transition(.opacity)
+ }
+ }
+ .padding(.horizontal, 16)
+ .padding(.vertical, 13)
+ }
+
+ private func button(_ action: StatusAction, prominent: Bool) -> some View {
+ Button(action.label, role: action.role, action: action.perform)
+ .buttonStyle(PillButtonStyle(kind: prominent ? .primary : .secondary))
+ .fixedSize()
+ .disabled(!action.isEnabled)
+ .help(action.help ?? "")
+ }
+}
+
+private struct ToneBadge: View {
+ let tone: StatusTone?
+ var pending = false
+
+ var body: some View {
+ ZStack {
+ RoundedRectangle(cornerRadius: 7, style: .continuous).fill(fill)
+ RoundedRectangle(cornerRadius: 7, style: .continuous).strokeBorder(border, lineWidth: 1)
+ if pending {
+ ProgressView().controlSize(.mini)
+ } else if let symbol {
+ Image(systemName: symbol)
+ .font(.system(size: 10, weight: .bold))
+ .foregroundStyle(color)
+ .contentTransition(.symbolEffect(.replace))
+ }
+ }
+ .frame(width: 24, height: 24)
+ .accessibilityHidden(true)
+ }
+
+ private var color: Color {
+ switch tone {
+ case .ok: BP.green
+ case .warning: BP.orange
+ case .bad: BP.red
+ case .info, .neutral, nil: BP.fg2
+ }
+ }
+
+ private var fill: Color {
+ switch tone {
+ case .ok, .warning, .bad: color.opacity(pending ? 0 : 0.14)
+ case .info, .neutral, nil: BP.raise2
+ }
+ }
+
+ private var border: Color {
+ switch tone {
+ case .ok, .warning, .bad: pending ? BP.line : .clear
+ case .info, .neutral, nil: BP.line
+ }
+ }
+
+ private var symbol: String? {
+ switch tone {
+ case .ok: "checkmark"
+ case .warning: "exclamationmark"
+ case .bad: "xmark"
+ case .info: "arrow.right"
+ case .neutral, nil: nil
+ }
+ }
+}
+
+private struct GradientProgress: View {
+ let fraction: Double
+
+ var body: some View {
+ GeometryReader { proxy in
+ ZStack(alignment: .leading) {
+ Capsule().fill(BP.raise2)
+ Capsule().fill(BP.iridescent)
+ .frame(width: max(4, proxy.size.width * fraction))
+ }
}
- .textCase(nil)
- .padding(.bottom, 8)
+ .frame(height: 4)
}
}
diff --git a/app/Sources/NotProtonApp/Views/StatusHero.swift b/app/Sources/NotProtonApp/Views/StatusHero.swift
new file mode 100644
index 0000000..8a626c2
--- /dev/null
+++ b/app/Sources/NotProtonApp/Views/StatusHero.swift
@@ -0,0 +1,110 @@
+import SwiftUI
+
+// The top of the Status page: the landing page's aurora behind one plain answer to "can I
+// play?", with the engine, graphics and Steam state as chips underneath.
+struct StatusHero: View {
+ let snapshot: StatusSnapshot
+
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+
+ var body: some View {
+ TimelineView(.animation(minimumInterval: 1 / 30, paused: reduceMotion)) { context in
+ let t = reduceMotion ? 1.2 : context.date.timeIntervalSinceReferenceDate * 0.6
+ ZStack(alignment: .leading) {
+ Aurora(t: t, lean: lean)
+ GridLines()
+ HStack(spacing: 18) {
+ BridgeplayMark(size: 52)
+ .shadow(color: BP.violet.opacity(0.45), radius: 18)
+ VStack(alignment: .leading, spacing: 8) {
+ Text(headline)
+ .font(BP.sans(24, .semibold))
+ .tracking(-0.7)
+ .foregroundStyle(ready ? AnyShapeStyle(BP.iridescent) : AnyShapeStyle(BP.fg))
+ Text(detail)
+ .font(BP.sans(13))
+ .foregroundStyle(BP.fg2)
+ .lineLimit(2)
+ HStack(spacing: 6) {
+ ForEach(chips, id: \.self) { chip in
+ Text(chip)
+ .font(BP.sans(11, .semibold))
+ .foregroundStyle(BP.fg)
+ .padding(.horizontal, 9)
+ .padding(.vertical, 3)
+ .background(.white.opacity(0.1), in: Capsule())
+ }
+ }
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, 24)
+ }
+ }
+ .frame(height: 148)
+ .clipShape(RoundedRectangle(cornerRadius: BP.radius, style: .continuous))
+ .overlay(RoundedRectangle(cornerRadius: BP.radius, style: .continuous).strokeBorder(BP.line, lineWidth: 1))
+ .padding(.horizontal, 20)
+ .padding(.top, 14)
+ .padding(.bottom, 4)
+ .background(BP.bg)
+ }
+
+ private var ready: Bool {
+ if case .installed = snapshot.steam { return !snapshot.currentFreeEngines.isEmpty }
+ return false
+ }
+
+ // Steam can hold a newer Bridgeplay than this app (an older copy was opened).
+ private var newerInSteam: Bool { snapshot.installContent == .newerInstalled }
+
+ private var lean: Float {
+ switch snapshot.steam {
+ case .installed: 0.5
+ case .outdated: 0.8
+ default: 0.15
+ }
+ }
+
+ private var headline: String {
+ if newerInSteam { return String(localized: "Steam has a newer build") }
+ return switch snapshot.steam {
+ case .installed: ready ? String(localized: "Ready to play") : String(localized: "Almost ready")
+ case .outdated: String(localized: "Update ready")
+ case .notInstalled: String(localized: "Not set up yet")
+ case .steamMissing: String(localized: "Steam not found")
+ case .foreign: String(localized: "Steam is modified")
+ }
+ }
+
+ private var detail: String {
+ if newerInSteam { return String(localized: "This copy of Bridgeplay is older than the one in Steam. Open the newer app.") }
+ return switch snapshot.steam {
+ case .installed:
+ ready ? String(localized: "Open Steam and press Play on any Windows game.")
+ : String(localized: "Install the WineCX engine below to finish.")
+ case .outdated: String(localized: "Install the newer Bridgeplay into Steam below.")
+ case .notInstalled: String(localized: "Install Bridgeplay into Steam below, or run the Setup Assistant.")
+ case .steamMissing: String(localized: "Install Steam, or choose where your copy is.")
+ case .foreign: String(localized: "Another tool changed Steam. Repair Steam to use Bridgeplay.")
+ }
+ }
+
+ private var chips: [String] {
+ var chips: [String] = []
+ let engines = snapshot.currentFreeEngines
+ let preferred = engines.contains(FreeEngineWinecx.current.build) ? FreeEngineWinecx.current.build : engines.sorted().last
+ if let preferred { chips.append(Self.engineName(preferred)) }
+ chips.append(snapshot.gptkSource == nil ? "DXMT" : "D3DMetal")
+ if snapshot.steamRunning { chips.append(String(localized: "Steam running")) }
+ return chips
+ }
+
+ // "winecx-11.17" reads as "WineCX 11.17".
+ static func engineName(_ build: String) -> String {
+ let parts = build.split(separator: "-", maxSplits: 1).map(String.init)
+ guard parts.count == 2 else { return build }
+ let family = ["winecx": "WineCX", "winehq": "WineHQ"][parts[0]] ?? parts[0]
+ return "\(family) \(parts[1])"
+ }
+}
diff --git a/app/Sources/NotProtonApp/Views/StatusView.swift b/app/Sources/NotProtonApp/Views/StatusView.swift
index 9934731..6c03a43 100644
--- a/app/Sources/NotProtonApp/Views/StatusView.swift
+++ b/app/Sources/NotProtonApp/Views/StatusView.swift
@@ -17,11 +17,11 @@ enum StatusTone: Sendable {
var color: Color {
switch self {
- case .ok: .green
- case .info: .secondary
- case .warning: .orange
- case .bad: .red
- case .neutral: .secondary
+ case .ok: BP.green
+ case .info: BP.fg2
+ case .warning: BP.orange
+ case .bad: BP.red
+ case .neutral: BP.fg3
}
}
}
@@ -62,6 +62,7 @@ struct StatusRow: View {
Image(systemName: tone.symbol)
.font(.system(size: 8))
.foregroundStyle(tone.color)
+ .shadow(color: tone.color.opacity(tone == .ok || tone == .warning || tone == .bad ? 0.7 : 0), radius: 3)
.contentTransition(.symbolEffect(.replace))
.frame(width: StatusMetrics.symbolWidth)
.accessibilityHidden(true)
@@ -71,7 +72,8 @@ struct StatusRow: View {
VStack(alignment: .leading, spacing: 2) {
Text(title)
- .font(.headline)
+ .font(BP.sans(13, .semibold))
+ .tracking(-0.1)
if let value {
Text(value)
.foregroundStyle(.secondary)
@@ -152,10 +154,10 @@ struct StatusRow: View {
private func button(_ action: StatusAction) -> some View {
if action.isProminent {
Button(action.label, role: action.role, action: action.perform)
- .buttonStyle(.borderedProminent)
+ .buttonStyle(.pill)
} else {
Button(action.label, role: action.role, action: action.perform)
- .buttonStyle(.bordered)
+ .buttonStyle(.pillSecondary)
}
}
}
@@ -365,6 +367,7 @@ struct StatusView: View {
dangerSection
}
.formStyle(.grouped)
+ .safeAreaInset(edge: .top, spacing: 0) { StatusHero(snapshot: snapshot) }
}
// A reset macOS refused leaves Steam's old approval in place, and macOS then blocks the
diff --git a/app/Tests/NotProtonAppTests/SetupAssistantSnapshots.swift b/app/Tests/NotProtonAppTests/SetupAssistantSnapshots.swift
index e2cdc68..e09c142 100644
--- a/app/Tests/NotProtonAppTests/SetupAssistantSnapshots.swift
+++ b/app/Tests/NotProtonAppTests/SetupAssistantSnapshots.swift
@@ -36,7 +36,7 @@ struct SetupAssistantSnapshots {
_ configure: (SetupAssistant) -> Void) throws {
let model = SetupAssistant()
configure(model)
- try render(SetupAssistantView(model: model, revealed: revealed), name, size: CGSize(width: 640, height: 560), status: status)
+ try render(SetupAssistantView(model: model, revealed: revealed), name, size: CGSize(width: 780, height: 580), status: status)
}
// Frames of the check wave and of Set Up progressing, stitched into GIFs for review.