Skip to content

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

HB_DEBUG_GAME (debug builds only) opens the first library game whose title contains it a few seconds after launch, so a script can capture game pages without a click. Used to look at highball#279's page on the M4 at the default 900x612 window (one column) and at 1400x960 (two columns), for Portal 2, Forza Horizon 6, Paperback, Among Us and Counter-Strike 2: nothing clipped or overlapping.

Gauthier Piarrettef0eade97195f
diff --git a/Sources/HighballApp/LibraryView.swift b/Sources/HighballApp/LibraryView.swift
index 9ffb0c2..46bd2da 100644
--- a/Sources/HighballApp/LibraryView.swift
+++ b/Sources/HighballApp/LibraryView.swift
@@ -22,6 +22,12 @@ struct LibraryView: View {
/// that read as a bug (highball#257).
@AppStorage("library.installedOnly") private var installedOnly = false
@AppStorage("library.verifiedOnly") private var verifiedOnly = false
+ #if DEBUG
+ /// HB_DEBUG_GAME="<title>": the first library item whose title contains it opens a few seconds after
+ /// launch, so a script can capture game pages without a click (highball#279's page was checked this
+ /// way). Compiled out of releases.
+ @State private var debugGame: LibraryItem?
+ #endif
private var filtered: [LibraryItem] {
state.libraryItems.filter { item in
@@ -95,6 +101,16 @@ struct LibraryView: View {
.background(BottleBackdrop())
.searchable(text: $search, prompt: L("Search your games"))
.navigationDestination(for: LibraryItem.self) { GameDetailView(passedItem: $0) }
+ #if DEBUG
+ .navigationDestination(item: $debugGame) { GameDetailView(passedItem: $0) }
+ .task {
+ guard let wanted = ProcessInfo.processInfo.environment["HB_DEBUG_GAME"] else { return }
+ for _ in 0..<30 {
+ try? await Task.sleep(for: .seconds(1))
+ if let item = state.libraryItems.first(where: { $0.title.localizedCaseInsensitiveContains(wanted) }) { debugGame = item; return }
+ }
+ }
+ #endif
}
private func entry(for item: LibraryItem) -> GameDBEntry? {