diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 8afc659..06ad833 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -19,7 +19,7 @@ FetchContent_Declare( FetchContent_MakeAvailable(libphysis) -corrosion_import_crate(MANIFEST_PATH ${libphysis_SOURCE_DIR}/Cargo.toml) +corrosion_import_crate(MANIFEST_PATH /home/josh/Development/libphysis/Cargo.toml) -target_include_directories(physis INTERFACE ${libphysis_SOURCE_DIR}/target/public) +target_include_directories(physis INTERFACE /home/josh/Development/libphysis/target/public) target_link_libraries(physis INTERFACE unshield) \ No newline at end of file diff --git a/launcher/core/include/launchercore.h b/launcher/core/include/launchercore.h index 1559ea8..379c1de 100755 --- a/launcher/core/include/launchercore.h +++ b/launcher/core/include/launchercore.h @@ -226,6 +226,8 @@ public: QVector expansionNames; + bool isSteam = false; + signals: void settingsChanged(); void successfulLaunch(); diff --git a/launcher/core/include/steamapi.h b/launcher/core/include/steamapi.h index 4fa1b29..e524bfb 100644 --- a/launcher/core/include/steamapi.h +++ b/launcher/core/include/steamapi.h @@ -1,6 +1,8 @@ #pragma once +class LauncherCore; + class SteamAPI { public: - SteamAPI(); + SteamAPI(LauncherCore& core); }; \ No newline at end of file diff --git a/launcher/core/src/launchercore.cpp b/launcher/core/src/launchercore.cpp index a88a06a..5688767 100755 --- a/launcher/core/src/launchercore.cpp +++ b/launcher/core/src/launchercore.cpp @@ -463,7 +463,7 @@ LauncherCore::LauncherCore() squareLauncher = new SquareLauncher(*this); squareBoot = new SquareBoot(*this, *squareLauncher); assetUpdater = new AssetUpdater(*this); - steamApi = new SteamAPI(); + steamApi = new SteamAPI(*this); #ifdef ENABLE_WATCHDOG watchdog = new Watchdog(*this); diff --git a/launcher/core/src/steamapi.cpp b/launcher/core/src/steamapi.cpp index 430e7e5..dced7ca 100644 --- a/launcher/core/src/steamapi.cpp +++ b/launcher/core/src/steamapi.cpp @@ -1,11 +1,14 @@ #include "steamapi.h" +#include "launchercore.h" #ifdef ENABLE_STEAM #include #endif -SteamAPI::SteamAPI() { +SteamAPI::SteamAPI(LauncherCore& core) { #ifdef ENABLE_STEAM - SteamAPI_Init(); + if(core.isSteam) { + SteamAPI_Init(); + } #endif } \ No newline at end of file diff --git a/launcher/main.cpp b/launcher/main.cpp index 0bba343..e85c2b5 100755 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -47,6 +47,11 @@ int main(int argc, char* argv[]) { parser.addOption(cliOption); #endif + QCommandLineOption steamOption("steam", "Simulate booting the launcher via Steam."); +#ifdef ENABLE_STEAM + parser.addOption(steamOption); +#endif + auto cmd = std::make_unique(parser); parser.process(app); @@ -59,21 +64,20 @@ int main(int argc, char* argv[]) { parser.showHelp(); } - for(auto& argument : QCoreApplication::arguments()) { - if(argument.contains("iscriptevaluator")) { - QFile testFile("/home/josh/testargs.txt"); - testFile.open(QFile::Text | QFile::Append); - - testFile.write(QCoreApplication::arguments().join(',').toStdString().c_str()); - - //return 0; - } - } - LauncherCore c; 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);