diff --git a/launcher/core/include/launchercore.h b/launcher/core/include/launchercore.h index dc30333..1495acc 100755 --- a/launcher/core/include/launchercore.h +++ b/launcher/core/include/launchercore.h @@ -142,7 +142,7 @@ class LauncherCore : public QObject { Q_OBJECT Q_PROPERTY(SquareBoot* squareBoot MEMBER squareBoot) public: - LauncherCore(); + LauncherCore(bool isSteam); // used for qml only, TODO: move this to a dedicated factory Q_INVOKABLE LoginInformation* createNewLoginInfo() { diff --git a/launcher/core/src/launchercore.cpp b/launcher/core/src/launchercore.cpp index 858743a..cd309ca 100755 --- a/launcher/core/src/launchercore.cpp +++ b/launcher/core/src/launchercore.cpp @@ -472,8 +472,8 @@ void LauncherCore::readGameVersion() { } } -LauncherCore::LauncherCore() - : settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::applicationName()) { +LauncherCore::LauncherCore(bool isSteam) + : settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::applicationName()), isSteam(isSteam) { mgr = new QNetworkAccessManager(); sapphireLauncher = new SapphireLauncher(*this); squareLauncher = new SquareLauncher(*this); diff --git a/launcher/core/src/steamapi.cpp b/launcher/core/src/steamapi.cpp index dced7ca..0345811 100644 --- a/launcher/core/src/steamapi.cpp +++ b/launcher/core/src/steamapi.cpp @@ -1,6 +1,8 @@ #include "steamapi.h" #include "launchercore.h" +#include + #ifdef ENABLE_STEAM #include #endif @@ -8,7 +10,11 @@ SteamAPI::SteamAPI(LauncherCore& core) { #ifdef ENABLE_STEAM if(core.isSteam) { - SteamAPI_Init(); + qputenv("SteamAppId", "39210"); + qputenv("SteamGameId", "39210"); + + if(!SteamAPI_Init()) + qDebug() << "Failed to initialize steam api!"; } #endif } \ No newline at end of file diff --git a/launcher/main.cpp b/launcher/main.cpp index 6874495..afaff56 100755 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -64,20 +64,10 @@ int main(int argc, char* argv[]) { parser.showHelp(); } - LauncherCore c; + LauncherCore c(parser.isSet(steamOption)); std::unique_ptr desktopInterface; std::unique_ptr tabletInterface; - if(parser.isSet(steamOption)) { - c.isSteam = true; - - for(auto& argument : QCoreApplication::arguments()) { - if(argument.contains("iscriptevaluator")) { - //return 0; - } - } - } - if (parser.isSet(tabletOption)) { #ifdef ENABLE_TABLET tabletInterface = std::make_unique(c);