From b7f8241968b4cf684c31c575a6159d577faab76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 29 May 2015 02:22:02 +0200 Subject: 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 --- application/pages/VersionPage.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'application/pages/VersionPage.cpp') 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(); } -- cgit v1.2.3