diff --git a/launcher/include/launchercore.h b/launcher/include/launchercore.h index 3ad5ced..9b60876 100755 --- a/launcher/include/launchercore.h +++ b/launcher/include/launchercore.h @@ -87,6 +87,10 @@ public: /// check the result to see whether they need to "reset" or show a failed state or not. \note The login process is asynchronous. Q_INVOKABLE bool autoLogin(Profile *profile); + /// Launches the game without patching, or logging in. + /// Meant to test if we can get to the title screen and is intended to fail to do anything else. + Q_INVOKABLE void immediatelyLaunch(Profile *profile); + Q_INVOKABLE GameInstaller *createInstaller(Profile *profile); Q_INVOKABLE GameInstaller *createInstallerFromExisting(Profile *profile, const QString &filePath); Q_INVOKABLE CompatibilityToolInstaller *createCompatInstaller(); diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp index 1029f14..6a2279e 100755 --- a/launcher/src/launchercore.cpp +++ b/launcher/src/launchercore.cpp @@ -103,6 +103,13 @@ bool LauncherCore::autoLogin(Profile *profile) return true; } +void LauncherCore::immediatelyLaunch(Profile *profile) +{ + Q_ASSERT(profile != nullptr); + + m_runner->beginGameExecutable(*profile, std::nullopt); +} + GameInstaller *LauncherCore::createInstaller(Profile *profile) { Q_ASSERT(profile != nullptr); @@ -354,17 +361,17 @@ QCoro::Task<> LauncherCore::beginLogin(LoginInformation &info) info.profile->account()->updateConfig(); } + std::optional auth; + if (!info.profile->isBenchmark()) { + if (info.profile->account()->isSapphire()) { + auth = co_await m_sapphireLogin->login(info.profile->account()->lobbyUrl(), info); + } else { + auth = co_await m_squareEnixLogin->login(&info); + } + } + auto assetUpdater = new AssetUpdater(*info.profile, *this, this); if (co_await assetUpdater->update()) { - std::optional auth; - if (!info.profile->isBenchmark()) { - if (info.profile->account()->isSapphire()) { - auth = co_await m_sapphireLogin->login(info.profile->account()->lobbyUrl(), info); - } else { - auth = co_await m_squareEnixLogin->login(&info); - } - } - // If we expect an auth ticket, don't continue if missing if (!info.profile->isBenchmark() && auth == std::nullopt) { co_return; diff --git a/launcher/ui/Settings/DeveloperSettings.qml b/launcher/ui/Settings/DeveloperSettings.qml index 79fd74b..a1359f2 100644 --- a/launcher/ui/Settings/DeveloperSettings.qml +++ b/launcher/ui/Settings/DeveloperSettings.qml @@ -40,6 +40,20 @@ FormCard.FormCardPage { FormCard.FormCard { Layout.fillWidth: true + FormCard.FormButtonDelegate { + id: launchGameDelegate + + text: i18n("Launch Game Now") + description: i18n("This is meant for testing if we can get to the title screen and will fail at doing anything else.") + + onClicked: LauncherCore.immediatelyLaunch(LauncherCore.currentProfile) + } + + FormCard.FormDelegateSeparator { + above: launchGameDelegate + below: encryptArgDelegate + } + FormCard.FormCheckDelegate { id: encryptArgDelegate