diff --git a/include/launchercore.h b/include/launchercore.h index 3ca076a..4930470 100755 --- a/include/launchercore.h +++ b/include/launchercore.h @@ -17,8 +17,7 @@ class Watchdog; enum class GameLicense { WindowsStandalone, WindowsSteam, - macOS, - FreeTrial + macOS }; enum class WineType { @@ -86,6 +85,7 @@ struct ProfileSettings { bool useOneTimePassword = false; GameLicense license = GameLicense::WindowsStandalone; + bool isFreeTrial = false; }; struct AppSettings { diff --git a/include/settingswindow.h b/include/settingswindow.h index d99aeef..02f55ac 100644 --- a/include/settingswindow.h +++ b/include/settingswindow.h @@ -54,6 +54,7 @@ private: QLineEdit* lobbyServerURL = nullptr; QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr; QComboBox* gameLicenseBox = nullptr; + QCheckBox* freeTrialBox = nullptr; QCheckBox* useOneTimePassword = nullptr; // dalamud diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 9d23195..dad3401 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -414,6 +414,7 @@ void LauncherCore::readInitialInformation() { profile.rememberPassword = settings.value("rememberPassword", defaultSettings.rememberPassword).toBool(); profile.useOneTimePassword = settings.value("useOneTimePassword", defaultSettings.useOneTimePassword).toBool(); profile.license = (GameLicense)settings.value("license", (int)defaultSettings.license).toInt(); + profile.isFreeTrial = settings.value("isFreeTrial", defaultSettings.isFreeTrial).toBool(); profile.useDX9 = settings.value("useDX9", defaultSettings.useDX9).toBool(); @@ -655,6 +656,7 @@ void LauncherCore::saveSettings() { settings.setValue("rememberPassword", profile.rememberPassword); settings.setValue("useOneTimePassword", profile.useOneTimePassword); settings.setValue("license", (int)profile.license); + settings.setValue("isFreeTrial", profile.isFreeTrial); settings.setValue("enableDalamud", profile.dalamud.enabled); settings.setValue("dalamudOptOut", profile.dalamud.optOutOfMbCollection); diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 2eee046..3d6bad7 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -221,6 +221,15 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC loginBoxLayout->addRow("Game License", gameLicenseBox); + freeTrialBox = new QCheckBox(); + connect(freeTrialBox, &QCheckBox::stateChanged, [=](int) { + getCurrentProfile().isFreeTrial = + freeTrialBox->isChecked(); + + this->core.saveSettings(); + }); + loginBoxLayout->addRow("Is Free Trial", freeTrialBox); + rememberUsernameBox = new QCheckBox(); connect(rememberUsernameBox, &QCheckBox::stateChanged, [=](int) { getCurrentProfile().rememberUsername = @@ -555,6 +564,8 @@ void SettingsWindow::reloadControls() { gameLicenseBox->setToolTip(""); } + freeTrialBox->setChecked(profile.isFreeTrial); + // dalamud enableDalamudBox->setChecked(profile.dalamud.enabled); if(core.dalamudVersion.isEmpty()) { diff --git a/src/squarelauncher.cpp b/src/squarelauncher.cpp index 2ffe0eb..94f70f2 100644 --- a/src/squarelauncher.cpp +++ b/src/squarelauncher.cpp @@ -37,7 +37,7 @@ void SquareLauncher::getStored(const LoginInformation& info) { query.addQueryItem("lng", "en"); // for some reason, we always use region 3. the actual region is acquired later query.addQueryItem("rgn", "3"); - query.addQueryItem("isft", info.settings->license == GameLicense::FreeTrial ? "1" : "0"); + query.addQueryItem("isft", info.settings->isFreeTrial ? "1" : "0"); query.addQueryItem("cssmode", "1"); query.addQueryItem("isnew", "1"); query.addQueryItem("launchver", "3");