diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 6bcc1f9..94e8bce 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -84,10 +84,14 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window mainLayout->addWidget(loginBox, 1, 1); - auto serverType = new QComboBox(); + serverType = new QComboBox(); serverType->insertItem(0, "Square Enix"); serverType->insertItem(1, "Sapphire"); - //serverType->setCurrentIndex(savedServerType); + + connect(serverType, &QComboBox::currentIndexChanged, [=](int index) { + getCurrentProfile().isSapphire = serverType->currentIndex() == 1; + this->window.saveSettings(); + }); loginBoxLayout->addRow("Server Lobby", serverType); @@ -250,6 +254,8 @@ void SettingsWindow::reloadControls() { ProfileSettings& profile = window.getProfile(profileWidget->currentRow()); nameEdit->setText(profile.name); directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0); + + serverType->setCurrentIndex(profile.isSapphire ? 1 : 0); rememberUsernameBox->setChecked(profile.rememberUsername); rememberPasswordBox->setChecked(profile.rememberPassword); diff --git a/src/settingswindow.h b/src/settingswindow.h index 1ac6a40..ac52197 100644 --- a/src/settingswindow.h +++ b/src/settingswindow.h @@ -24,6 +24,8 @@ private: QLineEdit* nameEdit = nullptr; QComboBox* directXCombo = nullptr; + + QComboBox* serverType = nullptr; QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr; bool currentlyReloadingControls = false;