summaryrefslogtreecommitdiffstats
path: root/application/pages
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-03-30 01:05:58 +0200
committerPetr Mrázek <peterix@gmail.com>2017-04-07 00:20:02 +0200
commit2ac0edbbdb27e12bae00c4779da135582bde89f5 (patch)
tree0870890a8f00bb958a679175691724da727df580 /application/pages
parent53188386b807f1f1ca5eebcd08303633ca4a13fb (diff)
downloadMultiMC-2ac0edbbdb27e12bae00c4779da135582bde89f5.tar
MultiMC-2ac0edbbdb27e12bae00c4779da135582bde89f5.tar.gz
MultiMC-2ac0edbbdb27e12bae00c4779da135582bde89f5.tar.lz
MultiMC-2ac0edbbdb27e12bae00c4779da135582bde89f5.tar.xz
MultiMC-2ac0edbbdb27e12bae00c4779da135582bde89f5.zip
NOISSUE preview of LWJGL version changing
It still needs work - some LWJGL versions are exclusive to macOS. This has to be encoded in the json.
Diffstat (limited to 'application/pages')
-rw-r--r--application/pages/VersionPage.cpp47
1 files changed, 31 insertions, 16 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp
index 5a0b2243..94068786 100644
--- a/application/pages/VersionPage.cpp
+++ b/application/pages/VersionPage.cpp
@@ -323,9 +323,20 @@ void VersionPage::on_moveDownBtn_clicked()
void VersionPage::on_changeVersionBtn_clicked()
{
- // FIXME: this is hilariously broken because it assumes m_inst->versionList() is a sensible thing...
- VersionSelectDialog vselect(m_inst->versionList().get(), tr("Change Minecraft version"),
- this);
+ auto versionRow = currentRow();
+ if(versionRow == -1)
+ {
+ return;
+ }
+ auto patch = m_profile->versionPatch(versionRow);
+ auto name = patch->getName();
+ auto list = patch->getVersionList();
+ if(!list)
+ {
+ return;
+ }
+ auto uid = list->uid();
+ VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this);
if (!vselect.exec() || !vselect.selectedVersion())
return;
@@ -339,21 +350,25 @@ void VersionPage::on_changeVersionBtn_clicked()
return;
}
- if (!m_profile->isVanilla())
+ qDebug() << "Change" << uid << "to" << vselect.selectedVersion()->descriptor();
+ if(uid == "net.minecraft")
{
- auto result = CustomMessageBox::selectable(
- this, tr("Are you sure?"),
- tr("This will remove any library/version customization you did previously. "
- "This includes things like Forge install and similar."),
- QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Abort,
- QMessageBox::Abort)->exec();
-
- if (result != QMessageBox::Ok)
- return;
- m_profile->revertToVanilla();
- reloadMinecraftProfile();
+ if (!m_profile->isVanilla())
+ {
+ auto result = CustomMessageBox::selectable(
+ this, tr("Are you sure?"),
+ tr("This will remove any library/version customization you did previously. "
+ "This includes things like Forge install and similar."),
+ QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Abort,
+ QMessageBox::Abort)->exec();
+
+ if (result != QMessageBox::Ok)
+ return;
+ m_profile->revertToVanilla();
+ reloadMinecraftProfile();
+ }
}
- m_inst->setIntendedVersionId(vselect.selectedVersion()->descriptor());
+ m_inst->setComponentVersion(uid, vselect.selectedVersion()->descriptor());
doUpdate();
m_container->refreshContainer();
}