Added error message when exporting snapshots with curseforge
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
932531c8ba
commit
fd5b155ee7
@ -409,16 +409,20 @@ QByteArray FlamePackExportTask::generateIndex()
|
||||
// convert all available components to mrpack dependencies
|
||||
if (minecraft != nullptr)
|
||||
version["version"] = minecraft->m_version;
|
||||
|
||||
QJsonObject loader;
|
||||
QString id;
|
||||
if (quilt != nullptr)
|
||||
loader["id"] = "quilt-" + quilt->getVersion();
|
||||
id = "quilt-" + quilt->getVersion();
|
||||
else if (fabric != nullptr)
|
||||
loader["id"] = "fabric-" + fabric->getVersion();
|
||||
id = "fabric-" + fabric->getVersion();
|
||||
else if (forge != nullptr)
|
||||
loader["id"] = "forge-" + forge->getVersion();
|
||||
id = "forge-" + forge->getVersion();
|
||||
version["modLoaders"] = QJsonArray();
|
||||
if (!id.isEmpty()) {
|
||||
QJsonObject loader;
|
||||
loader["id"] = id;
|
||||
loader["primary"] = true;
|
||||
version["modLoaders"] = QJsonArray({ loader });
|
||||
}
|
||||
obj["minecraft"] = version;
|
||||
}
|
||||
|
||||
|
@ -1422,9 +1422,16 @@ void MainWindow::on_actionExportInstanceFlamePack_triggered()
|
||||
if (m_selectedInstance) {
|
||||
auto instance = dynamic_cast<MinecraftInstance*>(m_selectedInstance.get());
|
||||
if (instance) {
|
||||
QString errorMsg;
|
||||
if (instance->getPackProfile()->getComponent("org.quiltmc.quilt-loader")) {
|
||||
errorMsg = tr("Quilt is currently not supported by CurseForge modpacks.");
|
||||
} else if (auto cmp = instance->getPackProfile()->getComponent("net.minecraft");
|
||||
cmp && cmp->getVersionFile() && cmp->getVersionFile()->type == "snapshot") {
|
||||
errorMsg = tr("Snapshots are currently not supported by CurseForge modpacks.");
|
||||
}
|
||||
if (!errorMsg.isEmpty()) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Quilt is currently not supported by CurseForge modpacks."));
|
||||
msgBox.setText(errorMsg);
|
||||
msgBox.exec();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user