1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-23 12:57:45 +00:00

Close and hide launcher window if requested

This commit is contained in:
Joshua Goins 2023-07-30 16:20:51 -04:00
parent 0658dd9a3e
commit 061a6776db
2 changed files with 16 additions and 0 deletions

View file

@ -86,6 +86,10 @@ void LauncherCore::beginVanillaGame(const QString &gameExecutablePath, const Pro
{
auto gameProcess = new QProcess(this);
gameProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment());
connect(gameProcess, qOverload<int>(&QProcess::finished), this, [this](int exitCode) {
Q_UNUSED(exitCode)
Q_EMIT gameClosed();
});
auto args = getGameArgs(profile, auth);
@ -101,6 +105,10 @@ void LauncherCore::beginDalamudGame(const QString &gameExecutablePath, const Pro
dataDir = "Z:" + dataDir.replace('/', '\\');
auto dalamudProcess = new QProcess(this);
connect(dalamudProcess, qOverload<int>(&QProcess::finished), this, [this](int exitCode) {
Q_UNUSED(exitCode)
Q_EMIT gameClosed();
});
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("DALAMUD_RUNTIME", dataDir + "\\DalamudRuntime");

View file

@ -54,6 +54,14 @@ Kirigami.ApplicationWindow {
function onLoadingFinished() {
checkSetup()
}
function onSuccessfulLaunch() {
hide()
}
function onGameClosed() {
Qt.callLater(Qt.quit)
}
}
Component.onCompleted: checkSetup()