diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-07-20 14:09:03 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-07-21 11:10:44 -0300 |
commit | 53beeb774b36b7af391e61fffeceb9f7ed3e299e (patch) | |
tree | 69598566fc53bd4a7254983e20d87929e4a5d30d /tools/editor/filesystem_dock.cpp | |
parent | 4abc945466c69426cf4c00ab87d61b927ef1639d (diff) | |
download | redot-engine-53beeb774b36b7af391e61fffeceb9f7ed3e299e.tar.gz |
"FileSystem" dock now instance all selected scenes in one action
Diffstat (limited to 'tools/editor/filesystem_dock.cpp')
-rw-r--r-- | tools/editor/filesystem_dock.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index 3be122cc7d..378edd6667 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -950,14 +950,20 @@ void FileSystemDock::_file_option(int p_option) { } break; case FILE_INSTANCE: { + Vector<String> paths; + for (int i = 0; i<files->get_item_count(); i++) { if (!files->is_selected(i)) continue; String path =files->get_item_metadata(i); if (EditorFileSystem::get_singleton()->get_file_type(path)=="PackedScene") { - emit_signal("instance",path); + paths.push_back(path); } } + + if (!paths.empty()) { + emit_signal("instance", paths); + } } break; case FILE_DEPENDENCIES: { @@ -1596,7 +1602,7 @@ void FileSystemDock::_bind_methods() { ObjectTypeDB::bind_method(_MD("_preview_invalidated"),&FileSystemDock::_preview_invalidated); - ADD_SIGNAL(MethodInfo("instance")); + ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::STRING_ARRAY, "files"))); ADD_SIGNAL(MethodInfo("open")); } |