fix(modpack): should accept dragging .mrpack file into rootpage. Closes #1497.
This commit is contained in:
@@ -41,7 +41,6 @@ import org.jackhuang.hmcl.ui.versions.GameAdvancedListItem;
|
|||||||
import org.jackhuang.hmcl.ui.versions.Versions;
|
import org.jackhuang.hmcl.ui.versions.Versions;
|
||||||
import org.jackhuang.hmcl.upgrade.UpdateChecker;
|
import org.jackhuang.hmcl.upgrade.UpdateChecker;
|
||||||
import org.jackhuang.hmcl.util.io.CompressingUtils;
|
import org.jackhuang.hmcl.util.io.CompressingUtils;
|
||||||
import org.jackhuang.hmcl.util.io.FileUtils;
|
|
||||||
import org.jackhuang.hmcl.util.versioning.VersionNumber;
|
import org.jackhuang.hmcl.util.versioning.VersionNumber;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -82,7 +81,7 @@ public class RootPage extends DecoratorAnimatedPage implements DecoratorPage {
|
|||||||
private MainPage getMainPage() {
|
private MainPage getMainPage() {
|
||||||
if (mainPage == null) {
|
if (mainPage == null) {
|
||||||
MainPage mainPage = new MainPage();
|
MainPage mainPage = new MainPage();
|
||||||
FXUtils.applyDragListener(mainPage, it -> "zip".equals(FileUtils.getExtension(it)), modpacks -> {
|
FXUtils.applyDragListener(mainPage, ModpackHelper::isFileModpackByExtension, modpacks -> {
|
||||||
File modpack = modpacks.get(0);
|
File modpack = modpacks.get(0);
|
||||||
Controllers.getDecorator().startWizard(
|
Controllers.getDecorator().startWizard(
|
||||||
new ModpackInstallWizardProvider(Profiles.getSelectedProfile(), modpack),
|
new ModpackInstallWizardProvider(Profiles.getSelectedProfile(), modpack),
|
||||||
|
|||||||
Reference in New Issue
Block a user