diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-02-19 22:34:17 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-02-19 22:34:17 +0100 |
commit | 71467246079bd7545472bda161dcaf5549205d33 (patch) | |
tree | 5e3ce395f3be7df1503470d215dcf4a532a3d0e8 /gui/dialogs | |
parent | 5cf599673db88b39100ffca78e10bbe5e10200d7 (diff) | |
download | MultiMC-71467246079bd7545472bda161dcaf5549205d33.tar MultiMC-71467246079bd7545472bda161dcaf5549205d33.tar.gz MultiMC-71467246079bd7545472bda161dcaf5549205d33.tar.lz MultiMC-71467246079bd7545472bda161dcaf5549205d33.tar.xz MultiMC-71467246079bd7545472bda161dcaf5549205d33.zip |
New, better, liteloader support
Diffstat (limited to 'gui/dialogs')
-rw-r--r-- | gui/dialogs/OneSixModEditDialog.cpp | 40 | ||||
-rw-r--r-- | gui/dialogs/VersionSelectDialog.cpp | 1 |
2 files changed, 23 insertions, 18 deletions
diff --git a/gui/dialogs/OneSixModEditDialog.cpp b/gui/dialogs/OneSixModEditDialog.cpp index 9e585de5..fe621a9a 100644 --- a/gui/dialogs/OneSixModEditDialog.cpp +++ b/gui/dialogs/OneSixModEditDialog.cpp @@ -37,6 +37,7 @@ #include "logic/OneSixVersion.h" #include "logic/EnabledItemFilter.h" #include "logic/lists/ForgeVersionList.h" +#include "logic/lists/LiteLoaderVersionList.h" #include "logic/ForgeInstaller.h" #include "logic/LiteLoaderInstaller.h" #include "logic/OneSixVersionBuilder.h" @@ -108,7 +109,7 @@ OneSixModEditDialog::~OneSixModEditDialog() void OneSixModEditDialog::updateVersionControls() { ui->forgeBtn->setEnabled(true); - ui->liteloaderBtn->setEnabled(LiteLoaderInstaller().canApply(m_inst)); + ui->liteloaderBtn->setEnabled(true); ui->mainClassEdit->setText(m_version->mainClass); } @@ -290,24 +291,27 @@ void OneSixModEditDialog::on_liteloaderBtn_clicked() QDir(m_inst->instanceRoot()).remove("custom.json"); m_inst->reloadVersion(this); } - LiteLoaderInstaller liteloader; - if (!liteloader.canApply(m_inst)) - { - QMessageBox::critical( - this, tr("LiteLoader"), - tr("There is no information available on how to install LiteLoader " - "into this version of Minecraft")); - return; - } - if (!liteloader.add(m_inst)) - { - QMessageBox::critical(this, tr("LiteLoader"), - tr("For reasons unknown, the LiteLoader installation failed. " - "Check your MultiMC log files for details.")); - } - else + VersionSelectDialog vselect(MMC->liteloaderlist().get(), tr("Select LiteLoader version"), this); + vselect.setFilter(1, m_inst->currentVersionId()); + vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + + m_inst->currentVersionId()); + if (vselect.exec() && vselect.selectedVersion()) { - m_inst->reloadVersion(this); + LiteLoaderVersionPtr liteloaderVersion = + std::dynamic_pointer_cast<LiteLoaderVersion>(vselect.selectedVersion()); + if (!liteloaderVersion) + return; + LiteLoaderInstaller liteloader(liteloaderVersion); + if (!liteloader.add(m_inst)) + { + QMessageBox::critical(this, tr("LiteLoader"), + tr("For reasons unknown, the LiteLoader installation failed. " + "Check your MultiMC log files for details.")); + } + else + { + m_inst->reloadVersion(this); + } } } diff --git a/gui/dialogs/VersionSelectDialog.cpp b/gui/dialogs/VersionSelectDialog.cpp index 0f379f56..3277fd2f 100644 --- a/gui/dialogs/VersionSelectDialog.cpp +++ b/gui/dialogs/VersionSelectDialog.cpp @@ -82,6 +82,7 @@ void VersionSelectDialog::loadList() Task *loadTask = m_vlist->getLoadTask(); loadTask->setParent(taskDlg); taskDlg->exec(loadTask); + delete taskDlg; } BaseVersionPtr VersionSelectDialog::selectedVersion() const |