diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-07-25 20:54:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 20:54:45 +0200 |
commit | 19fe78fe6fe2aa3b8a0d8009a5a47d75c3242a92 (patch) | |
tree | afa377e1336c725be5ec345186ca7abb230e940d /modules/visual_script | |
parent | 237148e80f4af141049eeee033f7e60310ece8dc (diff) | |
parent | 31008c91998107fe434e96ebc86414336e842bf8 (diff) |
Merge pull request #20450 from fire/vs_generic_search_20433
Visualscript: Don't show Shift+A search box at every screen.
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 14 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.h | 3 |
2 files changed, 9 insertions, 8 deletions
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index ad6d32b567..d29104ed45 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1327,12 +1327,10 @@ void VisualScriptEditor::_input(const Ref<InputEvent> &p_event) { if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { revert_on_drag = String(); //so we can still drag functions } +} - Ref<InputEventKey> k = p_event; - if (k.is_valid() && k->get_scancode() == KEY_A && k->get_shift() && k->is_pressed()) { - new_connect_node_select->select_from_visual_script(String("")); - accept_event(); - } +void VisualScriptEditor::_generic_search() { + new_connect_node_select->select_from_visual_script(String("")); } void VisualScriptEditor::_members_gui_input(const Ref<InputEvent> &p_event) { @@ -3148,9 +3146,7 @@ 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"); + _generic_search(); } break; case EDIT_COPY_NODES: case EDIT_CUT_NODES: { @@ -3487,6 +3483,8 @@ void VisualScriptEditor::_bind_methods() { ClassDB::bind_method("_member_option", &VisualScriptEditor::_member_option); ClassDB::bind_method("_update_available_nodes", &VisualScriptEditor::_update_available_nodes); + + ClassDB::bind_method("_generic_search", &VisualScriptEditor::_generic_search); } VisualScriptEditor::VisualScriptEditor() { diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 0283f7b162..e0f8a0aaa7 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -212,6 +212,9 @@ class VisualScriptEditor : public ScriptEditorBase { String revert_on_drag; void _input(const Ref<InputEvent> &p_event); + + void _generic_search(); + void _members_gui_input(const Ref<InputEvent> &p_event); void _on_nodes_delete(); void _on_nodes_duplicate(); |