sneedmc/launcher/modplatform/modrinth/ModrinthPackIndex.h

49 lines
1000 B
C
Raw Normal View History

2022-01-14 08:43:42 +00:00
#pragma once
#include <QList>
#include <QMetaType>
#include <QString>
#include <QVector>
#include <QNetworkAccessManager>
#include <QObjectPtr.h>
#include "net/NetJob.h"
#include "BaseInstance.h"
2022-01-14 08:43:42 +00:00
namespace Modrinth {
struct ModpackAuthor {
QString name;
QString url;
};
struct IndexedVersion {
QString addonId;
QString fileId;
QString version;
2022-01-15 07:51:47 +00:00
QVector<QString> mcVersion;
2022-01-14 08:43:42 +00:00
QString downloadUrl;
QString date;
2022-01-14 11:47:18 +00:00
QString fileName;
2022-01-15 07:51:47 +00:00
QVector<QString> loaders;
2022-01-14 08:43:42 +00:00
};
struct IndexedPack
{
QString addonId;
QString name;
QString description;
ModpackAuthor author;
2022-01-14 08:43:42 +00:00
QString logoName;
QString logoUrl;
QString websiteUrl;
bool versionsLoaded = false;
QVector<IndexedVersion> versions;
};
void loadIndexedPack(IndexedPack & m, QJsonObject & obj);
void loadIndexedPackVersions(IndexedPack &pack, QJsonArray &arr, const shared_qobject_ptr<QNetworkAccessManager> &network, BaseInstance *inst);
2022-01-14 08:43:42 +00:00
}
Q_DECLARE_METATYPE(Modrinth::IndexedPack)