1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-24 05:17:46 +00:00

Set steam app id properly

This commit is contained in:
Joshua Goins 2022-09-06 10:54:34 -04:00
parent 32e77696b1
commit 8d7f6afa0a
4 changed files with 11 additions and 15 deletions

View file

@ -142,7 +142,7 @@ class LauncherCore : public QObject {
Q_OBJECT Q_OBJECT
Q_PROPERTY(SquareBoot* squareBoot MEMBER squareBoot) Q_PROPERTY(SquareBoot* squareBoot MEMBER squareBoot)
public: public:
LauncherCore(); LauncherCore(bool isSteam);
// used for qml only, TODO: move this to a dedicated factory // used for qml only, TODO: move this to a dedicated factory
Q_INVOKABLE LoginInformation* createNewLoginInfo() { Q_INVOKABLE LoginInformation* createNewLoginInfo() {

View file

@ -472,8 +472,8 @@ void LauncherCore::readGameVersion() {
} }
} }
LauncherCore::LauncherCore() LauncherCore::LauncherCore(bool isSteam)
: settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::applicationName()) { : settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::applicationName()), isSteam(isSteam) {
mgr = new QNetworkAccessManager(); mgr = new QNetworkAccessManager();
sapphireLauncher = new SapphireLauncher(*this); sapphireLauncher = new SapphireLauncher(*this);
squareLauncher = new SquareLauncher(*this); squareLauncher = new SquareLauncher(*this);

View file

@ -1,6 +1,8 @@
#include "steamapi.h" #include "steamapi.h"
#include "launchercore.h" #include "launchercore.h"
#include <QtGlobal>
#ifdef ENABLE_STEAM #ifdef ENABLE_STEAM
#include <steam/steam_api.h> #include <steam/steam_api.h>
#endif #endif
@ -8,7 +10,11 @@
SteamAPI::SteamAPI(LauncherCore& core) { SteamAPI::SteamAPI(LauncherCore& core) {
#ifdef ENABLE_STEAM #ifdef ENABLE_STEAM
if(core.isSteam) { if(core.isSteam) {
SteamAPI_Init(); qputenv("SteamAppId", "39210");
qputenv("SteamGameId", "39210");
if(!SteamAPI_Init())
qDebug() << "Failed to initialize steam api!";
} }
#endif #endif
} }

View file

@ -64,20 +64,10 @@ int main(int argc, char* argv[]) {
parser.showHelp(); parser.showHelp();
} }
LauncherCore c; LauncherCore c(parser.isSet(steamOption));
std::unique_ptr<DesktopInterface> desktopInterface; std::unique_ptr<DesktopInterface> desktopInterface;
std::unique_ptr<TabletInterface> tabletInterface; std::unique_ptr<TabletInterface> tabletInterface;
if(parser.isSet(steamOption)) {
c.isSteam = true;
for(auto& argument : QCoreApplication::arguments()) {
if(argument.contains("iscriptevaluator")) {
//return 0;
}
}
}
if (parser.isSet(tabletOption)) { if (parser.isSet(tabletOption)) {
#ifdef ENABLE_TABLET #ifdef ENABLE_TABLET
tabletInterface = std::make_unique<TabletInterface>(c); tabletInterface = std::make_unique<TabletInterface>(c);