aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth/ModrinthPackIndex.h
diff options
context:
space:
mode:
authortimoreo <timo.oreo34@gmail.com>2022-01-14 09:43:42 +0100
committertimoreo <timo.oreo34@gmail.com>2022-01-14 09:56:27 +0100
commit4e9039be2d3bc0357e6bfe577c5f2add8313f8d6 (patch)
tree58ae809b2914e4eda300421ec4c7afbd3bc64067 /launcher/modplatform/modrinth/ModrinthPackIndex.h
parentb07853c9ef6063fe0d6d9065acdd598841c62a14 (diff)
downloadPrismLauncher-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.h46
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)