diff options
author | timoreo <timo.oreo34@gmail.com> | 2022-01-14 09:43:42 +0100 |
---|---|---|
committer | timoreo <timo.oreo34@gmail.com> | 2022-01-14 09:56:27 +0100 |
commit | 4e9039be2d3bc0357e6bfe577c5f2add8313f8d6 (patch) | |
tree | 58ae809b2914e4eda300421ec4c7afbd3bc64067 /launcher/modplatform/modrinth/ModrinthPackIndex.h | |
parent | b07853c9ef6063fe0d6d9065acdd598841c62a14 (diff) | |
download | PrismLauncher-4e9039be2d3bc0357e6bfe577c5f2add8313f8d6.tar.gz PrismLauncher-4e9039be2d3bc0357e6bfe577c5f2add8313f8d6.tar.bz2 PrismLauncher-4e9039be2d3bc0357e6bfe577c5f2add8313f8d6.zip |
Start of mod downloading
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthPackIndex.h')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.h b/launcher/modplatform/modrinth/ModrinthPackIndex.h new file mode 100644 index 00000000..afc31ff2 --- /dev/null +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.h @@ -0,0 +1,46 @@ +#pragma once + +#include <QList> +#include <QMetaType> +#include <QString> +#include <QVector> +#include <QNetworkAccessManager> +#include <QObjectPtr.h> +#include "net/NetJob.h" + +namespace Modrinth { + +struct ModpackAuthor { + QString name; + QString url; +}; + +struct IndexedVersion { + QString addonId; + QString fileId; + QString version; + QString mcVersion; + QString downloadUrl; + QString date; +}; + +struct IndexedPack +{ + QString addonId; + QString name; + QString description; + QList<ModpackAuthor> authors; + QString logoName; + QString logoUrl; + QString websiteUrl; + + bool versionsLoaded = false; + QVector<IndexedVersion> versions; +}; + +void loadIndexedPack(IndexedPack & m, QJsonObject & obj); +void loadIndexedPackVersions(IndexedPack & m, QJsonArray & arr, const shared_qobject_ptr<QNetworkAccessManager>& network); +void versionJobFinished(); +} + +Q_DECLARE_METATYPE(Modrinth::IndexedPack) |