-Show proper node name in subcall

-Implemented Ctrl-F to focus script type search
This commit is contained in:
Juan Linietsky 2016-08-08 01:41:57 -03:00
parent 9865650b43
commit 72748d1363
3 changed files with 17 additions and 1 deletions

View file

@ -2362,6 +2362,11 @@ void VisualScriptEditor::_menu_option(int p_what) {
} }
} break; } 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->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/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/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"); edit_menu->get_popup()->connect("item_pressed",this,"_menu_option");
main_hsplit = memnew( HSplitContainer ); 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/delete_selected", TTR("Delete Selected"));
ED_SHORTCUT("visual_script_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9); 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);
} }

View file

@ -24,7 +24,8 @@ class VisualScriptEditor : public ScriptEditorBase {
enum { enum {
EDIT_DELETE_NODES, EDIT_DELETE_NODES,
EDIT_TOGGLE_BREAKPOINT EDIT_TOGGLE_BREAKPOINT,
EDIT_FIND_NODE_TYPE,
}; };
MenuButton *edit_menu; MenuButton *edit_menu;

View file

@ -2363,6 +2363,14 @@ String VisualScriptSubCall::get_caption() const {
String VisualScriptSubCall::get_text() 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 ""; return "";
} }