From 7fa3bd4e78a36e32c7020e92c74974a6d30051ae Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Fri, 8 Jan 2016 08:27:34 -0300 Subject: Quick open now can open multiple scenes and scripts --- tools/editor/editor_node.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'tools/editor/editor_node.cpp') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 9fe0409c0e..4fbd2c0b69 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2076,21 +2076,21 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case FILE_QUICK_OPEN_SCENE: { - quick_open->popup("PackedScene"); + quick_open->popup("PackedScene", true); quick_open->set_title("Quick Open Scene.."); } break; case FILE_QUICK_OPEN_SCRIPT: { - quick_open->popup("Script"); + quick_open->popup("Script", true); quick_open->set_title("Quick Open Script.."); } break; case FILE_QUICK_OPEN_FILE: { - quick_open->popup("Resource",false,true); + quick_open->popup("Resource", false, true); quick_open->set_title("Quick Search File.."); } break; @@ -3927,19 +3927,26 @@ void EditorNode::hide_animation_player_editors() { emit_signal("hide_animation_player_editors"); } -void EditorNode::_quick_opened(const String& p_resource) { +void EditorNode::_quick_opened() { if (current_option==FILE_QUICK_OPEN_FILE) { - scenes_dock->open(p_resource); + String res_path = quick_open->get_selected(); + + scenes_dock->open(res_path); return; } - if (quick_open->get_base_type()=="PackedScene") { - open_request(p_resource); - } else { - load_resource(p_resource); - } + Vector files = quick_open->get_selected_files(); + + for (int i = 0; i < files.size(); i++) { + String res_path = files[i]; + if (quick_open->get_base_type()=="PackedScene") { + open_request(res_path); + } else { + load_resource(res_path); + } + } } void EditorNode::_quick_run(const String& p_resource) { -- cgit v1.2.3