Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion launcher/minecraft/ComponentUpdateTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ void ComponentUpdateTask::resolveDependencies(bool checkOnly)
{
component->m_version = "3.1.2";
}
else if (add.uid == "net.fabricmc.intermediary" || add.uid == "org.quiltmc.hashed")
else if (add.uid == "net.fabricmc.intermediary" || add.uid == "org.quiltmc.hashed" || add.uid == "net.legacyfabric.intermediary")
{
auto minecraft = std::find_if(components.begin(), components.end(), [](ComponentPtr & cmp){
return cmp->getID() == "net.minecraft";
Expand Down
31 changes: 30 additions & 1 deletion launcher/ui/pages/instance/VersionPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ void VersionPage::updateVersionControls()
auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));

bool supportsFabric = minecraftVersion >= Version("1.14");
bool supportsLegacyFabric = minecraftVersion >= Version("1.3") && minecraftVersion <= Version("1.13.2");
ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric);
ui->actionInstall_Quilt->setEnabled((controlsEnabled) && supportsFabric);
ui->actionInstall_LegacyFabric->setEnabled((controlsEnabled) && supportsLegacyFabric);

bool supportsLiteLoader = minecraftVersion <= Version("1.12.2");
ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && supportsLiteLoader);
Expand Down Expand Up @@ -365,7 +367,7 @@ void VersionPage::on_actionChange_version_triggered()
return;
}
VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this);
if (uid == "net.fabricmc.intermediary" || uid == "org.quiltmc.hashed")
if (uid == "net.fabricmc.intermediary" || uid == "org.quiltmc.hashed" || uid == "net.legacyfabric.intermediary")
{
vselect.setEmptyString(tr("No intermediary mappings versions are currently available."));
vselect.setEmptyErrorString(tr("Couldn't load or download the intermediary mappings version lists!"));
Expand Down Expand Up @@ -471,6 +473,33 @@ void VersionPage::on_actionInstall_Fabric_triggered()
}
}

void VersionPage::on_actionInstall_LegacyFabric_triggered()
{
auto vlist = APPLICATION->metadataIndex()->get("net.legacyfabric.fabric-loader");
if(!vlist)
{
return;
}
VersionSelectDialog vselect(vlist.get(), tr("Select Fabric Loader version"), this);
vselect.setEmptyString(tr("No Fabric Loader versions are currently available."));
vselect.setEmptyErrorString(tr("Couldn't load or download the Fabric Loader version lists!"));

auto currentVersion = m_profile->getComponentVersion("net.legacyfabric.fabric-loader");
if(!currentVersion.isEmpty())
{
vselect.setCurrentVersion(currentVersion);
}

if (vselect.exec() && vselect.selectedVersion())
{
auto vsn = vselect.selectedVersion();
m_profile->setComponentVersion("net.legacyfabric.fabric-loader", vsn->descriptor());
m_profile->resolve(Net::Mode::Online);
preselect(m_profile->rowCount(QModelIndex())-1);
m_container->refreshContainer();
}
}

void VersionPage::on_actionInstall_Quilt_triggered()
{
auto vlist = APPLICATION->metadataIndex()->get("org.quiltmc.quilt-loader");
Expand Down
1 change: 1 addition & 0 deletions launcher/ui/pages/instance/VersionPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private slots:
void on_actionChange_version_triggered();
void on_actionInstall_Forge_triggered();
void on_actionInstall_Fabric_triggered();
void on_actionInstall_LegacyFabric_triggered();
void on_actionInstall_Quilt_triggered();
void on_actionAdd_Empty_triggered();
void on_actionInstall_LiteLoader_triggered();
Expand Down
9 changes: 9 additions & 0 deletions launcher/ui/pages/instance/VersionPage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<addaction name="separator"/>
<addaction name="actionInstall_Forge"/>
<addaction name="actionInstall_Fabric"/>
<addaction name="actionInstall_LegacyFabric"/>
<addaction name="actionInstall_Quilt"/>
<addaction name="actionInstall_LiteLoader"/>
<addaction name="actionInstall_mods"/>
Expand Down Expand Up @@ -193,6 +194,14 @@
<string>Install the Fabric Loader package.</string>
</property>
</action>
<action name="actionInstall_LegacyFabric">
<property name="text">
<string>Install Legacy Fabric</string>
</property>
<property name="toolTip">
<string>Install the Fabric Loader package for Legacy Fabric.</string>
</property>
</action>
<action name="actionInstall_Quilt">
<property name="text">
<string>Install Quilt</string>
Expand Down