2021-11-23 14:37:37 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QTemporaryDir>
|
2022-03-13 20:44:57 -04:00
|
|
|
#include <QProgressDialog>
|
|
|
|
#include <QJsonArray>
|
2021-11-23 14:37:37 -05:00
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
class LauncherCore;
|
2021-11-23 14:37:37 -05:00
|
|
|
class QNetworkReply;
|
2021-11-23 15:34:23 -05:00
|
|
|
struct ProfileSettings;
|
2021-11-23 14:37:37 -05:00
|
|
|
|
|
|
|
class AssetUpdater : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-11-23 15:34:23 -05:00
|
|
|
AssetUpdater(LauncherCore& launcher);
|
2021-11-23 14:37:37 -05:00
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
void update(const ProfileSettings& profile);
|
2021-11-23 14:37:37 -05:00
|
|
|
void beginInstall();
|
|
|
|
|
2022-03-13 20:44:57 -04:00
|
|
|
void checkIfCheckingIsDone();
|
2022-02-25 18:08:57 -05:00
|
|
|
void checkIfDalamudAssetsDone();
|
|
|
|
void checkIfFinished();
|
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
signals:
|
|
|
|
void finishedUpdating();
|
|
|
|
|
|
|
|
private:
|
2021-11-23 15:34:23 -05:00
|
|
|
LauncherCore& launcher;
|
2021-11-23 14:37:37 -05:00
|
|
|
|
2022-03-13 20:44:57 -04:00
|
|
|
QProgressDialog* dialog;
|
|
|
|
|
2022-01-27 10:46:22 -05:00
|
|
|
const ProfileSettings* currentSettings = nullptr;
|
|
|
|
|
|
|
|
QString remoteDalamudVersion;
|
2022-02-25 20:06:29 -05:00
|
|
|
QString remoteRuntimeVersion;
|
2022-01-27 10:46:22 -05:00
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
QTemporaryDir tempDir;
|
2022-02-25 18:08:57 -05:00
|
|
|
|
|
|
|
bool doneDownloadingDalamud = true;
|
|
|
|
bool doneDownloadingNativelauncher = true;
|
2022-02-25 20:06:29 -05:00
|
|
|
bool doneDownloadingRuntimeCore = true;
|
|
|
|
bool doneDownloadingRuntimeDesktop = true;
|
|
|
|
bool needsRuntimeInstall = false;
|
|
|
|
bool needsDalamudInstall = false;
|
|
|
|
bool needsNativeInstall = false;
|
2022-02-25 18:08:57 -05:00
|
|
|
|
2022-03-13 20:44:57 -04:00
|
|
|
int remoteDalamudAssetVersion = -1;
|
2022-02-25 18:08:57 -05:00
|
|
|
QList<QString> dalamudAssetNeededFilenames;
|
2022-03-13 20:44:57 -04:00
|
|
|
QJsonArray remoteDalamudAssetArray;
|
|
|
|
|
|
|
|
QString dataDir;
|
2022-01-27 10:46:22 -05:00
|
|
|
};
|