diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index d80c3a0..19647e8 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "xivlauncher.h" @@ -29,17 +30,53 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window profileWidget->addItem("Default"); mainLayout->addWidget(profileWidget, 0, 0); + auto gameBox = new QGroupBox("Game Options"); + auto gameBoxLayout = new QFormLayout(); + gameBox->setLayout(gameBoxLayout); + + layout->addRow(gameBox); + + auto serverType = new QComboBox(); + serverType->insertItem(0, "Square Enix"); + serverType->insertItem(1, "Sapphire"); + //serverType->setCurrentIndex(savedServerType); + + gameBoxLayout->addRow("Server Lobby", serverType); + + auto lobbyServerURL = new QLineEdit(); + //lobbyServerURL->setText(savedLobbyURL); + gameBoxLayout->addRow("Lobby URL", lobbyServerURL); + auto directXCombo = new QComboBox(); directXCombo->setCurrentIndex(window.settings.value("directx", 0).toInt()); directXCombo->addItem("DirectX 11"); directXCombo->addItem("DirectX 9"); - layout->addRow("DirectX Version", directXCombo); + gameBoxLayout->addRow("DirectX Version", directXCombo); connect(directXCombo, &QComboBox::currentIndexChanged, [=](int index) { this->window.settings.setValue("directx", directXCombo->currentIndex()); this->window.useDX9 = directXCombo->currentIndex() == 1; }); + auto currentGameDirectory = new QLabel(window.gamePath); + currentGameDirectory->setWordWrap(true); + gameBoxLayout->addRow("Game Directory", currentGameDirectory); + + auto selectDirectoryButton = new QPushButton("Select Game Directory"); + connect(selectDirectoryButton, &QPushButton::pressed, [this, currentGameDirectory] { + this->window.gamePath = QFileDialog::getExistingDirectory(this, "Open Game Directory"); + currentGameDirectory->setText(this->window.gamePath); + + this->window.readInitialInformation(); + }); + gameBoxLayout->addWidget(selectDirectoryButton); + + auto gameDirectoryButton = new QPushButton("Open Game Directory"); + connect(gameDirectoryButton, &QPushButton::pressed, [this] { + openPath(this->window.gamePath); + }); + gameBoxLayout->addWidget(gameDirectoryButton); + #if defined(Q_OS_MAC) || defined(Q_OS_LINUX) auto wineBox = new QGroupBox("Wine Options"); auto wineBoxLayout = new QFormLayout(); @@ -159,25 +196,6 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window this->window.settings.setValue("useGamemode", static_cast(state)); }); #endif - - auto currentGameDirectory = new QLabel(window.gamePath); - currentGameDirectory->setWordWrap(true); - layout->addRow("Game Directory", currentGameDirectory); - - auto selectDirectoryButton = new QPushButton("Select Game Directory"); - connect(selectDirectoryButton, &QPushButton::pressed, [this, currentGameDirectory] { - this->window.gamePath = QFileDialog::getExistingDirectory(this, "Open Game Directory"); - currentGameDirectory->setText(this->window.gamePath); - - this->window.readInitialInformation(); - }); - layout->addWidget(selectDirectoryButton); - - auto gameDirectoryButton = new QPushButton("Open Game Directory"); - connect(gameDirectoryButton, &QPushButton::pressed, [this] { - openPath(this->window.gamePath); - }); - layout->addWidget(gameDirectoryButton); } void SettingsWindow::openPath(const QString path) { diff --git a/src/xivlauncher.cpp b/src/xivlauncher.cpp index 7ee9461..a0a4d18 100755 --- a/src/xivlauncher.cpp +++ b/src/xivlauncher.cpp @@ -240,17 +240,6 @@ LauncherWindow::LauncherWindow(QWidget* parent) : profileSelect->addItem("Default"); layout->addRow("Profile", profileSelect); - auto serverType = new QComboBox(); - serverType->insertItem(0, "Square Enix"); - serverType->insertItem(1, "Sapphire"); - serverType->setCurrentIndex(savedServerType); - - layout->addRow("Server Lobby", serverType); - - auto lobbyServerURL = new QLineEdit(); - lobbyServerURL->setText(savedLobbyURL); - layout->addRow("Lobby URL", lobbyServerURL); - auto usernameEdit = new QLineEdit(); layout->addRow("Username", usernameEdit); @@ -295,7 +284,7 @@ LauncherWindow::LauncherWindow(QWidget* parent) : auto registerButton = new QPushButton("Register"); layout->addRow(registerButton); - const auto refreshControls = [=](int index) { + /*const auto refreshControls = [=](int index) { lobbyServerURL->setEnabled(index == 1); registerButton->setEnabled(index == 1); otpEdit->setEnabled(index == 0); @@ -304,7 +293,7 @@ LauncherWindow::LauncherWindow(QWidget* parent) : connect(serverType, &QComboBox::currentIndexChanged, [=](int index) { refreshControls(index); - }); + });*/ auto emptyWidget = new QWidget(); emptyWidget->setLayout(layout); @@ -334,23 +323,23 @@ LauncherWindow::LauncherWindow(QWidget* parent) : job->start(); } - settings.setValue("serverType", serverType->currentIndex()); - settings.setValue("lobbyURL", lobbyServerURL->text()); + //settings.setValue("serverType", serverType->currentIndex()); + //settings.setValue("lobbyURL", lobbyServerURL->text()); - if(serverType->currentIndex() == 0) { + //if(serverType->currentIndex() == 0) { // begin se's booting process squareBoot->bootCheck(info); - } else { - sapphireLauncher->login(lobbyServerURL->text(), info); - } + //} else { + // sapphireLauncher->login(lobbyServerURL->text(), info); + //} }); - connect(registerButton, &QPushButton::released, [=] { + /*connect(registerButton, &QPushButton::released, [=] { if(serverType->currentIndex() == 1) { auto info = LoginInformation{usernameEdit->text(), passwordEdit->text(), otpEdit->text()}; sapphireLauncher->registerAccount(lobbyServerURL->text(), info); } - }); + });*/ } LauncherWindow::~LauncherWindow() = default;