diff options
author | reduz <reduzio@gmail.com> | 2021-08-22 12:37:22 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-08-23 08:10:13 -0300 |
commit | 5cecdfa8afb91a60305b429f5b738e27dadbc83f (patch) | |
tree | 40bf21e1beae1a6883770d2ac0473222ff41ae65 /modules | |
parent | 2d446771d6701bb77432b6df5a768e53c9a6c95d (diff) |
Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.
Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 20 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_property_selector.cpp | 2 |
5 files changed, 4 insertions, 26 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index f101c43e89..2331a12d0f 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -790,7 +790,7 @@ void GridMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) { if (k.is_valid() && (k->get_keycode() == KEY_UP || k->get_keycode() == KEY_DOWN || k->get_keycode() == KEY_PAGEUP || k->get_keycode() == KEY_PAGEDOWN)) { // Forward the key input to the ItemList so it can be scrolled - mesh_library_palette->call("_gui_input", k); + mesh_library_palette->gui_input(k); search_box->accept_event(); } } diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 86793af77f..142419f90a 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1845,26 +1845,6 @@ void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_o max_input_args = 0; max_output_args = 0; - if (Object::cast_to<Node>(p_owner)) { - // Turn on these if they exist and base is a node. - Node *node = Object::cast_to<Node>(p_owner); - if (p_script->functions.has("_process")) { - node->set_process(true); - } - if (p_script->functions.has("_physics_process")) { - node->set_physics_process(true); - } - if (p_script->functions.has("_input")) { - node->set_process_input(true); - } - if (p_script->functions.has("_unhandled_input")) { - node->set_process_unhandled_input(true); - } - if (p_script->functions.has("_unhandled_key_input")) { - node->set_process_unhandled_key_input(true); - } - } - // Setup variables. { List<StringName> keys; diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 9d813e3d77..ded716cf18 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1816,7 +1816,7 @@ void VisualScriptEditor::_generic_search(String p_base_type, Vector2 pos, bool n } } -void VisualScriptEditor::_input(const Ref<InputEvent> &p_event) { +void VisualScriptEditor::input(const Ref<InputEvent> &p_event) { ERR_FAIL_COND(p_event.is_null()); // GUI input for VS Editor Plugin @@ -4246,8 +4246,6 @@ void VisualScriptEditor::_bind_methods() { ClassDB::bind_method("_can_drop_data_fw", &VisualScriptEditor::can_drop_data_fw); ClassDB::bind_method("_drop_data_fw", &VisualScriptEditor::drop_data_fw); - ClassDB::bind_method("_input", &VisualScriptEditor::_input); - ClassDB::bind_method("_update_graph_connections", &VisualScriptEditor::_update_graph_connections); ClassDB::bind_method("_update_members", &VisualScriptEditor::_update_members); diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 0c4ea880c8..4fa8ffca67 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -234,7 +234,7 @@ class VisualScriptEditor : public ScriptEditorBase { void _generic_search(String p_base_type = "", Vector2 pos = Vector2(), bool node_centered = false); - void _input(const Ref<InputEvent> &p_event); + virtual void input(const Ref<InputEvent> &p_event) override; void _graph_gui_input(const Ref<InputEvent> &p_event); void _members_gui_input(const Ref<InputEvent> &p_event); void _fn_name_box_input(const Ref<InputEvent> &p_event); diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index bacb1947be..d8b88d6cd3 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -55,7 +55,7 @@ void VisualScriptPropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) { case KEY_DOWN: case KEY_PAGEUP: case KEY_PAGEDOWN: { - search_options->call("_gui_input", k); + search_options->gui_input(k); search_box->accept_event(); TreeItem *root = search_options->get_root(); |