diff options
author | flow <flowlnlnln@gmail.com> | 2022-12-30 14:06:07 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2023-02-05 17:02:56 -0300 |
commit | b724607e31d102c50cb42225b4a31f2932b2eb61 (patch) | |
tree | f0423b42963792de93716d20815f1cf792962629 /launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp | |
parent | c3ea303a3742c886aae9e05d2e5f5fbb497260a1 (diff) | |
download | PrismLauncher-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.cpp | 22 |
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 |