aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/instance/VersionPage.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-04-15 11:38:50 +0200
committerGitHub <noreply@github.com>2022-04-15 11:38:50 +0200
commit4ff1306e0c6c4c1a8c9b3c2ee72f8e7f0aa590dc (patch)
treec9f496b5a2573e240672e1be20a112d30247fd99 /launcher/ui/pages/instance/VersionPage.cpp
parent620555d2103dbfaa51e621b35290392899713a40 (diff)
parent9fb5674233c21775fac76cf96cd2a77c4098e908 (diff)
downloadPrismLauncher-4ff1306e0c6c4c1a8c9b3c2ee72f8e7f0aa590dc.tar.gz
PrismLauncher-4ff1306e0c6c4c1a8c9b3c2ee72f8e7f0aa590dc.tar.bz2
PrismLauncher-4ff1306e0c6c4c1a8c9b3c2ee72f8e7f0aa590dc.zip
Merge pull request #185 from Scrumplex/quilt
Quilt support
Diffstat (limited to 'launcher/ui/pages/instance/VersionPage.cpp')
-rw-r--r--launcher/ui/pages/instance/VersionPage.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp
index ed37dd1a..23e2367b 100644
--- a/launcher/ui/pages/instance/VersionPage.cpp
+++ b/launcher/ui/pages/instance/VersionPage.cpp
@@ -243,6 +243,9 @@ void VersionPage::updateVersionControls()
bool supportsFabric = minecraftVersion >= Version("1.14");
ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric);
+ bool supportsQuilt = minecraftVersion >= Version("1.14");
+ ui->actionInstall_Quilt->setEnabled(controlsEnabled && supportsQuilt);
+
bool supportsLiteLoader = minecraftVersion <= Version("1.12.2");
ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && supportsLiteLoader);
@@ -392,7 +395,7 @@ void VersionPage::on_actionChange_version_triggered()
return;
}
VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this);
- if (uid == "net.fabricmc.intermediary")
+ if (uid == "net.fabricmc.intermediary" || uid == "org.quiltmc.hashed")
{
vselect.setEmptyString(tr("No intermediary mappings versions are currently available."));
vselect.setEmptyErrorString(tr("Couldn't load or download the intermediary mappings version lists!"));
@@ -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);