1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00
astra/src/xivlauncher.h

72 lines
1.6 KiB
C
Raw Normal View History

2021-11-01 09:54:58 -04:00
#pragma once
#include <QMainWindow>
#include <QNetworkAccessManager>
#include <QFuture>
#include <QSettings>
class SapphireLauncher;
class SquareLauncher;
class SquareBoot;
struct ProfileSettings {
QString name;
int language = 1; // 1 is english, thats all i know
QString gamePath, winePath, winePrefixPath;
QString bootVersion, gameVersion;
bool useEsync, useGamescope, useGamemode;
bool useDX9 = false;
bool enableDXVKhud = false;
bool isSapphire = false;
QString lobbyURL;
bool rememberUsername, rememberPassword;
};
2021-11-01 09:54:58 -04:00
struct LoginInformation {
QString username, password, oneTimePassword;
};
struct LoginAuth {
QString SID;
int region = 2; // america?
int maxExpansion = 1;
// if empty, dont set on the client
QString lobbyhost, frontierHost;
};
class LauncherWindow : public QMainWindow {
Q_OBJECT
public:
explicit LauncherWindow(QWidget* parent = nullptr);
~LauncherWindow() override;
QNetworkAccessManager* mgr;
ProfileSettings currentProfile() const;
ProfileSettings& currentProfile();
void setProfile(QString name);
int getProfileIndex(QString name);
QList<QString> profileList() const;
2021-11-02 08:36:30 -04:00
void launchGame(const LoginAuth auth);
void launchExecutable(const QStringList args);
2021-11-01 09:54:58 -04:00
void buildRequest(QNetworkRequest& request);
void setSSL(QNetworkRequest& request);
QString readVersion(QString path);
void readInitialInformation();
2021-11-01 09:54:58 -04:00
QSettings settings;
2021-11-01 09:54:58 -04:00
private:
SapphireLauncher* sapphireLauncher;
SquareBoot* squareBoot;
SquareLauncher* squareLauncher;
QList<ProfileSettings> profileSettings;
int currentProfileIndex = 0;
2021-11-01 09:54:58 -04:00
};