From 65dd2cc375ca8d5f3d85428374d9804ea26abaf9 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 17 Apr 2022 22:53:39 -0400 Subject: [PATCH] Make Astra actually close when the game launches, if you request it to This option was completely broken, as the window would close even if you didn't want it to, and the launcher would never exit. Now this option actually does what it's supposed to. --- src/launchercore.cpp | 4 ++++ src/launcherwindow.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 4c161ca..50d3ad4 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -181,6 +181,10 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au socket->listen(QHostAddress::Any, 5248); } + connect(gameProcess, qOverload(&QProcess::finished), this, [this](int code, QProcess::ExitStatus status) { + gameClosed(); + }); + launchGameExecutable(profile, gameProcess, arguments); successfulLaunch(); diff --git a/src/launcherwindow.cpp b/src/launcherwindow.cpp index 8c676d4..94ce81d 100644 --- a/src/launcherwindow.cpp +++ b/src/launcherwindow.cpp @@ -288,7 +288,8 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo }); connect(&core, &LauncherCore::successfulLaunch, [&] { - hide(); + if(core.appSettings.closeWhenLaunched) + hide(); }); connect(&core, &LauncherCore::gameClosed, [&] {