diff --git a/include/launchercore.h b/include/launchercore.h index 1c7a6f0..a4f447f 100755 --- a/include/launchercore.h +++ b/include/launchercore.h @@ -14,6 +14,12 @@ class SquareBoot; class AssetUpdater; class Watchdog; +enum class GameLicense { + WindowsStandalone, + WindowsSteam, + macOS +}; + struct ProfileSettings { QUuid uuid; QString name; @@ -56,7 +62,8 @@ struct ProfileSettings { bool isSapphire = false; QString lobbyURL; bool rememberUsername = false, rememberPassword = false; - bool useSteam = false; + + GameLicense license = GameLicense::WindowsStandalone; }; struct AppSettings { diff --git a/include/settingswindow.h b/include/settingswindow.h index 80db206..ef381af 100644 --- a/include/settingswindow.h +++ b/include/settingswindow.h @@ -49,7 +49,7 @@ private: QComboBox* serverType = nullptr; QLineEdit* lobbyServerURL = nullptr; QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr; - QCheckBox* useSteamBox = nullptr; + QComboBox* gameLicenseBox = nullptr; // dalamud QCheckBox* enableDalamudBox = nullptr; diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 1d39a4e..c656b9a 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -101,7 +101,7 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - if(profile.useSteam) { + if(profile.license == GameLicense::WindowsSteam) { gameArgs.push_back({"IsSteam", "1"}); env.insert("IS_FFXIV_LAUNCH_FROM_STEAM", QString::number(1)); } @@ -337,7 +337,7 @@ void LauncherCore::readInitialInformation() { profile.lobbyURL = settings.value("lobbyURL", defaultSettings.lobbyURL).toString(); profile.rememberUsername = settings.value("rememberUsername", defaultSettings.rememberUsername).toBool(); profile.rememberPassword = settings.value("rememberPassword", defaultSettings.rememberPassword).toBool(); - profile.useSteam = settings.value("useSteam", defaultSettings.useSteam).toBool(); + profile.license = (GameLicense)settings.value("license", (int)defaultSettings.license).toInt(); profile.useDX9 = settings.value("useDX9", defaultSettings.useDX9).toBool(); profile.useEsync = settings.value("useEsync", defaultSettings.useEsync).toBool(); @@ -543,7 +543,7 @@ void LauncherCore::saveSettings() { settings.setValue("lobbyURL", profile.lobbyURL); settings.setValue("rememberUsername", profile.rememberUsername); settings.setValue("rememberPassword", profile.rememberPassword); - settings.setValue("useSteam", profile.useSteam); + settings.setValue("license", (int)profile.license); settings.setValue("enableDalamud", profile.dalamud.enabled); settings.setValue("dalamudOptOut", profile.dalamud.optOutOfMbCollection); diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 282409f..4793cd2 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -177,6 +177,22 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC loginBoxLayout->addRow("Server Lobby", serverType); + gameLicenseBox = new QComboBox(); + gameLicenseBox->insertItem(0, "Windows Standalone"); + gameLicenseBox->insertItem(1, "Windows Steam"); + gameLicenseBox->insertItem(2, "macOS"); + + connect(gameLicenseBox, + static_cast( + &QComboBox::currentIndexChanged), + [=](int index) { + getCurrentProfile().license = (GameLicense)index; + + this->core.saveSettings(); + }); + + loginBoxLayout->addRow("Game License", gameLicenseBox); + lobbyServerURL = new QLineEdit(); connect(lobbyServerURL, &QLineEdit::editingFinished, [=] { getCurrentProfile().lobbyURL = lobbyServerURL->text(); @@ -202,14 +218,6 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC }); loginBoxLayout->addRow("Remember Password", rememberPasswordBox); - useSteamBox = new QCheckBox(); - connect(useSteamBox, &QCheckBox::stateChanged, [=](int) { - getCurrentProfile().useSteam = useSteamBox->isChecked(); - - this->core.saveSettings(); - }); - loginBoxLayout->addRow("Is Steam Account", useSteamBox); - #if defined(Q_OS_MAC) || defined(Q_OS_LINUX) auto wineBox = new QGroupBox("Wine Options"); auto wineBoxLayout = new QFormLayout(); @@ -481,7 +489,7 @@ void SettingsWindow::reloadControls() { lobbyServerURL->setText(profile.lobbyURL); rememberUsernameBox->setChecked(profile.rememberUsername); rememberPasswordBox->setChecked(profile.rememberPassword); - useSteamBox->setChecked(profile.useSteam); + gameLicenseBox->setCurrentIndex((int)profile.license); // dalamud enableDalamudBox->setChecked(profile.dalamud.enabled); diff --git a/src/squarelauncher.cpp b/src/squarelauncher.cpp index 4f60ece..2a1b863 100644 --- a/src/squarelauncher.cpp +++ b/src/squarelauncher.cpp @@ -36,7 +36,7 @@ void SquareLauncher::getStored(const LoginInformation& info) { query.addQueryItem("isft", "0"); query.addQueryItem("cssmode", "1"); query.addQueryItem("isnew", "1"); - query.addQueryItem("issteam", info.settings->useSteam ? "1" : "0"); + query.addQueryItem("issteam", info.settings->license == GameLicense::WindowsSteam ? "1" : "0"); QUrl url("https://ffxiv-login.square-enix.com/oauth/ffxivarr/login/top"); url.setQuery(query);