From 6a54e85a104af344ac87f3d63dd5700faf39bdef Mon Sep 17 00:00:00 2001 From: redstrate Date: Tue, 2 Nov 2021 14:53:46 -0400 Subject: [PATCH] Add support for using system WINE for macOS * Could potentially increase performance by using a more recent DXVK + Wine + MVK version :-) --- src/settingswindow.cpp | 38 +++++++++++++++++++++++++++++++++++--- src/xivlauncher.cpp | 7 ++++++- src/xivlauncher.h | 1 + 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 6e663a3..a37724b 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "xivlauncher.h" @@ -31,13 +32,40 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window this->window.useDX9 = directXCombo->currentIndex() == 1; }); + auto infoLabel = new QLabel("This is a list of possible enhancements you can make to your Wine gaming experience.\n" + "This is all stuff you can do outside of the launcher, but we can take care of it for you."); + infoLabel->setWordWrap(true); + +#if defined(Q_OS_MAC) + auto wineBox = new QGroupBox("Wine Options"); + auto wineBoxLayout = new QFormLayout(); + wineBox->setLayout(wineBoxLayout); + + wineBoxLayout->addWidget(infoLabel); + + auto useSystemWine = new QCheckBox("Use System Wine"); + useSystemWine->setChecked(window.settings.value("useSystemWine", false).toBool()); + wineBoxLayout->addWidget(useSystemWine); + + connect(useSystemWine, &QCheckBox::stateChanged, [this](int state) { + this->window.useSystemWine = state; + this->window.settings.setValue("useSystemWine", static_cast(state)); + }); + + auto systemWineLabel = new QLabel("Use the system wine instead of the one packaged with the macOS version of FFXIV.\n" + "You can easily install wine through homebrew, but please note that the game will not run out of the box\n" + "on DX11 without DXVK installed."); + systemWineLabel->setWordWrap(true); + wineBoxLayout->addWidget(systemWineLabel); + + layout->addRow(wineBox); +#endif + #if defined(Q_OS_LINUX) auto wineBox = new QGroupBox("Wine Options"); auto wineBoxLayout = new QFormLayout(); wineBox->setLayout(wineBoxLayout); - auto infoLabel = new QLabel("This is a list of possible enhancements you can make to your Wine gaming experience.\n" - "This is all stuff you can do outside of the launcher, but we can take care of it for you."); wineBoxLayout->addWidget(infoLabel); auto useEsync = new QCheckBox("Use Esync"); @@ -46,6 +74,7 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window auto esyncLabel = new QLabel("Improves general game performance, but requires a Wine built with the Esync patches.\n" "If you use the latest Wine staging, it should work."); + esyncLabel->setWordWrap(true); wineBoxLayout->addWidget(esyncLabel); connect(useEsync, &QCheckBox::stateChanged, [this](int state) { @@ -59,6 +88,7 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window auto gamescopeLabel = new QLabel("Use the SteamOS compositor that uses Wayland.\n" "If you are experiencing input issues on XWayland, try this option if you have it installed."); + gamescopeLabel->setWordWrap(true); wineBoxLayout->addWidget(gamescopeLabel); connect(useGamescope, &QCheckBox::stateChanged, [this](int state) { @@ -72,6 +102,7 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window auto gamemodeLabel = new QLabel("Use Feral Interactive's GameMode, which applies a couple of performance enhancements.\n" "May give a slight performance boost, but requires GameMode to be installed.\n"); + gamemodeLabel->setWordWrap(true); wineBoxLayout->addWidget(gamemodeLabel); connect(useGamemode, &QCheckBox::stateChanged, [this](int state) { @@ -82,7 +113,8 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window layout->addRow(wineBox); #endif - auto currentGameDirectory = new QLabel(window.gamePath); + auto currentGameDirectory = new QLineEdit(window.gamePath); + currentGameDirectory->setEnabled(false); layout->addRow("Game Directory", currentGameDirectory); auto selectDirectoryButton = new QPushButton("Select Game Directory"); diff --git a/src/xivlauncher.cpp b/src/xivlauncher.cpp index 0013805..87ec890 100755 --- a/src/xivlauncher.cpp +++ b/src/xivlauncher.cpp @@ -77,7 +77,11 @@ void LauncherWindow::launchExecutable(const QStringList args) { // for platforms using wine, set wine before ffxiv_dx11.exe // TODO: make wine path configurable #if defined(Q_OS_MACOS) - arguments.push_back("/Applications/FINAL FANTASY XIV ONLINE.app/Contents/SharedSupport/finalfantasyxiv/FINAL FANTASY XIV ONLINE/wine"); + if(useSystemWine) { + arguments.push_back("/usr/local/bin/wine64"); + } else { + arguments.push_back("/Applications/FINAL FANTASY XIV ONLINE.app/Contents/SharedSupport/finalfantasyxiv/FINAL FANTASY XIV ONLINE/wine"); + } #endif #if defined(Q_OS_LINUX) @@ -138,6 +142,7 @@ void LauncherWindow::readInitialInformation() { useEsync = settings.value("useEsync", false).toBool(); useGamemode = settings.value("useGamemode", false).toBool(); useGamescope = settings.value("useGamescope", false).toBool(); + useSystemWine = settings.value("useSystemWine", false).toBool(); } LauncherWindow::LauncherWindow(QWidget* parent) : diff --git a/src/xivlauncher.h b/src/xivlauncher.h index 9e5fe21..015d0ad 100755 --- a/src/xivlauncher.h +++ b/src/xivlauncher.h @@ -37,6 +37,7 @@ public: bool useEsync, useGamescope, useGamemode; bool useDX9 = false; + bool useSystemWine = false; void launchGame(const LoginAuth auth); void launchExecutable(const QStringList args);