Add -ql argument to launch QLaunch at startup

This commit is contained in:
ddutchie 2024-03-10 23:20:48 +00:00 committed by Mike Lothian
parent 7c8d55cc62
commit 9186774f3d

View File

@ -490,6 +490,7 @@ GMainWindow::GMainWindow(std::unique_ptr<QtConfig> config_, bool has_broken_vulk
QString game_path;
bool has_gamepath = false;
bool is_fullscreen = false;
bool is_qlaunch = false;
for (int i = 1; i < args.size(); ++i) {
// Preserves drag/drop functionality
@ -504,7 +505,11 @@ GMainWindow::GMainWindow(std::unique_ptr<QtConfig> config_, bool has_broken_vulk
is_fullscreen = true;
continue;
}
// Use QLaunch at startup
if (args[i] == QStringLiteral("-ql")) {
is_qlaunch = true;
continue;
}
// Launch game with a specific user
if (args[i] == QStringLiteral("-u")) {
if (i >= args.size() - 1) {
@ -562,7 +567,10 @@ GMainWindow::GMainWindow(std::unique_ptr<QtConfig> config_, bool has_broken_vulk
if (has_gamepath || is_fullscreen) {
ui->action_Fullscreen->setChecked(is_fullscreen);
}
// Open HomeMenu
if (!has_gamepath && is_qlaunch) {
OnHomeMenu();
}
if (!game_path.isEmpty()) {
BootGame(game_path, ApplicationAppletParameters());
}