diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index d01cafb90c4..0d97126e0aa 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -2362,6 +2362,11 @@ void VisualScriptEditor::_menu_option(int p_what) { } } break; + case EDIT_FIND_NODE_TYPE: { + //popup disappearing grabs focus to owner, so use call deferred + node_filter->call_deferred("grab_focus"); + node_filter->call_deferred("select_all"); + } break; } } @@ -2420,6 +2425,7 @@ VisualScriptEditor::VisualScriptEditor() { edit_menu->set_text(TTR("Edit")); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/delete_selected"), EDIT_DELETE_NODES); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/toggle_breakpoint"), EDIT_TOGGLE_BREAKPOINT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/find_node_type"), EDIT_FIND_NODE_TYPE); edit_menu->get_popup()->connect("item_pressed",this,"_menu_option"); main_hsplit = memnew( HSplitContainer ); @@ -2601,6 +2607,7 @@ static void register_editor_callback() { ED_SHORTCUT("visual_script_editor/delete_selected", TTR("Delete Selected")); ED_SHORTCUT("visual_script_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9); + ED_SHORTCUT("visual_script_editor/find_node_type", TTR("Find Node Tyoe"), KEY_MASK_CMD+KEY_F); } diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 22dc6ce87f4..bd33f357392 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -24,7 +24,8 @@ class VisualScriptEditor : public ScriptEditorBase { enum { EDIT_DELETE_NODES, - EDIT_TOGGLE_BREAKPOINT + EDIT_TOGGLE_BREAKPOINT, + EDIT_FIND_NODE_TYPE, }; MenuButton *edit_menu; diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 2326bdc4a48..d205a40f76c 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -2363,6 +2363,14 @@ String VisualScriptSubCall::get_caption() const { String VisualScriptSubCall::get_text() const { + Ref