Add Quilt install option while creating an instance

This commit is contained in:
Kenneth Chew 2022-04-15 15:04:49 -04:00
parent 7577115c3c
commit 3e64935844
No known key found for this signature in database
GPG Key ID: F17D3E14A07739DA
2 changed files with 22 additions and 2 deletions

View File

@ -65,6 +65,7 @@ VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent)
connect(ui->noneFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged); connect(ui->noneFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->forgeFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged); connect(ui->forgeFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->fabricFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged); connect(ui->fabricFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->quiltFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->liteLoaderFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged); connect(ui->liteLoaderFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->loaderRefreshBtn, &QPushButton::clicked, this, &VanillaPage::loaderRefresh); connect(ui->loaderRefreshBtn, &QPushButton::clicked, this, &VanillaPage::loaderRefresh);
@ -133,12 +134,21 @@ void VanillaPage::loaderFilterChanged()
else if(ui->fabricFilter->isChecked()) else if(ui->fabricFilter->isChecked())
{ {
// FIXME: dirty hack because the launcher is unaware of Fabric's dependencies // FIXME: dirty hack because the launcher is unaware of Fabric's dependencies
if (Version(minecraftVersion) >= Version("1.14")) // Fabric supported if (Version(minecraftVersion) >= Version("1.14")) // Fabric/Quilt supported
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, ""); ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "");
else // Fabric unsupported else // Fabric/Quilt unsupported
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "AAA"); // clear list ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "AAA"); // clear list
m_selectedLoader = "net.fabricmc.fabric-loader"; m_selectedLoader = "net.fabricmc.fabric-loader";
} }
else if(ui->quiltFilter->isChecked())
{
// FIXME: dirty hack because the launcher is unaware of Quilt's dependencies (same as Fabric)
if (Version(minecraftVersion) >= Version("1.14")) // Fabric/Quilt supported
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "");
else // Fabric/Quilt unsupported
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "AAA"); // clear list
m_selectedLoader = "org.quiltmc.quilt-loader";
}
else if(ui->liteLoaderFilter->isChecked()) else if(ui->liteLoaderFilter->isChecked())
{ {
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion); ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);

View File

@ -214,6 +214,16 @@
</attribute> </attribute>
</widget> </widget>
</item> </item>
<item>
<widget class="QRadioButton" name="quiltFilter">
<property name="text">
<string>Quilt</string>
</property>
<attribute name="buttonGroup">
<string notr="true">loaderBtnGroup</string>
</attribute>
</widget>
</item>
<item> <item>
<widget class="QRadioButton" name="liteLoaderFilter"> <widget class="QRadioButton" name="liteLoaderFilter">
<property name="text"> <property name="text">