From 72748d1363d090f33d5ca6b9c00142b5e8f7d78f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 8 Aug 2016 01:41:57 -0300 Subject: -Show proper node name in subcall -Implemented Ctrl-F to focus script type search --- modules/visual_script/visual_script_editor.cpp | 7 +++++++ modules/visual_script/visual_script_editor.h | 3 ++- modules/visual_script/visual_script_nodes.cpp | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index d01cafb90c..0d97126e0a 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 22dc6ce87f..bd33f35739 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 2326bdc4a4..d205a40f76 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