diff --git a/launcher/Application.cpp b/launcher/Application.cpp index f6f2b0486..960b4cc4e 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -318,6 +318,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv) { { "a", "profile" }, "Use the account specified by its profile name (only valid in combination with --launch)", "profile" }, { { "o", "offline" }, "Launch offline, with given player name (only valid in combination with --launch)", "offline" }, { "alive", "Write a small '" + liveCheckFile + "' file after the launcher starts" }, + { "show-window", "Show the main launcher window (useful in combination with --launch)" }, { { "I", "import" }, "Import instance or resource from specified local path or URL", "url" }, { "show", "Opens the window for the specified instance (by instance ID)", "show" } }); // Has to be positional for some OS to handle that properly @@ -339,6 +340,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv) m_liveCheck = parser.isSet("alive"); m_instanceIdToShowWindowOf = parser.value("show"); + m_showMainWindow = parser.isSet("show-window"); for (auto url : parser.values("import")) { m_urlsToImport.append(normalizeImportUrl(url)); @@ -1353,7 +1355,10 @@ void Application::performMainStartupAction() } launch(inst, m_launchOffline ? LaunchMode::Offline : LaunchMode::Normal, targetToJoin, accountToUse, m_offlineName); - return; + + if (!m_showMainWindow) { + return; + } } } if (!m_instanceIdToShowWindowOf.isEmpty()) { diff --git a/launcher/Application.h b/launcher/Application.h index 1b483612d..936e13d71 100644 --- a/launcher/Application.h +++ b/launcher/Application.h @@ -314,6 +314,7 @@ class Application : public QApplication { bool m_liveCheck = false; QList m_urlsToImport; QString m_instanceIdToShowWindowOf; + bool m_showMainWindow = false; std::unique_ptr logFile; std::unique_ptr logModel;