You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
This commit is contained in:
@@ -389,19 +389,10 @@ void GroupDialog::edit() {
|
||||
}
|
||||
|
||||
void GroupDialog::_bind_methods() {
|
||||
ClassDB::bind_method("_add_pressed", &GroupDialog::_add_pressed);
|
||||
ClassDB::bind_method("_removed_pressed", &GroupDialog::_removed_pressed);
|
||||
ClassDB::bind_method("_delete_group_pressed", &GroupDialog::_delete_group_pressed);
|
||||
ClassDB::bind_method("_delete_group_item", &GroupDialog::_delete_group_item);
|
||||
|
||||
ClassDB::bind_method("_group_selected", &GroupDialog::_group_selected);
|
||||
ClassDB::bind_method("_add_group_pressed", &GroupDialog::_add_group_pressed);
|
||||
ClassDB::bind_method("_add_group", &GroupDialog::_add_group);
|
||||
|
||||
ClassDB::bind_method("_add_filter_changed", &GroupDialog::_add_filter_changed);
|
||||
ClassDB::bind_method("_remove_filter_changed", &GroupDialog::_remove_filter_changed);
|
||||
|
||||
ClassDB::bind_method("_group_renamed", &GroupDialog::_group_renamed);
|
||||
ClassDB::bind_method("_rename_group_item", &GroupDialog::_rename_group_item);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("group_edited"));
|
||||
@@ -436,9 +427,9 @@ GroupDialog::GroupDialog() {
|
||||
groups->set_allow_rmb_select(true);
|
||||
groups->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
groups->add_constant_override("draw_guides", 1);
|
||||
groups->connect_compat("item_selected", this, "_group_selected");
|
||||
groups->connect_compat("button_pressed", this, "_delete_group_pressed");
|
||||
groups->connect_compat("item_edited", this, "_group_renamed");
|
||||
groups->connect("item_selected", callable_mp(this, &GroupDialog::_group_selected));
|
||||
groups->connect("button_pressed", callable_mp(this, &GroupDialog::_delete_group_pressed));
|
||||
groups->connect("item_edited", callable_mp(this, &GroupDialog::_group_renamed));
|
||||
|
||||
HBoxContainer *chbc = memnew(HBoxContainer);
|
||||
vbc_left->add_child(chbc);
|
||||
@@ -447,12 +438,12 @@ GroupDialog::GroupDialog() {
|
||||
add_group_text = memnew(LineEdit);
|
||||
chbc->add_child(add_group_text);
|
||||
add_group_text->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
add_group_text->connect_compat("text_entered", this, "_add_group_pressed");
|
||||
add_group_text->connect("text_entered", callable_mp(this, &GroupDialog::_add_group_pressed));
|
||||
|
||||
Button *add_group_button = memnew(Button);
|
||||
add_group_button->set_text(TTR("Add"));
|
||||
chbc->add_child(add_group_button);
|
||||
add_group_button->connect_compat("pressed", this, "_add_group_pressed", varray(String()));
|
||||
add_group_button->connect("pressed", callable_mp(this, &GroupDialog::_add_group_pressed), varray(String()));
|
||||
|
||||
VBoxContainer *vbc_add = memnew(VBoxContainer);
|
||||
hbc->add_child(vbc_add);
|
||||
@@ -478,7 +469,7 @@ GroupDialog::GroupDialog() {
|
||||
add_filter->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
add_filter->set_placeholder(TTR("Filter nodes"));
|
||||
add_filter_hbc->add_child(add_filter);
|
||||
add_filter->connect_compat("text_changed", this, "_add_filter_changed");
|
||||
add_filter->connect("text_changed", callable_mp(this, &GroupDialog::_add_filter_changed));
|
||||
|
||||
VBoxContainer *vbc_buttons = memnew(VBoxContainer);
|
||||
hbc->add_child(vbc_buttons);
|
||||
@@ -487,7 +478,7 @@ GroupDialog::GroupDialog() {
|
||||
|
||||
add_button = memnew(ToolButton);
|
||||
add_button->set_text(TTR("Add"));
|
||||
add_button->connect_compat("pressed", this, "_add_pressed");
|
||||
add_button->connect("pressed", callable_mp(this, &GroupDialog::_add_pressed));
|
||||
|
||||
vbc_buttons->add_child(add_button);
|
||||
vbc_buttons->add_spacer();
|
||||
@@ -496,7 +487,7 @@ GroupDialog::GroupDialog() {
|
||||
|
||||
remove_button = memnew(ToolButton);
|
||||
remove_button->set_text(TTR("Remove"));
|
||||
remove_button->connect_compat("pressed", this, "_removed_pressed");
|
||||
remove_button->connect("pressed", callable_mp(this, &GroupDialog::_removed_pressed));
|
||||
|
||||
vbc_buttons->add_child(remove_button);
|
||||
|
||||
@@ -524,7 +515,7 @@ GroupDialog::GroupDialog() {
|
||||
remove_filter->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
remove_filter->set_placeholder(TTR("Filter nodes"));
|
||||
remove_filter_hbc->add_child(remove_filter);
|
||||
remove_filter->connect_compat("text_changed", this, "_remove_filter_changed");
|
||||
remove_filter->connect("text_changed", callable_mp(this, &GroupDialog::_remove_filter_changed));
|
||||
|
||||
group_empty = memnew(Label());
|
||||
group_empty->set_text(TTR("Empty groups will be automatically removed."));
|
||||
@@ -668,12 +659,6 @@ void GroupsEditor::_show_group_dialog() {
|
||||
}
|
||||
|
||||
void GroupsEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_add_group", &GroupsEditor::_add_group);
|
||||
ClassDB::bind_method("_remove_group", &GroupsEditor::_remove_group);
|
||||
ClassDB::bind_method("update_tree", &GroupsEditor::update_tree);
|
||||
|
||||
ClassDB::bind_method("_show_group_dialog", &GroupsEditor::_show_group_dialog);
|
||||
}
|
||||
|
||||
GroupsEditor::GroupsEditor() {
|
||||
@@ -685,12 +670,12 @@ GroupsEditor::GroupsEditor() {
|
||||
group_dialog = memnew(GroupDialog);
|
||||
group_dialog->set_as_toplevel(true);
|
||||
add_child(group_dialog);
|
||||
group_dialog->connect_compat("group_edited", this, "update_tree");
|
||||
group_dialog->connect("group_edited", callable_mp(this, &GroupsEditor::update_tree));
|
||||
|
||||
Button *group_dialog_button = memnew(Button);
|
||||
group_dialog_button->set_text(TTR("Manage Groups"));
|
||||
vbc->add_child(group_dialog_button);
|
||||
group_dialog_button->connect_compat("pressed", this, "_show_group_dialog");
|
||||
group_dialog_button->connect("pressed", callable_mp(this, &GroupsEditor::_show_group_dialog));
|
||||
|
||||
HBoxContainer *hbc = memnew(HBoxContainer);
|
||||
vbc->add_child(hbc);
|
||||
@@ -698,18 +683,18 @@ GroupsEditor::GroupsEditor() {
|
||||
group_name = memnew(LineEdit);
|
||||
group_name->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
hbc->add_child(group_name);
|
||||
group_name->connect_compat("text_entered", this, "_add_group");
|
||||
group_name->connect("text_entered", callable_mp(this, &GroupsEditor::_add_group));
|
||||
|
||||
add = memnew(Button);
|
||||
add->set_text(TTR("Add"));
|
||||
hbc->add_child(add);
|
||||
add->connect_compat("pressed", this, "_add_group", varray(String()));
|
||||
add->connect("pressed", callable_mp(this, &GroupsEditor::_add_group), varray(String()));
|
||||
|
||||
tree = memnew(Tree);
|
||||
tree->set_hide_root(true);
|
||||
tree->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
vbc->add_child(tree);
|
||||
tree->connect_compat("button_pressed", this, "_remove_group");
|
||||
tree->connect("button_pressed", callable_mp(this, &GroupsEditor::_remove_group));
|
||||
tree->add_constant_override("draw_guides", 1);
|
||||
add_constant_override("separation", 3 * EDSCALE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user