summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gui/dialogs/OneSixModEditDialog.cpp15
-rw-r--r--logic/Mod.cpp9
2 files changed, 20 insertions, 4 deletions
diff --git a/gui/dialogs/OneSixModEditDialog.cpp b/gui/dialogs/OneSixModEditDialog.cpp
index fb422941..d8b84d3e 100644
--- a/gui/dialogs/OneSixModEditDialog.cpp
+++ b/gui/dialogs/OneSixModEditDialog.cpp
@@ -72,8 +72,6 @@ OneSixModEditDialog::OneSixModEditDialog(OneSixInstance *inst, QWidget *parent)
auto smodel = ui->loaderModTreeView->selectionModel();
connect(smodel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
SLOT(loaderCurrent(QModelIndex, QModelIndex)));
-
- ui->liteloaderBtn->setEnabled(LiteLoaderInstaller(m_inst->intendedVersionId()).canApply());
}
// resource packs
{
@@ -98,6 +96,7 @@ void OneSixModEditDialog::updateVersionControls()
ui->customizeBtn->setEnabled(!customVersion);
ui->revertBtn->setEnabled(customVersion);
ui->forgeBtn->setEnabled(true);
+ ui->liteloaderBtn->setEnabled(LiteLoaderInstaller(m_inst->intendedVersionId()).canApply());
}
void OneSixModEditDialog::disableVersionControls()
@@ -105,6 +104,7 @@ void OneSixModEditDialog::disableVersionControls()
ui->customizeBtn->setEnabled(false);
ui->revertBtn->setEnabled(false);
ui->forgeBtn->setEnabled(false);
+ ui->liteloaderBtn->setEnabled(false);
}
void OneSixModEditDialog::on_customizeBtn_clicked()
@@ -218,9 +218,18 @@ void OneSixModEditDialog::on_liteloaderBtn_clicked()
"into this version of Minecraft"));
return;
}
+ if (!m_inst->versionIsCustom())
+ {
+ m_inst->customizeVersion();
+ m_version = m_inst->getFullVersion();
+ main_model->setSourceModel(m_version.get());
+ updateVersionControls();
+ }
if (!liteloader.apply(m_version))
{
- // failure notice
+ QMessageBox::critical(
+ this, tr("LiteLoader"),
+ tr("For reasons unknown, the LiteLoader installation failed. Check your MultiMC log files for details."));
}
}
diff --git a/logic/Mod.cpp b/logic/Mod.cpp
index 009a32a4..6732446d 100644
--- a/logic/Mod.cpp
+++ b/logic/Mod.cpp
@@ -227,11 +227,18 @@ void Mod::ReadLiteModInfo(QByteArray contents)
QJsonParseError jsonError;
QJsonDocument jsonDoc = QJsonDocument::fromJson(contents, &jsonError);
auto object = jsonDoc.object();
- m_mod_id = object.value("name").toString();
+ if(object.contains("name"))
+ {
+ m_mod_id = m_name = object.value("name").toString();
+ }
if(object.contains("version"))
+ {
m_version=object.value("version").toString("");
+ }
else
+ {
m_version=object.value("revision").toString("");
+ }
m_mcversion = object.value("mcversion").toString();
m_authors = object.value("author").toString();
m_description = object.value("description").toString();