aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform')
-rw-r--r--launcher/modplatform/ModAPI.h20
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp1
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.h17
3 files changed, 25 insertions, 13 deletions
diff --git a/launcher/modplatform/ModAPI.h b/launcher/modplatform/ModAPI.h
index ae6ac80f..1a562172 100644
--- a/launcher/modplatform/ModAPI.h
+++ b/launcher/modplatform/ModAPI.h
@@ -15,7 +15,7 @@ class ModAPI {
virtual ~ModAPI() = default;
// https://docs.curseforge.com/?http#tocS_ModLoaderType
- enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4 };
+ enum ModLoaderType { Unspecified = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4, Quilt = 5 };
struct SearchArgs {
int offset;
@@ -35,4 +35,22 @@ class ModAPI {
};
virtual void getVersions(CallerType* caller, VersionSearchArgs&& args) const = 0;
+
+ static auto getModLoaderString(ModLoaderType type) -> const QString {
+ switch (type) {
+ case Unspecified:
+ break;
+ case Forge:
+ return "forge";
+ case Cauldron:
+ return "cauldron";
+ case LiteLoader:
+ return "liteloader";
+ case Fabric:
+ return "fabric";
+ case Quilt:
+ return "quilt";
+ }
+ return "";
+ }
};
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp
index 2c3adee4..e86b64dd 100644
--- a/launcher/modplatform/flame/FlameModIndex.cpp
+++ b/launcher/modplatform/flame/FlameModIndex.cpp
@@ -69,6 +69,7 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
for (auto m : modules) {
auto fname = Json::requireString(m.toObject(), "foldername");
// FIXME: This does not work properly when a mod supports more than one mod loader, since
+ // FIXME: This also doesn't deal with Quilt mods at the moment
// they bundle the meta files for all of them in the same arquive, even when that version
// doesn't support the given mod loader.
if (hasFabric) {
diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h
index 30952e99..eefa4a85 100644
--- a/launcher/modplatform/modrinth/ModrinthAPI.h
+++ b/launcher/modplatform/modrinth/ModrinthAPI.h
@@ -51,23 +51,16 @@ class ModrinthAPI : public NetworkModAPI {
return s;
}
- inline auto getModLoaderString(ModLoaderType modLoader) const -> QString
+ static auto getModLoaderString(ModLoaderType type) -> const QString
{
- switch (modLoader) {
- case Any:
- return "fabric, forge";
- case Forge:
- return "forge";
- case Fabric:
- return "fabric";
- default:
- return "";
- }
+ if (type == Unspecified)
+ return "fabric, forge, quilt";
+ return ModAPI::getModLoaderString(type);
}
inline auto validateModLoader(ModLoaderType modLoader) const -> bool
{
- return modLoader == Any || modLoader == Forge || modLoader == Fabric;
+ return modLoader == Unspecified || modLoader == Forge || modLoader == Fabric || modLoader == Quilt;
}
};