diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-07 00:30:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-07 00:30:31 +0100 |
commit | 06d0166bda9bb3c298cc1b6f5b075a22d82bb097 (patch) | |
tree | 2c354f85240e5f7e2b5120187885a4e71089b9cc | |
parent | e3155071bc9a7e5cd884d9435893813ff5871f62 (diff) | |
parent | 82f896b1ee8c632689baf4bda7e06a9e03c324f5 (diff) |
Merge pull request #13827 from sersoong/master-addopenselection
Enhanced 'open' menu in filesystemdock
-rw-r--r-- | editor/filesystem_dock.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 9fe3e2ad25..ca6571fdda 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -909,10 +909,11 @@ void FileSystemDock::_file_option(int p_option) { OS::get_singleton()->shell_open(String("file://") + dir); } break; case FILE_OPEN: { - int idx = files->get_current(); - if (idx < 0 || idx >= files->get_item_count()) - break; - _select_file(idx); + for (int i = 0; i < files->get_item_count(); i++) { + if (files->is_selected(i)) { + _select_file(i); + } + } } break; case FILE_INSTANCE: { @@ -1429,14 +1430,17 @@ void FileSystemDock::_files_list_rmb_select(int p_item, const Vector2 &p_pos) { file_options->clear(); file_options->set_size(Size2(1, 1)); - if (all_files && filenames.size() > 0) { - file_options->add_item(TTR("Open"), FILE_OPEN); - if (all_files_scenes) { + if (all_files) { + + if (all_files_scenes && filenames.size() >= 1) { + file_options->add_item(TTR("Open Scene(s)"), FILE_OPEN); file_options->add_item(TTR("Instance"), FILE_INSTANCE); + file_options->add_separator(); } - file_options->add_separator(); - if (filenames.size() == 1) { + if (!all_files_scenes && filenames.size() == 1) { + file_options->add_item(TTR("Open"), FILE_OPEN); + file_options->add_separator(); file_options->add_item(TTR("Edit Dependencies.."), FILE_DEPENDENCIES); file_options->add_item(TTR("View Owners.."), FILE_OWNERS); file_options->add_separator(); |