diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-05-17 16:09:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 16:09:22 +0200 |
commit | cc13310083fe8d0c3bb423fa3e31db7b1f7b25e1 (patch) | |
tree | 19e4613e56c44f0b755a36435f44f3b1d7636058 /launcher/ui/pages/modplatform/ImportPage.cpp | |
parent | 1012912272d14d8cc8eb1e009579a997b7a35b7f (diff) | |
parent | ddc3b5eb0bbd17edd60d96f5094d65dbdb922765 (diff) | |
download | PrismLauncher-cc13310083fe8d0c3bb423fa3e31db7b1f7b25e1.tar.gz PrismLauncher-cc13310083fe8d0c3bb423fa3e31db7b1f7b25e1.tar.bz2 PrismLauncher-cc13310083fe8d0c3bb423fa3e31db7b1f7b25e1.zip |
Merge pull request #565 from Scrumplex/modrinth-packs
Initial Modrinth modpack support
Diffstat (limited to 'launcher/ui/pages/modplatform/ImportPage.cpp')
-rw-r--r-- | launcher/ui/pages/modplatform/ImportPage.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/launcher/ui/pages/modplatform/ImportPage.cpp b/launcher/ui/pages/modplatform/ImportPage.cpp index 1b53dd40..c7bc13d8 100644 --- a/launcher/ui/pages/modplatform/ImportPage.cpp +++ b/launcher/ui/pages/modplatform/ImportPage.cpp @@ -2,6 +2,7 @@ /* * PolyMC - Minecraft Launcher * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org> + * Copyright (c) 2022 Sefa Eyeoglu <contact@scrumplex.net> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -109,7 +110,11 @@ void ImportPage::updateState() { // FIXME: actually do some validation of what's inside here... this is fake AF QFileInfo fi(input); - if(fi.exists() && fi.suffix() == "zip") + // mrpack is a modrinth pack + + // Allow non-latin people to use ZIP files! + auto zip = QMimeDatabase().mimeTypeForUrl(url).suffixes().contains("zip"); + if(fi.exists() && (zip || fi.suffix() == "mrpack")) { QFileInfo fi(url.fileName()); dialog->setSuggestedPack(fi.completeBaseName(), new InstanceImportTask(url)); @@ -144,6 +149,7 @@ void ImportPage::setUrl(const QString& url) void ImportPage::on_modpackBtn_clicked() { auto filter = QMimeDatabase().mimeTypeForName("application/zip").filterString(); + filter += ";;" + tr("Modrinth pack (*.mrpack)"); const QUrl url = QFileDialog::getOpenFileUrl(this, tr("Choose modpack"), modpackUrl(), filter); if (url.isValid()) { |