You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -121,6 +121,10 @@ void EditorDirDialog::_item_collapsed(Object *p_item) {
|
||||
opened_paths.insert(item->get_metadata(0));
|
||||
}
|
||||
|
||||
void EditorDirDialog::_item_activated() {
|
||||
_ok_pressed(); // From AcceptDialog.
|
||||
}
|
||||
|
||||
void EditorDirDialog::ok_pressed() {
|
||||
|
||||
TreeItem *ti = tree->get_selected();
|
||||
@@ -182,7 +186,7 @@ EditorDirDialog::EditorDirDialog() {
|
||||
tree = memnew(Tree);
|
||||
add_child(tree);
|
||||
|
||||
tree->connect_compat("item_activated", this, "_ok");
|
||||
tree->connect("item_activated", callable_mp(this, &EditorDirDialog::_item_activated));
|
||||
|
||||
makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir");
|
||||
makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir));
|
||||
|
||||
Reference in New Issue
Block a user