aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/ModIndex.h
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform/ModIndex.h')
-rw-r--r--launcher/modplatform/ModIndex.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h
index e56c282a..4ed8bcd8 100644
--- a/launcher/modplatform/ModIndex.h
+++ b/launcher/modplatform/ModIndex.h
@@ -31,6 +31,9 @@ class QIODevice;
namespace ModPlatform {
+enum ModLoaderType { NeoForge = 1 << 0, Forge = 1 << 1, Cauldron = 1 << 2, LiteLoader = 1 << 3, Fabric = 1 << 4, Quilt = 1 << 5 };
+Q_DECLARE_FLAGS(ModLoaderTypes, ModLoaderType)
+
enum class ResourceProvider { MODRINTH, FLAME };
enum class ResourceType { MOD, RESOURCE_PACK, SHADER_PACK };
@@ -101,7 +104,7 @@ struct IndexedVersion {
QString downloadUrl;
QString date;
QString fileName;
- QStringList loaders = {};
+ ModLoaderTypes loaders = {};
QString hash_type;
QString hash;
bool is_preferred = true;
@@ -144,7 +147,7 @@ struct IndexedPack {
ExtraPackData extraData;
// For internal use, not provided by APIs
- [[nodiscard]] bool isVersionSelected(size_t index) const
+ [[nodiscard]] bool isVersionSelected(int index) const
{
if (!versionsLoaded)
return false;
@@ -174,9 +177,18 @@ inline auto getOverrideDeps() -> QList<OverrideDep>
{ "qvIfYCYJ", "P7dR8mSH", "API", ModPlatform::ResourceProvider::MODRINTH },
{ "lwVhp9o5", "Ha28R6CL", "KotlinLibraries", ModPlatform::ResourceProvider::MODRINTH } };
-};
+}
+
QString getMetaURL(ResourceProvider provider, QVariant projectID);
+auto getModLoaderString(ModLoaderType type) -> const QString;
+
+constexpr bool hasSingleModLoaderSelected(ModLoaderTypes l) noexcept
+{
+ auto x = static_cast<int>(l);
+ return x && !(x & (x - 1));
+}
+
} // namespace ModPlatform
Q_DECLARE_METATYPE(ModPlatform::IndexedPack)