diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-02-03 17:25:08 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-02-03 18:59:54 +0100 |
commit | 9db7e07d5a42737d48c4e230f7c4e451ea3dd689 (patch) | |
tree | 8745310a515cb3cd1d3c0320c6755aaf6af718f3 | |
parent | 67532dfa95cd0f8ef98046c5d8836b2c89613063 (diff) |
Import zip via drag and drop in project manager.
Dropping a single ZIP file in the project manager will now prompt the
import dialog.
-rw-r--r-- | editor/project_manager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5951373af9..afbed0c610 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2281,6 +2281,11 @@ void ProjectManager::_install_project(const String &p_zip_path, const String &p_ } void ProjectManager::_files_dropped(PackedStringArray p_files, int p_screen) { + if (p_files.size() == 1 && p_files[0].ends_with(".zip")) { + const String file = p_files[0].get_file(); + _install_project(p_files[0], file.substr(0, file.length() - 4).capitalize()); + return; + } Set<String> folders_set; DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); for (int i = 0; i < p_files.size(); i++) { |