From ada56f7212316cab651e237c19fcbb815d81f219 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 23 Feb 2022 17:14:10 -0500 Subject: [PATCH] Only launch Dalamud once and if a pid is found --- src/launchercore.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 287657c..35dfe12 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -153,15 +153,22 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au gameArgs.push_back({"IsSteam", "1"}); gameProcess->environment() << "IS_FFXIV_LAUNCH_FROM_STEAM=1"; } + gameProcess->setProcessChannelMode(QProcess::MergedChannels); if(profile.enableDalamud) { connect(gameProcess, &QProcess::readyReadStandardOutput, [this, gameProcess, profile] { QString output = gameProcess->readAllStandardOutput(); + bool success; + int dec = output.toInt(&success, 10); + if(!success) + return; + + qDebug() << "got output: " << output; qDebug() << "Now launching dalamud..."; auto dalamudProcess = new QProcess(); - dalamudProcess->setProcessChannelMode(QProcess::ForwardedChannels); + dalamudProcess->setProcessChannelMode(QProcess::MergedChannels); QStringList dalamudEnv = gameProcess->environment();