summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-08 01:41:57 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-08 01:41:57 -0300
commit72748d1363d090f33d5ca6b9c00142b5e8f7d78f (patch)
treeb1f0ae25bff6d9a23952eeaaf62985315c5dd3e9
parent9865650b43c2a924f5e3ed4ffdaac56c87328756 (diff)
-Show proper node name in subcall
-Implemented Ctrl-F to focus script type search
-rw-r--r--modules/visual_script/visual_script_editor.cpp7
-rw-r--r--modules/visual_script/visual_script_editor.h3
-rw-r--r--modules/visual_script/visual_script_nodes.cpp8
3 files changed, 17 insertions, 1 deletions
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<Script> script = get_script();
+ if (script.is_valid()) {
+ if (script->get_name()!=String())
+ return script->get_name();
+ if (script->get_path().is_resource_file())
+ return script->get_path().get_file();
+ return script->get_type();
+ }
return "";
}