summaryrefslogtreecommitdiffstats
path: root/application/pages/VersionPage.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-08-07 00:46:29 +0200
committerPetr Mrázek <peterix@gmail.com>2017-08-07 00:46:29 +0200
commit8cf88ffc580310e2e814d097358ff783cd5c4416 (patch)
tree4ed75860253ffa667af38664b4fd10e6d7bc29de /application/pages/VersionPage.cpp
parent117bfef151c2083085025c32f96461f1c97dbec3 (diff)
downloadMultiMC-8cf88ffc580310e2e814d097358ff783cd5c4416.tar
MultiMC-8cf88ffc580310e2e814d097358ff783cd5c4416.tar.gz
MultiMC-8cf88ffc580310e2e814d097358ff783cd5c4416.tar.lz
MultiMC-8cf88ffc580310e2e814d097358ff783cd5c4416.tar.xz
MultiMC-8cf88ffc580310e2e814d097358ff783cd5c4416.zip
GH-1314 add UI for custom minecraft jar addition
Also changes the text of the jar mod addition button. It should be clearer what it does and hopefully will not confuse as many people.
Diffstat (limited to 'application/pages/VersionPage.cpp')
-rw-r--r--application/pages/VersionPage.cpp34
1 files changed, 10 insertions, 24 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp
index 8c14818f..90fd3241 100644
--- a/application/pages/VersionPage.cpp
+++ b/application/pages/VersionPage.cpp
@@ -250,34 +250,20 @@ void VersionPage::on_modBtn_clicked()
void VersionPage::on_jarmodBtn_clicked()
{
- bool nagShown = false;
- if (!m_profile->hasTrait("legacyLaunch") && !m_profile->hasTrait("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::BrowseForFiles("jarmod", tr("Select jar mods"), tr("Minecraft.jar mods (*.zip *.jar)"), MMC->settings()->get("CentralModsDir").toString(), this->parentWidget());
if(!list.empty())
{
m_profile->installJarMods(list);
- if(nagShown)
- {
- MMC->settings()->set("JarModNagSeen", QVariant(true));
- }
+ }
+ updateButtons();
+}
+
+void VersionPage::on_jarBtn_clicked()
+{
+ auto jarPath = GuiUtil::BrowseForFile("jar", tr("Select jar"), tr("Minecraft.jar replacement (*.jar)"), MMC->settings()->get("CentralModsDir").toString(), this->parentWidget());
+ if(!jarPath.isEmpty())
+ {
+ m_profile->installCustomJar(jarPath);
}
updateButtons();
}