mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-22 04:37:46 +00:00
Add button to use official launcher in certain cases
This commit is contained in:
parent
f4f3bfb07c
commit
9668c0c30e
5 changed files with 22 additions and 3 deletions
|
@ -452,3 +452,12 @@ void LauncherCore::saveSettings() {
|
|||
settings.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
void LauncherCore::addUpdateButtons(const ProfileSettings& settings, QMessageBox& messageBox) {
|
||||
auto launcherButton = messageBox.addButton("Launch Official Launcher", QMessageBox::NoRole);
|
||||
connect(launcherButton, &QPushButton::clicked, [=] {
|
||||
launchExecutable(settings, {settings.gamePath + "/boot/ffxivboot64.exe"});
|
||||
});
|
||||
|
||||
messageBox.addButton(QMessageBox::StandardButton::Ok);
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
#include <QSettings>
|
||||
#include <QUuid>
|
||||
#include <QProcess>
|
||||
#include <QMessageBox>
|
||||
|
||||
class SapphireLauncher;
|
||||
class SquareLauncher;
|
||||
|
@ -82,6 +83,8 @@ public:
|
|||
void readWineInfo(ProfileSettings& settings);
|
||||
void saveSettings();
|
||||
|
||||
void addUpdateButtons(const ProfileSettings& settings, QMessageBox& messageBox);
|
||||
|
||||
QSettings settings;
|
||||
|
||||
SapphireLauncher* sapphireLauncher;
|
||||
|
|
|
@ -185,15 +185,15 @@ void LauncherWindow::reloadControls() {
|
|||
});
|
||||
}
|
||||
|
||||
const bool isLockedOut = !currentProfile().isSapphire && !core.squareLauncher->isGateOpen;
|
||||
const bool canLogin = currentProfile().isSapphire || (!currentProfile().isSapphire && core.squareLauncher->isGateOpen);
|
||||
|
||||
if(!isLockedOut) {
|
||||
if(canLogin) {
|
||||
loginButton->setText("Login");
|
||||
} else {
|
||||
loginButton->setText("Login (Maintenance is in progress)");
|
||||
}
|
||||
|
||||
loginButton->setEnabled(!isLockedOut);
|
||||
loginButton->setEnabled(canLogin);
|
||||
registerButton->setEnabled(currentProfile().isSapphire);
|
||||
otpEdit->setEnabled(!currentProfile().isSapphire);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <QUrlQuery>
|
||||
#include <QNetworkReply>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "squarelauncher.h"
|
||||
|
||||
|
@ -31,6 +32,8 @@ void SquareBoot::bootCheck(LoginInformation& info) {
|
|||
launcher.getStored(info);
|
||||
} else {
|
||||
auto messageBox = new QMessageBox(QMessageBox::Icon::Critical, "Failed to Login", "Failed to launch. The game may require an update, please use another launcher.");
|
||||
window.addUpdateButtons(*info.settings, *messageBox);
|
||||
|
||||
messageBox->show();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -84,6 +84,8 @@ void SquareLauncher::login(const LoginInformation& info, const QUrl referer) {
|
|||
|
||||
if(!terms || !playable) {
|
||||
auto messageBox = new QMessageBox(QMessageBox::Icon::Critical, "Failed to Login", "Your game is unplayable. You may need to accept the terms from the official launcher.");
|
||||
window.addUpdateButtons(*info.settings, *messageBox);
|
||||
|
||||
messageBox->show();
|
||||
} else {
|
||||
SID = parts[1];
|
||||
|
@ -126,6 +128,8 @@ void SquareLauncher::registerSession(const LoginInformation& info) {
|
|||
window.launchGame(*info.settings, auth);
|
||||
} else {
|
||||
auto messageBox = new QMessageBox(QMessageBox::Icon::Critical, "Failed to Login", "Failed the anti-tamper check. Please restore your game to the original state or update the game.");
|
||||
window.addUpdateButtons(*info.settings, *messageBox);
|
||||
|
||||
messageBox->show();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue