From 0fb87f0b1d87039ff5d150b106a961748e43a104 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sun, 13 Jan 2019 11:55:55 +0800 Subject: [PATCH] Accept modpack drag --- HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java index 13e7504d1..3dcd9dc76 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java @@ -90,8 +90,13 @@ public final class Controllers { // FXThread public static GameList getGameListPage() { - if (gameListPage == null) + if (gameListPage == null) { gameListPage = new GameList(); + FXUtils.applyDragListener(gameListPage, it -> "zip".equals(FileUtils.getExtension(it)), modpacks -> { + File modpack = modpacks.get(0); + Controllers.getDecorator().startWizard(new ModpackInstallWizardProvider(Profiles.getSelectedProfile(), modpack), i18n("install.modpack")); + }); + } return gameListPage; }