From 4e337f8ab9365a6cdb9a48aabdc131ba79908cdb Mon Sep 17 00:00:00 2001 From: blackxfiied <41133734+blackxfiied@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:52:34 +0800 Subject: [PATCH] fix: show engine install button alongside other buttons instead of standalone --- Mythic/Views/Unified/Models/GameCardVM.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Mythic/Views/Unified/Models/GameCardVM.swift b/Mythic/Views/Unified/Models/GameCardVM.swift index 23ad6ab3..fd4eed02 100644 --- a/Mythic/Views/Unified/Models/GameCardVM.swift +++ b/Mythic/Views/Unified/Models/GameCardVM.swift @@ -64,9 +64,7 @@ import Shimmer @ViewBuilder var installedGameButtons: some View { - if case .windows = game.platform, !Engine.exists { - engineInstallButton - } else if case .epic = game.source, needsVerification(for: game) { + if case .epic = game.source, needsVerification(for: game) { verificationButton } else { if game.isLaunching { @@ -76,7 +74,11 @@ import Shimmer .foregroundStyle(.white) .padding(5) } else { - playButton + if case .windows = game.platform, !Engine.exists { + engineInstallButton + } else { + playButton + } } if game.needsUpdate { updateButton @@ -255,3 +257,8 @@ import Shimmer // swiftlint:enable nesting } } + +#Preview { + LibraryView() + .environmentObject(NetworkMonitor()) +}