1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-23 21:07:45 +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_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() {

View file

@ -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);

View file

@ -1,6 +1,8 @@
#include "steamapi.h"
#include "launchercore.h"
#include <QtGlobal>
#ifdef ENABLE_STEAM
#include <steam/steam_api.h>
#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
}

View file

@ -64,20 +64,10 @@ int main(int argc, char* argv[]) {
parser.showHelp();
}
LauncherCore c;
LauncherCore c(parser.isSet(steamOption));
std::unique_ptr<DesktopInterface> desktopInterface;
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)) {
#ifdef ENABLE_TABLET
tabletInterface = std::make_unique<TabletInterface>(c);