feat: initial Quilt support

This commit is contained in:
Sefa Eyeoglu
2022-02-20 17:51:26 +01:00
parent cc5261051f
commit 9eb9ddc668
4 changed files with 49 additions and 0 deletions

View File

@ -243,6 +243,9 @@ void VersionPage::updateVersionControls()
bool supportsFabric = minecraftVersion >= Version("1.14");
ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric);
bool supportsQuilt = minecraftVersion >= Version("1.17.1");
ui->actionInstall_Quilt->setEnabled(controlsEnabled && supportsQuilt);
bool supportsLiteLoader = minecraftVersion <= Version("1.12.2");
ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && supportsLiteLoader);
@ -498,6 +501,33 @@ void VersionPage::on_actionInstall_Fabric_triggered()
}
}
void VersionPage::on_actionInstall_Quilt_triggered()
{
auto vlist = APPLICATION->metadataIndex()->get("org.quiltmc.quilt-loader");
if(!vlist)
{
return;
}
VersionSelectDialog vselect(vlist.get(), tr("Select Quilt Loader version"), this);
vselect.setEmptyString(tr("No Quilt Loader versions are currently available."));
vselect.setEmptyErrorString(tr("Couldn't load or download the Quilt Loader version lists!"));
auto currentVersion = m_profile->getComponentVersion("org.quiltmc.quilt-loader");
if(!currentVersion.isEmpty())
{
vselect.setCurrentVersion(currentVersion);
}
if (vselect.exec() && vselect.selectedVersion())
{
auto vsn = vselect.selectedVersion();
m_profile->setComponentVersion("org.quiltmc.quilt-loader", vsn->descriptor());
m_profile->resolve(Net::Mode::Online);
preselect(m_profile->rowCount(QModelIndex())-1);
m_container->refreshContainer();
}
}
void VersionPage::on_actionAdd_Empty_triggered()
{
NewComponentDialog compdialog(QString(), QString(), this);