diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp index f3ed76c..a0dbf76 100755 --- a/launcher/src/launchercore.cpp +++ b/launcher/src/launchercore.cpp @@ -86,6 +86,10 @@ void LauncherCore::beginVanillaGame(const QString &gameExecutablePath, const Pro { auto gameProcess = new QProcess(this); gameProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); + connect(gameProcess, qOverload(&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(&QProcess::finished), this, [this](int exitCode) { + Q_UNUSED(exitCode) + Q_EMIT gameClosed(); + }); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("DALAMUD_RUNTIME", dataDir + "\\DalamudRuntime"); diff --git a/launcher/ui/main.qml b/launcher/ui/main.qml index a40ff59..977e50e 100644 --- a/launcher/ui/main.qml +++ b/launcher/ui/main.qml @@ -54,6 +54,14 @@ Kirigami.ApplicationWindow { function onLoadingFinished() { checkSetup() } + + function onSuccessfulLaunch() { + hide() + } + + function onGameClosed() { + Qt.callLater(Qt.quit) + } } Component.onCompleted: checkSetup()