Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

feat: add Steam launcher to toolbar and File menu

Matias G.9bd1ff26cb84
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index e9b58d2..daa8e20 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -1318,6 +1318,12 @@ final class AppState {
}))
}
+ /// The launcher shortcut never installs Steam or picks a different environment.
+ var defaultSteamBottle: Bottle? {
+ guard let bottle = defaultBottle, steamInstalled(in: bottle) else { return nil }
+ return bottle
+ }
+
/// Steam counts as installed when its steam.exe is a Windows executable, not merely a file: an
/// empty or truncated one, the leftover of an interrupted self-update, showed Open Steam and
/// then a crash alert proposing another graphics mode (highball#245). Now the row offers the
diff --git a/Sources/HighballApp/HighballApp.swift b/Sources/HighballApp/HighballApp.swift
index 9c62e9b..88a0dd5 100644
--- a/Sources/HighballApp/HighballApp.swift
+++ b/Sources/HighballApp/HighballApp.swift
@@ -37,6 +37,11 @@ struct HighballApp: App {
.windowResizability(.contentSize)
.commands {
CommandGroup(after: .newItem) {
+ if let bottle = state.defaultSteamBottle {
+ Button(L("Open Steam")) { state.showSteam(in: bottle) }
+ .keyboardShortcut("s", modifiers: [.command, .shift])
+ .disabled(state.busy)
+ }
Button(L("A Windows program I have…")) { state.chooseProgramToRun() }
.keyboardShortcut("o")
.disabled(state.busy || state.bottles.isEmpty)
@@ -319,12 +324,18 @@ struct ContentView: View {
}
}
.toolbar {
- ToolbarItem(placement: .primaryAction) {
+ ToolbarItemGroup(placement: .primaryAction) {
if !showAddGames {
Button { showAddGames = true } label: {
Label(L("Add games"), systemImage: "plus")
}
.disabled(state.busy || state.bottles.isEmpty)
+ if let bottle = state.defaultSteamBottle {
+ Button("Steam") { state.showSteam(in: bottle) }
+ .disabled(state.busy)
+ .accessibilityLabel(L("Open Steam"))
+ .help(L("Open Steam"))
+ }
}
}
ToolbarItem(placement: .automatic) {