Skip to content

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

feat: show Steam launcher state in button labels

Matias G.609ea0efa67a
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index daa8e20..3885cfa 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -1324,6 +1324,10 @@ final class AppState {
return bottle
}
+ func steamLauncherTitle(in bottle: Bottle) -> String {
+ steamClients.contains(bottle.name) ? L("Show Steam") : L("Open Steam")
+ }
+
/// 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 dc7af86..a44e5bb 100644
--- a/Sources/HighballApp/HighballApp.swift
+++ b/Sources/HighballApp/HighballApp.swift
@@ -38,7 +38,7 @@ struct HighballApp: App {
.commands {
CommandGroup(after: .newItem) {
if let bottle = state.defaultSteamBottle {
- Button(L("Open Steam")) { state.showSteam(in: bottle) }
+ Button(state.steamLauncherTitle(in: bottle)) { state.showSteam(in: bottle) }
.keyboardShortcut("s", modifiers: [.command, .shift])
.disabled(state.busy)
}
@@ -327,10 +327,9 @@ struct ContentView: View {
ToolbarItemGroup(placement: .primaryAction) {
if !showAddGames {
if let bottle = state.defaultSteamBottle {
- Button("Steam") { state.showSteam(in: bottle) }
+ Button(state.steamLauncherTitle(in: bottle)) { state.showSteam(in: bottle) }
.disabled(state.busy)
- .accessibilityLabel(L("Open Steam"))
- .help(L("Open Steam"))
+ .help(state.steamLauncherTitle(in: bottle))
}
Button { showAddGames = true } label: {
Label(L("Add games"), systemImage: "plus")
diff --git a/Sources/HighballApp/L10n.swift b/Sources/HighballApp/L10n.swift
index d505326..cdf2a45 100644
--- a/Sources/HighballApp/L10n.swift
+++ b/Sources/HighballApp/L10n.swift
@@ -404,6 +404,7 @@ enum L10n {
"Pour your first game": "Servez votre premier jeu",
"Install games inside Steam — they show up with artwork and a compatibility verdict.": "Installez des jeux dans Steam — ils apparaissent avec leur visuel et leur verdict de compatibilité.",
"Install Steam in this bottle to start playing your Windows library.": "Installez Steam dans cette bouteille pour jouer à votre bibliothèque Windows.",
+ "Show Steam": "Afficher Steam",
"Open Steam": "Ouvrir Steam",
"Install Steam": "Installer Steam",
"Delete this bottle? Its Windows drive and everything installed in it are removed.": "Supprimer cette bouteille ? Son disque Windows et tout ce qui y est installé seront effacés.",