1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Signals: Port more uses of connect_compat

Those were problematic as they call a method of their parent class,
but callable_mp does not allow that unless it's public.

To solve it, we declare a local class that calls the parent class'
method, which now needs to be protected to be accessible in the
derived class.
This commit is contained in:
Rémi Verschelde
2020-02-27 22:49:16 +01:00
parent b8f08b42e7
commit 09a6a2d8f8
19 changed files with 79 additions and 41 deletions

View File

@@ -131,6 +131,10 @@ void EditorSubScene::_item_multi_selected(Object *p_object, int p_cell, bool p_s
}
}
void EditorSubScene::_item_activated() {
_ok_pressed(); // From AcceptDialog.
}
void EditorSubScene::_remove_selection_child(Node *p_node) {
if (p_node->get_child_count() > 0) {
for (int i = 0; i < p_node->get_child_count(); i++) {
@@ -251,7 +255,7 @@ EditorSubScene::EditorSubScene() {
//tree->connect("nothing_selected", this, "_deselect_items");
tree->connect("cell_selected", callable_mp(this, &EditorSubScene::_selected_changed));
tree->connect_compat("item_activated", this, "_ok", make_binds(), CONNECT_DEFERRED);
tree->connect("item_activated", callable_mp(this, &EditorSubScene::_item_activated), make_binds(), CONNECT_DEFERRED);
file_dialog = memnew(EditorFileDialog);
List<String> extensions;