Skip to content

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

A database row saying a game's Mac build is not the one to play (nativeMac available false) outranks GOG's and Epic's listing, as it does Steam's: no Mac badge, filter match or Mac section for it.

Gabe3a69ce827a2c
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index f7b5c24..7c396e4 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -4314,7 +4314,12 @@ final class AppState {
/// A native Mac version the store offers: Steam's (MacSteamBuild), or one GOG or Epic lists.
func offersMacVersion(_ item: LibraryItem) -> Bool {
- item.installedOnMac || (item.source == .steam ? macSteamBuild(for: item) != nil : item.macListed)
+ item.installedOnMac || (item.source == .steam ? macSteamBuild(for: item) != nil : macListed(item))
+ }
+
+ /// GOG or Epic lists a Mac version and the database row does not say otherwise (StoreMacBuild).
+ func macListed(_ item: LibraryItem) -> Bool {
+ StoreMacBuild.listed(item.macListed, entry: gameDB.entry(for: item))
}
/// An installed game's folder and saves as they are on disk now.
diff --git a/Sources/HighballApp/GameDetailView.swift b/Sources/HighballApp/GameDetailView.swift
index 05cc0e5..52b9748 100644
--- a/Sources/HighballApp/GameDetailView.swift
+++ b/Sources/HighballApp/GameDetailView.swift
@@ -207,7 +207,7 @@ struct GameDetailView: View {
.textSelection(.enabled)
if let macBuild {
macBlock(macBuild)
- } else if item.macListed, item.source == .gog || item.source == .epic {
+ } else if state.macListed(item), item.source == .gog || item.source == .epic {
storeMacBlock
} else if let outdated = GamePageCopy.outdatedMacBuild(appInfo: item.steamAppID.flatMap { state.macAppInfoByAppID[$0] }, entry: entry) {
Label(L(outdated), systemImage: "apple.logo").font(.callout).foregroundStyle(.secondary)
diff --git a/Sources/HighballApp/LibraryView.swift b/Sources/HighballApp/LibraryView.swift
index 5452367..94ab22e 100644
--- a/Sources/HighballApp/LibraryView.swift
+++ b/Sources/HighballApp/LibraryView.swift
@@ -50,7 +50,7 @@ struct LibraryView: View {
// does one Highball cannot place (Steam for Mac's, or before the accounts are read).
if let account, let owners = state.steamOwners(for: item), !owners.accounts.contains(account) { return false }
// A native Mac version from any store: Steam's (MacSteamBuild), or one GOG or Epic lists.
- if macOnly && state.macSteamBuild(for: item) == nil && !item.macListed && !item.installedOnMac { return false }
+ if macOnly && state.macSteamBuild(for: item) == nil && !state.macListed(item) && !item.installedOnMac { return false }
if verifiedOnly {
guard state.gameDB.entry(for: item)?.status == "verified-local" else { return false }
}
@@ -352,7 +352,7 @@ struct LibraryTile: View {
}
.transition(.opacity)
}
- SourceBadge(source: item.source, mac: state.macSteamBuild(for: item), macListed: item.macListed)
+ SourceBadge(source: item.source, mac: state.macSteamBuild(for: item), macListed: state.macListed(item))
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
.padding(6)
if let appid = item.steamAppID, state.session(forAppID: appid) != nil {
diff --git a/Sources/HighballKit/MacSteamBuild.swift b/Sources/HighballKit/MacSteamBuild.swift
index f6f9304..048cb40 100644
--- a/Sources/HighballKit/MacSteamBuild.swift
+++ b/Sources/HighballKit/MacSteamBuild.swift
@@ -52,6 +52,16 @@ public enum MacSteamBuild: Equatable, Sendable {
}
}
+/// A Mac build GOG's or Epic's catalog lists (LibraryItem.macListed), weighed the way MacSteamBuild
+/// weighs Steam's: the database row first, so one saying `"available": false` (a Mac port that no
+/// longer runs, or one missing content, highball#223) keeps the badge and the page on the Windows build.
+public enum StoreMacBuild {
+ /// Whether the store's listing counts.
+ public static func listed(_ storeLists: Bool, entry: GameDBEntry?) -> Bool {
+ storeLists && entry?.nativeMac?.available != false
+ }
+}
+
/// What Steam's app data says about a game's Mac build, read the way Steam for Mac reads it.
/// Steam marks a build that runs on current macOS with `macos64` or `macosapplesilicon` in
/// `common.osextended` (Cyberpunk 2077 and Lies of P carry only the second), and a macOS launch
diff --git a/Tests/HighballKitTests/MacSteamBuildTests.swift b/Tests/HighballKitTests/MacSteamBuildTests.swift
index 8a82b2a..fe18e07 100644
--- a/Tests/HighballKitTests/MacSteamBuildTests.swift
+++ b/Tests/HighballKitTests/MacSteamBuildTests.swift
@@ -223,4 +223,16 @@ final class MacSteamBuildTests: XCTestCase {
let curated = try entry(#"{"id":"x","title":"X","steam_appid":1,"status":"community","nativeMac":{"available":true,"where":"Steam"}}"#)
XCTAssertNil(GamePageCopy.outdatedMacBuild(appInfo: .only32Bit, entry: curated), "a row about the Mac version decides")
}
+
+ // MARK: Mac builds GOG and Epic list
+
+ /// A row saying the Mac build is not the one to play outranks the store's listing, as for Steam.
+ func testRowSayingNoOutranksAStoreListing() throws {
+ let isaac = try entry(#"{"id":"the-binding-of-isaac-rebirth","title":"Isaac","steam_appid":250900,"status":"community","nativeMac":{"available":false,"where":"Steam"}}"#)
+ let cyberpunk = try entry(#"{"id":"cyberpunk-2077","title":"Cyberpunk 2077","steam_appid":1091500,"status":"community","nativeMac":{"available":true,"where":"Steam, Mac App Store, GOG, Epic"}}"#)
+ XCTAssertFalse(StoreMacBuild.listed(true, entry: isaac))
+ XCTAssertTrue(StoreMacBuild.listed(true, entry: cyberpunk))
+ XCTAssertTrue(StoreMacBuild.listed(true, entry: nil))
+ XCTAssertFalse(StoreMacBuild.listed(false, entry: cyberpunk), "a row does not make a listing")
+ }
}