feat: display the 'body' of a MR mod on the mod downloader

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-06-16 20:46:47 -03:00
parent 4a13dbe3bb
commit 6e9a27f40f
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
3 changed files with 8 additions and 1 deletions

View File

@ -73,6 +73,8 @@ struct ExtraPackData {
QString sourceUrl;
QString wikiUrl;
QString discordUrl;
QString body;
};
struct IndexedPack {

View File

@ -87,6 +87,8 @@ void Modrinth::loadExtraPackData(ModPlatform::IndexedPack& pack, QJsonObject& ob
pack.extraData.donate.append(donate);
}
pack.extraData.body = Json::ensureString(obj, "body");
pack.extraDataLoaded = true;
}

View File

@ -40,6 +40,8 @@
#include <QKeyEvent>
#include <memory>
#include <HoeDown.h>
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
#include "ui/dialogs/ModDownloadDialog.h"
@ -288,5 +290,6 @@ void ModPage::updateUi()
text += "<hr>";
ui->packDescription->setHtml(text + current.description);
HoeDown h;
ui->packDescription->setHtml(text + (current.extraData.body.isEmpty() ? current.description : h.process(current.extraData.body.toUtf8())));
}