diff --git a/launcher/modplatform/ModIndex.cpp b/launcher/modplatform/ModIndex.cpp index e18ccaefa..edb5e5aa1 100644 --- a/launcher/modplatform/ModIndex.cpp +++ b/launcher/modplatform/ModIndex.cpp @@ -31,7 +31,7 @@ static const QMap s_indexed_version_ty { "alpha", IndexedVersionType::VersionType::Alpha } }; -static const QList loaderList = { NeoForge, Forge, Cauldron, LiteLoader, Quilt, Fabric }; +static const QList loaderList = { NeoForge, Forge, Cauldron, LiteLoader, Quilt, Fabric, Babric, BTA }; QList modLoaderTypesToList(ModLoaderTypes flags) { @@ -129,6 +129,10 @@ auto getModLoaderAsString(ModLoaderType type) -> const QString return "quilt"; case DataPack: return "datapack"; + case Babric: + return "babric"; + case BTA: + return "bta-babric"; default: break; } @@ -149,6 +153,10 @@ auto getModLoaderFromString(QString type) -> ModLoaderType return Fabric; if (type == "quilt") return Quilt; + if (type == "babric") + return Babric; + if (type == "bta-babric") + return BTA; return {}; } diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h index cfe4eba75..7c4d1c885 100644 --- a/launcher/modplatform/ModIndex.h +++ b/launcher/modplatform/ModIndex.h @@ -36,7 +36,9 @@ enum ModLoaderType { LiteLoader = 1 << 3, Fabric = 1 << 4, Quilt = 1 << 5, - DataPack = 1 << 6 + DataPack = 1 << 6, + Babric = 1 << 7, + BTA = 1 << 8 }; Q_DECLARE_FLAGS(ModLoaderTypes, ModLoaderType) QList modLoaderTypesToList(ModLoaderTypes flags); diff --git a/launcher/modplatform/flame/FlameAPI.h b/launcher/modplatform/flame/FlameAPI.h index 316d2e9c9..c578f7ae6 100644 --- a/launcher/modplatform/flame/FlameAPI.h +++ b/launcher/modplatform/flame/FlameAPI.h @@ -71,6 +71,8 @@ class FlameAPI : public NetworkResourceAPI { case ModPlatform::NeoForge: return 6; case ModPlatform::DataPack: + case ModPlatform::Babric: + case ModPlatform::BTA: break; // not supported } return 0; diff --git a/launcher/modplatform/import_ftb/PackInstallTask.cpp b/launcher/modplatform/import_ftb/PackInstallTask.cpp index 7cb8b6ebc..9ddca008d 100644 --- a/launcher/modplatform/import_ftb/PackInstallTask.cpp +++ b/launcher/modplatform/import_ftb/PackInstallTask.cpp @@ -91,6 +91,10 @@ void PackInstallTask::copySettings() break; case ModPlatform::DataPack: break; + case ModPlatform::Babric: + break; + case ModPlatform::BTA: + break; } components->saveNow(); diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h index 7c2592256..3c2da0651 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.h +++ b/launcher/modplatform/modrinth/ModrinthAPI.h @@ -43,7 +43,7 @@ class ModrinthAPI : public NetworkResourceAPI { { QStringList l; for (auto loader : { ModPlatform::NeoForge, ModPlatform::Forge, ModPlatform::Fabric, ModPlatform::Quilt, ModPlatform::LiteLoader, - ModPlatform::DataPack }) { + ModPlatform::DataPack, ModPlatform::Babric, ModPlatform::BTA }) { if (types & loader) { l << getModLoaderAsString(loader); } @@ -202,7 +202,7 @@ class ModrinthAPI : public NetworkResourceAPI { static inline auto validateModLoaders(ModPlatform::ModLoaderTypes loaders) -> bool { return loaders & (ModPlatform::NeoForge | ModPlatform::Forge | ModPlatform::Fabric | ModPlatform::Quilt | ModPlatform::LiteLoader | - ModPlatform::DataPack); + ModPlatform::DataPack | ModPlatform::Babric | ModPlatform::BTA); } [[nodiscard]] std::optional getDependencyURL(DependencySearchArgs const& args) const override diff --git a/launcher/ui/widgets/ModFilterWidget.cpp b/launcher/ui/widgets/ModFilterWidget.cpp index 3c6a2db07..654eb75b1 100644 --- a/launcher/ui/widgets/ModFilterWidget.cpp +++ b/launcher/ui/widgets/ModFilterWidget.cpp @@ -149,10 +149,16 @@ ModFilterWidget::ModFilterWidget(MinecraftInstance* instance, bool extended) connect(ui->forge, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); connect(ui->fabric, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); connect(ui->quilt, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); - if (extended) - connect(ui->liteLoader, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); - else - ui->liteLoader->setVisible(false); + connect(ui->liteLoader, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); + connect(ui->babric, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); + connect(ui->btaBabric, &QCheckBox::stateChanged, this, &ModFilterWidget::onLoadersFilterChanged); + + connect(ui->showMoreButton, &QPushButton::clicked, this, &ModFilterWidget::onShowMoreClicked); + + if (!extended) { + ui->showMoreButton->setVisible(false); + ui->extendedModLoadersWidget->setVisible(false); + } if (extended) { connect(ui->clientSide, &QCheckBox::stateChanged, this, &ModFilterWidget::onSideFilterChanged); @@ -279,6 +285,10 @@ void ModFilterWidget::onLoadersFilterChanged() loaders |= ModPlatform::Quilt; if (ui->liteLoader->isChecked()) loaders |= ModPlatform::LiteLoader; + if (ui->babric->isChecked()) + loaders |= ModPlatform::Babric; + if (ui->btaBabric->isChecked()) + loaders |= ModPlatform::BTA; m_filter_changed = loaders != m_filter->loaders; m_filter->loaders = loaders; if (m_filter_changed) @@ -381,4 +391,10 @@ void ModFilterWidget::onReleaseFilterChanged() emit filterChanged(); } +void ModFilterWidget::onShowMoreClicked() +{ + ui->extendedModLoadersWidget->setVisible(true); + ui->showMoreButton->setVisible(false); +} + #include "ModFilterWidget.moc" diff --git a/launcher/ui/widgets/ModFilterWidget.h b/launcher/ui/widgets/ModFilterWidget.h index be60ba70a..8a858fd30 100644 --- a/launcher/ui/widgets/ModFilterWidget.h +++ b/launcher/ui/widgets/ModFilterWidget.h @@ -110,6 +110,7 @@ class ModFilterWidget : public QTabWidget { void onShowAllVersionsChanged(); void onOpenSourceFilterChanged(); void onReleaseFilterChanged(); + void onShowMoreClicked(); private: Ui::ModFilterWidget* ui; diff --git a/launcher/ui/widgets/ModFilterWidget.ui b/launcher/ui/widgets/ModFilterWidget.ui index 788202714..87d9af2e3 100644 --- a/launcher/ui/widgets/ModFilterWidget.ui +++ b/launcher/ui/widgets/ModFilterWidget.ui @@ -122,12 +122,54 @@ - + - LiteLoader + Show More + + + + false + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + LiteLoader + + + + + + + Babric + + + + + + + BTA (Babric) + + + + + +