From 2980322c3b34b252ead838daee7a844853feccf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 12 Mar 2017 19:45:28 +0100 Subject: NOISSUE Remove Minecraft version list and versions. --- application/pages/VersionPage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 8decc649..b90b3e43 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -42,8 +42,6 @@ #include "minecraft/liteloader/LiteLoaderInstaller.h" #include "minecraft/auth/MojangAccountList.h" #include "minecraft/Mod.h" -#include "minecraft/MinecraftVersion.h" -#include "minecraft/MinecraftVersionList.h" #include "icons/IconList.h" #include "Exception.h" @@ -489,6 +487,8 @@ int VersionPage::currentRow() void VersionPage::on_customizeBtn_clicked() { + // TODO: implement + /* auto version = currentRow(); if(version == -1) { @@ -510,6 +510,7 @@ void VersionPage::on_customizeBtn_clicked() } updateButtons(); preselect(currentIdx); + */ } void VersionPage::on_editBtn_clicked() @@ -530,6 +531,8 @@ void VersionPage::on_editBtn_clicked() void VersionPage::on_revertBtn_clicked() { + // TODO: implement + /* auto version = currentRow(); if(version == -1) { @@ -551,6 +554,7 @@ void VersionPage::on_revertBtn_clicked() updateButtons(); preselect(currentIdx); m_container->refreshContainer(); + */ } #include "VersionPage.moc" -- cgit v1.2.3 From 40cf38bc3225c614e7e81d074f890e6f9da0507b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 12 Mar 2017 23:19:45 +0100 Subject: NOISSUE remove liteloader and forge --- application/pages/VersionPage.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index b90b3e43..42eb31de 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -36,10 +36,6 @@ #include #include "minecraft/MinecraftProfile.h" -#include "minecraft/forge/ForgeVersionList.h" -#include "minecraft/forge/ForgeInstaller.h" -#include "minecraft/liteloader/LiteLoaderVersionList.h" -#include "minecraft/liteloader/LiteLoaderInstaller.h" #include "minecraft/auth/MojangAccountList.h" #include "minecraft/Mod.h" #include "icons/IconList.h" @@ -375,16 +371,18 @@ int VersionPage::doUpdate() void VersionPage::on_forgeBtn_clicked() { - VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this); + auto vlist = ENV.getVersionList("net.minecraftforge"); + if(!vlist) + { + return; + } + VersionSelectDialog vselect(vlist.get(), tr("Select Forge version"), this); vselect.setExactFilter(BaseVersionList::ParentGameVersionRole, m_inst->currentVersionId()); - vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + - m_inst->currentVersionId()); + vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_inst->currentVersionId()); vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!")); if (vselect.exec() && vselect.selectedVersion()) { - ProgressDialog dialog(this); - dialog.execWithTask( - ForgeInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); + m_profile->installVersion(vselect.selectedVersion()); preselect(m_profile->rowCount(QModelIndex())-1); m_container->refreshContainer(); } @@ -392,17 +390,18 @@ void VersionPage::on_forgeBtn_clicked() void VersionPage::on_liteloaderBtn_clicked() { - VersionSelectDialog vselect(MMC->liteloaderlist().get(), tr("Select LiteLoader version"), - this); + auto vlist = ENV.getVersionList("com.liteloader"); + if(!vlist) + { + return; + } + VersionSelectDialog vselect(vlist.get(), tr("Select LiteLoader version"), this); vselect.setExactFilter(BaseVersionList::ParentGameVersionRole, m_inst->currentVersionId()); - vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + - m_inst->currentVersionId()); + vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_inst->currentVersionId()); vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!")); if (vselect.exec() && vselect.selectedVersion()) { - ProgressDialog dialog(this); - dialog.execWithTask( - LiteLoaderInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); + m_profile->installVersion(vselect.selectedVersion()); preselect(m_profile->rowCount(QModelIndex())-1); m_container->refreshContainer(); } -- cgit v1.2.3 From 2660418d58efb33cd3a0ab8ed9d48c359c076905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 19 Mar 2017 02:13:49 +0100 Subject: NOISSUE hack it together enough to get launching back Meta index will now always return valid objects. They just might never load if they don't exist on the server. --- application/pages/VersionPage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 42eb31de..78e2a888 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -320,6 +320,7 @@ 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); if (!vselect.exec() || !vselect.selectedVersion()) -- cgit v1.2.3 From f557c1367994a61935fa0e8d0b1b67688d2692d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 19 Mar 2017 23:58:54 +0100 Subject: NOISSUE stuff and things happened. Maybe. --- application/pages/VersionPage.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 78e2a888..732a33eb 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -487,22 +487,16 @@ int VersionPage::currentRow() void VersionPage::on_customizeBtn_clicked() { - // TODO: implement - /* auto version = currentRow(); if(version == -1) { return; } - //HACK HACK remove, this is dumb auto patch = m_profile->versionPatch(version); - auto mc = std::dynamic_pointer_cast(patch); - if(mc && mc->needsUpdate()) + if(!patch->getVersionFile()) { - if(!doUpdate()) - { - return; - } + // TODO: wait for the update task to finish here... + return; } if(!m_profile->customize(version)) { @@ -510,7 +504,6 @@ void VersionPage::on_customizeBtn_clicked() } updateButtons(); preselect(currentIdx); - */ } void VersionPage::on_editBtn_clicked() @@ -531,22 +524,11 @@ void VersionPage::on_editBtn_clicked() void VersionPage::on_revertBtn_clicked() { - // TODO: implement - /* auto version = currentRow(); if(version == -1) { return; } - auto mcraw = MMC->minecraftlist()->findVersion(m_inst->intendedVersionId()); - auto mc = std::dynamic_pointer_cast(mcraw); - if(mc && mc->needsUpdate()) - { - if(!doUpdate()) - { - return; - } - } if(!m_profile->revertToBase(version)) { // TODO: some error box here @@ -554,7 +536,6 @@ void VersionPage::on_revertBtn_clicked() updateButtons(); preselect(currentIdx); m_container->refreshContainer(); - */ } #include "VersionPage.moc" -- cgit v1.2.3 From da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 24 Mar 2017 02:26:06 +0100 Subject: NOISSUE reimplement package dependencies It is now stored as a hashmap There is also a parentUid to limit depsolving by encapsulating by version --- application/pages/VersionPage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 732a33eb..0608b2bf 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -43,6 +43,9 @@ #include "MultiMC.h" +#include +#include + class IconProxy : public QIdentityProxyModel { Q_OBJECT @@ -372,7 +375,7 @@ int VersionPage::doUpdate() void VersionPage::on_forgeBtn_clicked() { - auto vlist = ENV.getVersionList("net.minecraftforge"); + auto vlist = ENV.metadataIndex()->get("net.minecraftforge"); if(!vlist) { return; @@ -391,7 +394,7 @@ void VersionPage::on_forgeBtn_clicked() void VersionPage::on_liteloaderBtn_clicked() { - auto vlist = ENV.getVersionList("com.liteloader"); + auto vlist = ENV.metadataIndex()->get("com.liteloader"); if(!vlist) { return; -- cgit v1.2.3 From 5fabb4f2546fa6b79a4e2c29679f506e587a0070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 27 Mar 2017 03:34:39 +0200 Subject: NOISSUE Rough refactor of ProfilePatch and VersionFile internals. They are now distinct classes with distinct responsibilities. * ProfilePatch is an entry in MinecraftProfile and can hold VersionFile or Meta::Version. * VersionFile is the basic element that holds version information loaded from JSON. * Meta::Version is the loader class for VersionFile(s) from a server. --- application/pages/VersionPage.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 0608b2bf..5a0b2243 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -152,14 +152,14 @@ void VersionPage::packageCurrent(const QModelIndex ¤t, const QModelIndex & auto severity = patch->getProblemSeverity(); switch(severity) { - case PROBLEM_WARNING: + case ProblemSeverity::Warning: ui->frame->setModText(tr("%1 possibly has issues.").arg(patch->getName())); break; - case PROBLEM_ERROR: + case ProblemSeverity::Error: ui->frame->setModText(tr("%1 has issues!").arg(patch->getName())); break; default: - case PROBLEM_NONE: + case ProblemSeverity::None: ui->frame->clear(); return; } @@ -168,11 +168,11 @@ void VersionPage::packageCurrent(const QModelIndex ¤t, const QModelIndex & QString problemOut; for (auto &problem: problems) { - if(problem.getSeverity() == PROBLEM_ERROR) + if(problem.getSeverity() == ProblemSeverity::Error) { problemOut += tr("Error: "); } - else if(problem.getSeverity() == PROBLEM_WARNING) + else if(problem.getSeverity() == ProblemSeverity::Warning) { problemOut += tr("Warning: "); } @@ -381,7 +381,7 @@ void VersionPage::on_forgeBtn_clicked() return; } VersionSelectDialog vselect(vlist.get(), tr("Select Forge version"), this); - vselect.setExactFilter(BaseVersionList::ParentGameVersionRole, m_inst->currentVersionId()); + vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_inst->currentVersionId()); vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_inst->currentVersionId()); vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!")); if (vselect.exec() && vselect.selectedVersion()) @@ -400,7 +400,7 @@ void VersionPage::on_liteloaderBtn_clicked() return; } VersionSelectDialog vselect(vlist.get(), tr("Select LiteLoader version"), this); - vselect.setExactFilter(BaseVersionList::ParentGameVersionRole, m_inst->currentVersionId()); + vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_inst->currentVersionId()); vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_inst->currentVersionId()); vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!")); if (vselect.exec() && vselect.selectedVersion()) @@ -457,7 +457,7 @@ void VersionPage::updateButtons(int row) ui->moveDownBtn->setEnabled(patch->isMoveable()); ui->moveUpBtn->setEnabled(patch->isMoveable()); ui->changeVersionBtn->setEnabled(patch->isVersionChangeable()); - ui->editBtn->setEnabled(patch->isEditable()); + ui->editBtn->setEnabled(patch->isCustom()); ui->customizeBtn->setEnabled(patch->isCustomizable()); ui->revertBtn->setEnabled(patch->isRevertible()); } -- cgit v1.2.3 From 2ac0edbbdb27e12bae00c4779da135582bde89f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 30 Mar 2017 01:05:58 +0200 Subject: 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. --- application/pages/VersionPage.cpp | 47 ++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'application/pages/VersionPage.cpp') 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(); } -- cgit v1.2.3 From e0596d3c86806d952a9811f306f497f84430ae3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 31 Mar 2017 23:47:56 +0200 Subject: NOISSUE Make forge installable again --- application/pages/VersionPage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 94068786..a7029b36 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -401,7 +401,10 @@ void VersionPage::on_forgeBtn_clicked() vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!")); if (vselect.exec() && vselect.selectedVersion()) { - m_profile->installVersion(vselect.selectedVersion()); + auto vsn = vselect.selectedVersion(); + m_inst->setComponentVersion("net.minecraftforge", vsn->descriptor()); + m_profile->reload(); + // m_profile->installVersion(); preselect(m_profile->rowCount(QModelIndex())-1); m_container->refreshContainer(); } @@ -420,7 +423,10 @@ void VersionPage::on_liteloaderBtn_clicked() vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!")); if (vselect.exec() && vselect.selectedVersion()) { - m_profile->installVersion(vselect.selectedVersion()); + auto vsn = vselect.selectedVersion(); + m_inst->setComponentVersion("com.liteloader", vsn->descriptor()); + m_profile->reload(); + // m_profile->installVersion(vselect.selectedVersion()); preselect(m_profile->rowCount(QModelIndex())-1); m_container->refreshContainer(); } -- cgit v1.2.3 From dff307557bf69cb2dc6cc264b485865469ef64fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 6 Apr 2017 23:32:20 +0200 Subject: NOISSUE fix liteloader uid where it is hardcoded hardcoded --- application/pages/VersionPage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index a7029b36..8c14818f 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -412,7 +412,7 @@ void VersionPage::on_forgeBtn_clicked() void VersionPage::on_liteloaderBtn_clicked() { - auto vlist = ENV.metadataIndex()->get("com.liteloader"); + auto vlist = ENV.metadataIndex()->get("com.mumfrey.liteloader"); if(!vlist) { return; @@ -424,7 +424,7 @@ void VersionPage::on_liteloaderBtn_clicked() if (vselect.exec() && vselect.selectedVersion()) { auto vsn = vselect.selectedVersion(); - m_inst->setComponentVersion("com.liteloader", vsn->descriptor()); + m_inst->setComponentVersion("com.mumfrey.liteloader", vsn->descriptor()); m_profile->reload(); // m_profile->installVersion(vselect.selectedVersion()); preselect(m_profile->rowCount(QModelIndex())-1); -- cgit v1.2.3 From d864c95e2b5e172116370694d59a615a97cf390f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 6 Apr 2017 23:39:50 +0200 Subject: NOISSUE disable version customization until further notice --- application/pages/VersionPage.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 8c14818f..8e8c3d5f 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -479,7 +479,8 @@ void VersionPage::updateButtons(int row) ui->moveUpBtn->setEnabled(patch->isMoveable()); ui->changeVersionBtn->setEnabled(patch->isVersionChangeable()); ui->editBtn->setEnabled(patch->isCustom()); - ui->customizeBtn->setEnabled(patch->isCustomizable()); + // FIXME: temporarily disabled, bring it back when the new format is stable and ready to replace the 'OneSix' one... + ui->customizeBtn->setEnabled(false); // patch->isCustomizable() ui->revertBtn->setEnabled(patch->isRevertible()); } } @@ -511,6 +512,8 @@ int VersionPage::currentRow() void VersionPage::on_customizeBtn_clicked() { + // FIXME: temporarily disabled, bring it back when the new format is stable and ready to replace the 'OneSix' one... + return; auto version = currentRow(); if(version == -1) { -- cgit v1.2.3