diff --git a/launcher/core/include/steamapi.h b/launcher/core/include/steamapi.h index e524bfb..90dd792 100644 --- a/launcher/core/include/steamapi.h +++ b/launcher/core/include/steamapi.h @@ -4,5 +4,9 @@ class LauncherCore; class SteamAPI { public: - SteamAPI(LauncherCore& core); + explicit SteamAPI(LauncherCore& core); + + void setLauncherMode(bool isLauncher); + + bool isDeck() const; }; \ No newline at end of file diff --git a/launcher/core/src/launchercore.cpp b/launcher/core/src/launchercore.cpp index cd309ca..a9fbabe 100755 --- a/launcher/core/src/launchercore.cpp +++ b/launcher/core/src/launchercore.cpp @@ -58,6 +58,8 @@ void LauncherCore::buildRequest(const ProfileSettings& settings, QNetworkRequest } void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth& auth) { + steamApi->setLauncherMode(false); + #ifdef ENABLE_WATCHDOG if (profile.enableWatchdog) { watchdog->launchGame(profile, auth); @@ -486,6 +488,8 @@ LauncherCore::LauncherCore(bool isSteam) #endif readInitialInformation(); + + steamApi->setLauncherMode(true); } ProfileSettings& LauncherCore::getProfile(int index) { diff --git a/launcher/core/src/steamapi.cpp b/launcher/core/src/steamapi.cpp index 0345811..3213935 100644 --- a/launcher/core/src/steamapi.cpp +++ b/launcher/core/src/steamapi.cpp @@ -17,4 +17,18 @@ SteamAPI::SteamAPI(LauncherCore& core) { qDebug() << "Failed to initialize steam api!"; } #endif -} \ No newline at end of file +} + +void SteamAPI::setLauncherMode(bool isLauncher) { +#ifdef ENABLE_STEAM + SteamUtils()->SetGameLauncherMode(isLauncher); +#endif +} + +bool SteamAPI::isDeck() const { +#ifdef ENABLE_STEAM + return SteamUtils()->IsSteamRunningOnSteamDeck(); +#else + return false; +#endif +}