From 84f341ec7837e0b9c1ac140fc46a32517a155440 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 30 Jan 2022 16:51:49 -0500 Subject: [PATCH] Add non-functional (for now) Steam option --- src/launchercore.cpp | 2 ++ src/launchercore.h | 1 + src/settingswindow.cpp | 9 +++++++++ src/settingswindow.h | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 8c1fef8..b2d6f5a 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -299,6 +299,7 @@ void LauncherCore::readInitialInformation() { profile.lobbyURL = settings.value("lobbyURL", "").toString(); profile.rememberUsername = settings.value("rememberUsername", false).toBool(); profile.rememberPassword = settings.value("rememberPassword", false).toBool(); + profile.useSteam = settings.value("useSteam", false).toBool(); profile.useDX9 = settings.value("useDX9", false).toBool(); profile.useEsync = settings.value("useEsync", false).toBool(); @@ -476,6 +477,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("enableDalamud", profile.enableDalamud); settings.setValue("enableWatchdog", profile.enableWatchdog); diff --git a/src/launchercore.h b/src/launchercore.h index d59fb09..098e63a 100755 --- a/src/launchercore.h +++ b/src/launchercore.h @@ -44,6 +44,7 @@ struct ProfileSettings { bool isSapphire = false; QString lobbyURL; bool rememberUsername = false, rememberPassword = false; + bool useSteam = false; }; struct LoginInformation { diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 3c08ba7..90a573e 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -163,6 +163,14 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, LauncherCore& core, QWidg }); loginBoxLayout->addRow("Remember Password?", rememberPasswordBox); + useSteamBox = new QCheckBox(); + connect(useSteamBox, &QCheckBox::stateChanged, [=](int) { + getCurrentProfile().useSteam = useSteamBox->isChecked(); + + this->core.saveSettings(); + }); + loginBoxLayout->addRow("Use Steam?", useSteamBox); + #if defined(Q_OS_MAC) || defined(Q_OS_LINUX) auto wineBox = new QGroupBox("Wine Options"); auto wineBoxLayout = new QFormLayout(); @@ -367,6 +375,7 @@ void SettingsWindow::reloadControls() { lobbyServerURL->setText(profile.lobbyURL); rememberUsernameBox->setChecked(profile.rememberUsername); rememberPasswordBox->setChecked(profile.rememberPassword); + useSteamBox->setChecked(profile.useSteam); enableDalamudBox->setChecked(profile.enableDalamud); diff --git a/src/settingswindow.h b/src/settingswindow.h index cee9e01..27f2087 100644 --- a/src/settingswindow.h +++ b/src/settingswindow.h @@ -47,9 +47,10 @@ private: QComboBox* serverType = nullptr; QLineEdit* lobbyServerURL = nullptr; QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr; + QCheckBox* useSteamBox = nullptr; bool currentlyReloadingControls = false; LauncherWindow& window; LauncherCore& core; -}; \ No newline at end of file +};