diff options
Diffstat (limited to 'launcher/modplatform/ResourceAPI.h')
-rw-r--r-- | launcher/modplatform/ResourceAPI.h | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/launcher/modplatform/ResourceAPI.h b/launcher/modplatform/ResourceAPI.h index a92217a0..3b195938 100644 --- a/launcher/modplatform/ResourceAPI.h +++ b/launcher/modplatform/ResourceAPI.h @@ -54,9 +54,6 @@ class ResourceAPI { public: virtual ~ResourceAPI() = default; - enum ModLoaderType { Forge = 1 << 0, Cauldron = 1 << 1, LiteLoader = 1 << 2, Fabric = 1 << 3, Quilt = 1 << 4 }; - Q_DECLARE_FLAGS(ModLoaderTypes, ModLoaderType) - struct SortingMethod { // The index of the sorting method. Used to allow for arbitrary ordering in the list of methods. // Used by Flame in the API request. @@ -74,7 +71,7 @@ class ResourceAPI { std::optional<QString> search; std::optional<SortingMethod> sorting; - std::optional<ModLoaderTypes> loaders; + std::optional<ModPlatform::ModLoaderTypes> loaders; std::optional<std::list<Version> > versions; }; struct SearchCallbacks { @@ -87,7 +84,7 @@ class ResourceAPI { ModPlatform::IndexedPack pack; std::optional<std::list<Version> > mcVersions; - std::optional<ModLoaderTypes> loaders; + std::optional<ModPlatform::ModLoaderTypes> loaders; VersionSearchArgs(VersionSearchArgs const&) = default; void operator=(VersionSearchArgs other) @@ -108,13 +105,15 @@ class ResourceAPI { void operator=(ProjectInfoArgs other) { pack = other.pack; } }; struct ProjectInfoCallbacks { - std::function<void(QJsonDocument&, ModPlatform::IndexedPack)> on_succeed; + std::function<void(QJsonDocument&, const ModPlatform::IndexedPack&)> on_succeed; + std::function<void(QString const& reason)> on_fail; + std::function<void()> on_abort; }; struct DependencySearchArgs { ModPlatform::Dependency dependency; Version mcVersion; - ModLoaderTypes loader; + ModPlatform::ModLoaderTypes loader; }; struct DependencySearchCallbacks { @@ -161,25 +160,6 @@ class ResourceAPI { return nullptr; } - static auto getModLoaderString(ModLoaderType type) -> const QString - { - switch (type) { - case Forge: - return "forge"; - case Cauldron: - return "cauldron"; - case LiteLoader: - return "liteloader"; - case Fabric: - return "fabric"; - case Quilt: - return "quilt"; - default: - break; - } - return ""; - } - protected: [[nodiscard]] inline QString debugName() const { return "External resource API"; } |