aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-12-30 14:06:07 -0300
committerflow <flowlnlnln@gmail.com>2023-02-05 17:02:56 -0300
commitb724607e31d102c50cb42225b4a31f2932b2eb61 (patch)
treef0423b42963792de93716d20815f1cf792962629 /launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
parentc3ea303a3742c886aae9e05d2e5f5fbb497260a1 (diff)
downloadPrismLauncher-b724607e31d102c50cb42225b4a31f2932b2eb61.tar.gz
PrismLauncher-b724607e31d102c50cb42225b4a31f2932b2eb61.tar.bz2
PrismLauncher-b724607e31d102c50cb42225b4a31f2932b2eb61.zip
feat(RD): add shader pack downloader
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp')
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
index b36339d7..bd433121 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
@@ -69,4 +69,26 @@ auto ModrinthResourcePackModel::documentToArray(QJsonDocument& obj) const -> QJs
return obj.object().value("hits").toArray();
}
+ModrinthShaderPackModel::ModrinthShaderPackModel(const BaseInstance& base) : ShaderPackResourceModel(base, new ModrinthAPI){}
+
+void ModrinthShaderPackModel::loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj)
+{
+ ::Modrinth::loadIndexedPack(m, obj);
+}
+
+void ModrinthShaderPackModel::loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj)
+{
+ ::Modrinth::loadExtraPackData(m, obj);
+}
+
+void ModrinthShaderPackModel::loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr)
+{
+ ::Modrinth::loadIndexedPackVersions(m, arr, APPLICATION->network(), &m_base_instance);
+}
+
+auto ModrinthShaderPackModel::documentToArray(QJsonDocument& obj) const -> QJsonArray
+{
+ return obj.object().value("hits").toArray();
+}
+
} // namespace ResourceDownload