diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2017-05-20 12:38:03 -0300 |
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2017-05-20 17:05:38 -0300 |
| commit | 5b3709d3096df737b8bb2344446be818b0389bfe (patch) | |
| tree | 649a0989b1494f3c4687d59e503310f4e6bbeb40 /editor/plugins/script_editor_plugin.cpp | |
| parent | 93f9a83062dbe74474a4a7928758c5cf5588238e (diff) | |
| download | redot-engine-5b3709d3096df737b8bb2344446be818b0389bfe.tar.gz | |
Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 4582108210..d369064050 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -164,14 +164,16 @@ void ScriptEditorQuickOpen::_text_changed(const String &p_newtext) { _update_search(); } -void ScriptEditorQuickOpen::_sbox_input(const InputEvent &p_ie) { +void ScriptEditorQuickOpen::_sbox_input(const Ref<InputEvent> &p_ie) { - if (p_ie.type == InputEvent::KEY && (p_ie.key.scancode == KEY_UP || - p_ie.key.scancode == KEY_DOWN || - p_ie.key.scancode == KEY_PAGEUP || - p_ie.key.scancode == KEY_PAGEDOWN)) { + Ref<InputEventKey> k = p_ie; - search_options->call("_gui_input", p_ie); + if (k.is_valid() && (k->get_scancode() == KEY_UP || + k->get_scancode() == KEY_DOWN || + k->get_scancode() == KEY_PAGEUP || + k->get_scancode() == KEY_PAGEDOWN)) { + + search_options->call("_gui_input", k); search_box->accept_event(); } } @@ -1778,8 +1780,8 @@ void ScriptEditor::_script_split_dragged(float) { _save_layout(); } -void ScriptEditor::_unhandled_input(const InputEvent &p_event) { - if (p_event.key.pressed || !is_visible_in_tree()) return; +void ScriptEditor::_unhandled_input(const Ref<InputEvent> &p_event) { + if (p_event->is_pressed() || !is_visible_in_tree()) return; if (ED_IS_SHORTCUT("script_editor/next_script", p_event)) { int next_tab = script_list->get_current() + 1; next_tab %= script_list->get_item_count(); |
