aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2023-01-29 18:07:49 -0300
committerflow <flowlnlnln@gmail.com>2023-02-05 17:02:56 -0300
commitada5e88eb933a41691121316c78cd2e564965fa0 (patch)
tree05cbf24f0e42e2a673ac8fafcd04de434b9d1b0d /launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
parentb724607e31d102c50cb42225b4a31f2932b2eb61 (diff)
downloadPrismLauncher-ada5e88eb933a41691121316c78cd2e564965fa0.tar.gz
PrismLauncher-ada5e88eb933a41691121316c78cd2e564965fa0.tar.bz2
PrismLauncher-ada5e88eb933a41691121316c78cd2e564965fa0.zip
feat(RD): add texture pack downloader
This extends the resource pack downloader, with the custom behavior of filtering the versions that shows up, to those <= 1.6. As always, Flame is funky and requires a bit more workarounds than average. This will also get a nice improvement when the Version parsing and comparison PR gets merged! :D 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 bd433121..f5d1cc28 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp
@@ -69,6 +69,28 @@ auto ModrinthResourcePackModel::documentToArray(QJsonDocument& obj) const -> QJs
return obj.object().value("hits").toArray();
}
+ModrinthTexturePackModel::ModrinthTexturePackModel(const BaseInstance& base) : TexturePackResourceModel(base, new ModrinthAPI){}
+
+void ModrinthTexturePackModel::loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj)
+{
+ ::Modrinth::loadIndexedPack(m, obj);
+}
+
+void ModrinthTexturePackModel::loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj)
+{
+ ::Modrinth::loadExtraPackData(m, obj);
+}
+
+void ModrinthTexturePackModel::loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr)
+{
+ ::Modrinth::loadIndexedPackVersions(m, arr, APPLICATION->network(), &m_base_instance);
+}
+
+auto ModrinthTexturePackModel::documentToArray(QJsonDocument& obj) const -> QJsonArray
+{
+ return obj.object().value("hits").toArray();
+}
+
ModrinthShaderPackModel::ModrinthShaderPackModel(const BaseInstance& base) : ShaderPackResourceModel(base, new ModrinthAPI){}
void ModrinthShaderPackModel::loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj)