feat: display the 'body' of a MR mod on the mod downloader
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
4a13dbe3bb
commit
6e9a27f40f
@ -73,6 +73,8 @@ struct ExtraPackData {
|
||||
QString sourceUrl;
|
||||
QString wikiUrl;
|
||||
QString discordUrl;
|
||||
|
||||
QString body;
|
||||
};
|
||||
|
||||
struct IndexedPack {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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())));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user