diff --git a/include/launchercore.h b/include/launchercore.h index 394bf40..1c7a6f0 100755 --- a/include/launchercore.h +++ b/include/launchercore.h @@ -37,7 +37,6 @@ struct ProfileSettings { bool useEsync = false, useGamescope = false, useGamemode = false; bool useDX9 = false; bool enableDXVKhud = false; - bool enableDalamud = false; struct GamescopeOptions { bool fullscreen = true; @@ -47,6 +46,11 @@ struct ProfileSettings { int refreshRate = 0; } gamescope; + struct DalamudOptions { + bool enabled = false; + bool optOutOfMbCollection = false; + } dalamud; + // login bool encryptArguments = true; bool isSapphire = false; diff --git a/include/settingswindow.h b/include/settingswindow.h index f5385e3..80db206 100644 --- a/include/settingswindow.h +++ b/include/settingswindow.h @@ -55,6 +55,7 @@ private: QCheckBox* enableDalamudBox = nullptr; QLabel* dalamudVersionLabel = nullptr; QLabel* dalamudAssetVersionLabel = nullptr; + QCheckBox* dalamudOptOutBox = nullptr; bool currentlyReloadingControls = false; diff --git a/src/assetupdater.cpp b/src/assetupdater.cpp index 533b0d6..bf74cc4 100644 --- a/src/assetupdater.cpp +++ b/src/assetupdater.cpp @@ -33,7 +33,7 @@ AssetUpdater::AssetUpdater(LauncherCore& launcher) : launcher(launcher) { void AssetUpdater::update(const ProfileSettings& profile) { // non-dalamud users can bypass this process since it's not needed - if(!profile.enableDalamud) { + if(!profile.dalamud.enabled) { finishedUpdating(); return; } diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 118553c..2c1ac2d 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -64,7 +64,7 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au QString dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); - if(profile.enableDalamud) { + if(profile.dalamud.enabled) { arguments.push_back(dataDir + "/NativeLauncher.exe"); } @@ -111,7 +111,7 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au gameProcess->setProcessChannelMode(QProcess::MergedChannels); - if(profile.enableDalamud) { + if(profile.dalamud.enabled) { connect(gameProcess, &QProcess::readyReadStandardOutput, [this, gameProcess, profile] { QString output = gameProcess->readAllStandardOutput(); bool success; @@ -135,7 +135,7 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au startInfo["DelayInitializeMs"] = 0; startInfo["GameVersion"] = profile.gameVersion; startInfo["Language"] = profile.language; - startInfo["OptOutMbCollection"] = false; + startInfo["OptOutMbCollection"] = profile.dalamud.optOutOfMbCollection; QString argsEncoded = QJsonDocument(startInfo).toJson().toBase64(); @@ -358,7 +358,8 @@ void LauncherCore::readInitialInformation() { profile.gamescope.height = settings.value("gamescopeHeight", defaultSettings.gamescope.height).toInt(); profile.gamescope.refreshRate = settings.value("gamescopeRefreshRate", defaultSettings.gamescope.refreshRate).toInt(); - profile.enableDalamud = settings.value("enableDalamud", defaultSettings.enableDalamud).toBool(); + profile.dalamud.enabled = settings.value("enableDalamud", defaultSettings.dalamud.enabled).toBool(); + profile.dalamud.optOutOfMbCollection = settings.value("dalamudOptOut", defaultSettings.dalamud.optOutOfMbCollection).toBool(); profileSettings[settings.value("index").toInt()] = profile; @@ -544,7 +545,8 @@ void LauncherCore::saveSettings() { settings.setValue("rememberPassword", profile.rememberPassword); settings.setValue("useSteam", profile.useSteam); - settings.setValue("enableDalamud", profile.enableDalamud); + settings.setValue("enableDalamud", profile.dalamud.enabled); + settings.setValue("dalamudOptOut", profile.dalamud.optOutOfMbCollection); settings.setValue("enableWatchdog", profile.enableWatchdog); settings.endGroup(); diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index a676445..282409f 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -364,12 +364,20 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC enableDalamudBox = new QCheckBox(); connect(enableDalamudBox, &QCheckBox::stateChanged, [=](int) { - getCurrentProfile().enableDalamud = enableDalamudBox->isChecked(); + getCurrentProfile().dalamud.enabled = enableDalamudBox->isChecked(); this->core.saveSettings(); }); dalamudBoxLayout->addRow("Enable Dalamud Injection", enableDalamudBox); + dalamudOptOutBox = new QCheckBox(); + connect(dalamudOptOutBox, &QCheckBox::stateChanged, [=](int) { + getCurrentProfile().dalamud.optOutOfMbCollection = dalamudOptOutBox->isChecked(); + + this->core.saveSettings(); + }); + dalamudBoxLayout->addRow("Opt Out of Automatic Marketboard Collection", dalamudOptOutBox); + dalamudVersionLabel = new QLabel(); dalamudBoxLayout->addRow("Dalamud Version", dalamudVersionLabel); @@ -476,7 +484,7 @@ void SettingsWindow::reloadControls() { useSteamBox->setChecked(profile.useSteam); // dalamud - enableDalamudBox->setChecked(profile.enableDalamud); + enableDalamudBox->setChecked(profile.dalamud.enabled); if(core.dalamudVersion.isEmpty()) { dalamudVersionLabel->setText("Dalamud is not installed."); } else { @@ -489,6 +497,8 @@ void SettingsWindow::reloadControls() { dalamudAssetVersionLabel->setText(QString::number(core.dalamudAssetVersion)); } + dalamudOptOutBox->setChecked(profile.dalamud.optOutOfMbCollection); + window.reloadControls(); currentlyReloadingControls = false;