diff --git a/launcher/core/include/steamapi.h b/launcher/core/include/steamapi.h index 90dd792..7526c29 100644 --- a/launcher/core/include/steamapi.h +++ b/launcher/core/include/steamapi.h @@ -9,4 +9,7 @@ public: void setLauncherMode(bool isLauncher); bool isDeck() const; + +private: + LauncherCore& core; }; \ No newline at end of file diff --git a/launcher/core/src/steamapi.cpp b/launcher/core/src/steamapi.cpp index 3213935..8b564f7 100644 --- a/launcher/core/src/steamapi.cpp +++ b/launcher/core/src/steamapi.cpp @@ -7,7 +7,7 @@ #include #endif -SteamAPI::SteamAPI(LauncherCore& core) { +SteamAPI::SteamAPI(LauncherCore& core) : core(core) { #ifdef ENABLE_STEAM if(core.isSteam) { qputenv("SteamAppId", "39210"); @@ -21,13 +21,19 @@ SteamAPI::SteamAPI(LauncherCore& core) { void SteamAPI::setLauncherMode(bool isLauncher) { #ifdef ENABLE_STEAM - SteamUtils()->SetGameLauncherMode(isLauncher); + if(core.isSteam) { + SteamUtils()->SetGameLauncherMode(isLauncher); + } #endif } bool SteamAPI::isDeck() const { #ifdef ENABLE_STEAM - return SteamUtils()->IsSteamRunningOnSteamDeck(); + if(core.isSteam) { + return SteamUtils()->IsSteamRunningOnSteamDeck(); + } else { + return false; + } #else return false; #endif