mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-24 13:27:45 +00:00
Add encrypt game argument option
This commit is contained in:
parent
78c0bc3d60
commit
bce85b2694
4 changed files with 19 additions and 2 deletions
|
@ -96,6 +96,15 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window
|
||||||
|
|
||||||
mainLayout->addWidget(loginBox, 2, 1);
|
mainLayout->addWidget(loginBox, 2, 1);
|
||||||
|
|
||||||
|
encryptArgumentsBox = new QCheckBox();
|
||||||
|
connect(encryptArgumentsBox, &QCheckBox::stateChanged, [=](int) {
|
||||||
|
getCurrentProfile().encryptArguments = encryptArgumentsBox->isChecked();
|
||||||
|
|
||||||
|
this->window.reloadControls();
|
||||||
|
this->window.saveSettings();
|
||||||
|
});
|
||||||
|
loginBoxLayout->addRow("Encrypt Game Arguments", encryptArgumentsBox);
|
||||||
|
|
||||||
serverType = new QComboBox();
|
serverType = new QComboBox();
|
||||||
serverType->insertItem(0, "Square Enix");
|
serverType->insertItem(0, "Square Enix");
|
||||||
serverType->insertItem(1, "Sapphire");
|
serverType->insertItem(1, "Sapphire");
|
||||||
|
@ -302,6 +311,7 @@ void SettingsWindow::reloadControls() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// login
|
// login
|
||||||
|
encryptArgumentsBox->setChecked(profile.encryptArguments);
|
||||||
serverType->setCurrentIndex(profile.isSapphire ? 1 : 0);
|
serverType->setCurrentIndex(profile.isSapphire ? 1 : 0);
|
||||||
lobbyServerURL->setEnabled(profile.isSapphire);
|
lobbyServerURL->setEnabled(profile.isSapphire);
|
||||||
lobbyServerURL->setText(profile.lobbyURL);
|
lobbyServerURL->setText(profile.lobbyURL);
|
||||||
|
|
|
@ -39,6 +39,7 @@ private:
|
||||||
QCheckBox* useGamescope, *useEsync, *useGamemode;
|
QCheckBox* useGamescope, *useEsync, *useGamemode;
|
||||||
|
|
||||||
// login
|
// login
|
||||||
|
QCheckBox* encryptArgumentsBox = nullptr;
|
||||||
QComboBox* serverType = nullptr;
|
QComboBox* serverType = nullptr;
|
||||||
QLineEdit* lobbyServerURL = nullptr;
|
QLineEdit* lobbyServerURL = nullptr;
|
||||||
QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr;
|
QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr;
|
||||||
|
|
|
@ -142,8 +142,7 @@ void LauncherWindow::launchGame(const LoginAuth auth) {
|
||||||
arguments.push_back(QString("DEV.LobbyHost0%1=%2 DEV.LobbyPort0%1=54994").arg(QString::number(i), auth.lobbyhost));
|
arguments.push_back(QString("DEV.LobbyHost0%1=%2 DEV.LobbyPort0%1=54994").arg(QString::number(i), auth.lobbyhost));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool encryptArguments = true;
|
if(currentProfile().encryptArguments) {
|
||||||
if(encryptArguments) {
|
|
||||||
auto executable = arguments[0];
|
auto executable = arguments[0];
|
||||||
arguments.removeFirst();
|
arguments.removeFirst();
|
||||||
|
|
||||||
|
@ -279,6 +278,8 @@ void LauncherWindow::readInitialInformation() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// login
|
||||||
|
profile.encryptArguments = settings.value("encryptArguments", false).toBool();
|
||||||
profile.isSapphire = settings.value("isSapphire", false).toBool();
|
profile.isSapphire = settings.value("isSapphire", false).toBool();
|
||||||
profile.lobbyURL = settings.value("lobbyURL", "").toString();
|
profile.lobbyURL = settings.value("lobbyURL", "").toString();
|
||||||
profile.rememberUsername = settings.value("rememberUsername", false).toBool();
|
profile.rememberUsername = settings.value("rememberUsername", false).toBool();
|
||||||
|
@ -525,6 +526,7 @@ void LauncherWindow::saveSettings() {
|
||||||
settings.setValue("useGamemode", profile.useGamemode);
|
settings.setValue("useGamemode", profile.useGamemode);
|
||||||
|
|
||||||
// login
|
// login
|
||||||
|
settings.setValue("encryptArguments", profile.encryptArguments);
|
||||||
settings.setValue("isSapphire", profile.isSapphire);
|
settings.setValue("isSapphire", profile.isSapphire);
|
||||||
settings.setValue("lobbyURL", profile.lobbyURL);
|
settings.setValue("lobbyURL", profile.lobbyURL);
|
||||||
settings.setValue("rememberUsername", profile.rememberUsername);
|
settings.setValue("rememberUsername", profile.rememberUsername);
|
||||||
|
|
|
@ -17,10 +17,12 @@ struct ProfileSettings {
|
||||||
QUuid uuid;
|
QUuid uuid;
|
||||||
QString name;
|
QString name;
|
||||||
|
|
||||||
|
// game
|
||||||
int language = 1; // 1 is english, thats all i know
|
int language = 1; // 1 is english, thats all i know
|
||||||
QString gamePath, winePath, winePrefixPath;
|
QString gamePath, winePath, winePrefixPath;
|
||||||
QString bootVersion, gameVersion;
|
QString bootVersion, gameVersion;
|
||||||
|
|
||||||
|
// wine
|
||||||
// 0 = system, 1 = custom, 2 = built-in (mac only)
|
// 0 = system, 1 = custom, 2 = built-in (mac only)
|
||||||
// TODO: yes, i know this should be an enum
|
// TODO: yes, i know this should be an enum
|
||||||
int wineVersion = 0;
|
int wineVersion = 0;
|
||||||
|
@ -28,6 +30,8 @@ struct ProfileSettings {
|
||||||
bool useDX9 = false;
|
bool useDX9 = false;
|
||||||
bool enableDXVKhud = false;
|
bool enableDXVKhud = false;
|
||||||
|
|
||||||
|
// login
|
||||||
|
bool encryptArguments = false;
|
||||||
bool isSapphire = false;
|
bool isSapphire = false;
|
||||||
QString lobbyURL;
|
QString lobbyURL;
|
||||||
bool rememberUsername = false, rememberPassword = false;
|
bool rememberUsername = false, rememberPassword = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue