2023-01-23 14:03:55 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 flowln <flowlnlnln@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
2022-01-16 10:20:21 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-12-16 22:03:52 +00:00
|
|
|
#include "ui/pages/modplatform/ModModel.h"
|
2022-12-16 23:26:10 +00:00
|
|
|
#include "ui/pages/modplatform/ResourcePackModel.h"
|
2022-12-16 22:03:52 +00:00
|
|
|
#include "ui/pages/modplatform/flame/FlameResourcePages.h"
|
|
|
|
|
|
|
|
namespace ResourceDownload {
|
|
|
|
|
|
|
|
class FlameModModel : public ModModel {
|
2022-01-16 10:20:21 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2022-03-03 00:17:10 +00:00
|
|
|
public:
|
2023-06-10 20:04:08 +01:00
|
|
|
FlameModModel(BaseInstance&);
|
2022-12-16 22:03:52 +00:00
|
|
|
~FlameModModel() override = default;
|
2022-03-03 02:01:23 +00:00
|
|
|
|
|
|
|
private:
|
2022-12-18 18:41:46 +00:00
|
|
|
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
|
|
|
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
|
|
|
|
2022-03-07 22:29:59 +00:00
|
|
|
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
2022-07-19 16:29:31 +01:00
|
|
|
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
2022-03-07 22:29:59 +00:00
|
|
|
void loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr) override;
|
2023-04-17 18:41:00 +01:00
|
|
|
auto loadDependencyVersions(const ModPlatform::Dependency& m, QJsonArray& arr) -> ModPlatform::IndexedVersion override;
|
2022-03-07 20:46:18 +00:00
|
|
|
|
2022-03-08 14:12:35 +00:00
|
|
|
auto documentToArray(QJsonDocument& obj) const -> QJsonArray override;
|
2022-01-16 10:20:21 +00:00
|
|
|
};
|
|
|
|
|
2022-12-16 23:26:10 +00:00
|
|
|
class FlameResourcePackModel : public ResourcePackResourceModel {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
FlameResourcePackModel(const BaseInstance&);
|
|
|
|
~FlameResourcePackModel() override = default;
|
|
|
|
|
|
|
|
private:
|
|
|
|
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
|
|
|
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
|
|
|
|
|
|
|
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
|
|
|
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
|
|
|
void loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr) override;
|
|
|
|
|
|
|
|
auto documentToArray(QJsonDocument& obj) const -> QJsonArray override;
|
|
|
|
};
|
|
|
|
|
2023-01-29 21:07:49 +00:00
|
|
|
class FlameTexturePackModel : public TexturePackResourceModel {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
FlameTexturePackModel(const BaseInstance&);
|
|
|
|
~FlameTexturePackModel() override = default;
|
|
|
|
|
|
|
|
private:
|
|
|
|
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
|
|
|
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
|
|
|
|
|
|
|
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
|
|
|
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
|
|
|
void loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr) override;
|
|
|
|
|
|
|
|
ResourceAPI::SearchArgs createSearchArguments() override;
|
|
|
|
ResourceAPI::VersionSearchArgs createVersionsArguments(QModelIndex&) override;
|
|
|
|
|
|
|
|
auto documentToArray(QJsonDocument& obj) const -> QJsonArray override;
|
|
|
|
};
|
|
|
|
|
2022-12-16 22:03:52 +00:00
|
|
|
} // namespace ResourceDownload
|