diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-29 02:22:02 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-29 02:22:02 +0200 |
commit | b7f8241968b4cf684c31c575a6159d577faab76a (patch) | |
tree | d88807c22e41d4676f66c193eced467074ac7d55 /application/pages/VersionPage.cpp | |
parent | a98e1df10cef774672e919497c43373e86c77f97 (diff) | |
download | MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar.gz MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar.lz MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar.xz MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.zip |
GH-994 hopefully fix issue with people still using jar mods
Added an 'add mods' button to the version page
Add jar mods now has a very angry nag dialog until it's used successfully
Buttons on version page are rearranged to deemphasize jar mods
Diffstat (limited to 'application/pages/VersionPage.cpp')
-rw-r--r-- | application/pages/VersionPage.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 831408f6..cbb5c107 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -58,6 +58,11 @@ bool VersionPage::shouldDisplay() const return !m_inst->isRunning(); } +void VersionPage::setParentContainer(BasePageContainer * container) +{ + m_container = container; +} + VersionPage::VersionPage(OneSixInstance *inst, QWidget *parent) : QWidget(parent), ui(new Ui::VersionPage), m_inst(inst) { @@ -145,12 +150,45 @@ void VersionPage::on_removeBtn_clicked() updateButtons(); } +void VersionPage::on_modBtn_clicked() +{ + if(m_container) + { + m_container->selectPage("mods"); + } +} + void VersionPage::on_jarmodBtn_clicked() { + bool nagShown = false; + auto traits = m_version->traits; + if (!traits.contains("legacyLaunch") && !traits.contains("alphaLaunch")) + { + // not legacy launch... nag + auto seenNag = MMC->settings()->get("JarModNagSeen").toBool(); + if(!seenNag) + { + auto result = QMessageBox::question(this, + tr("Are you sure?"), + tr("This will add mods directly to the Minecraft jar.\n" + "Unless you KNOW that this is what NEEDS to be done, you should just use the mods folder (Loader mods).\n" + "\n" + "Do you want to continue?"), + tr("I understand, continue."), tr("Cancel"), QString(), 1, 1 + ); + if(result != 0) + return; + nagShown = true; + } + } auto list = GuiUtil::BrowseForMods("jarmod", tr("Select jar mods"), tr("Minecraft.jar mods (*.zip *.jar)"), this->parentWidget()); if(!list.empty()) { m_version->installJarMods(list); + if(nagShown) + { + MMC->settings()->set("JarModNagSeen", QVariant(true)); + } } updateButtons(); } |