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:
Rémi Verschelde
2020-02-21 18:28:45 +01:00
parent a439131c2b
commit 01afc442c7
164 changed files with 1795 additions and 3293 deletions

View File

@ -87,17 +87,14 @@ void EditorPropertyText::set_placeholder(const String &p_string) {
}
void EditorPropertyText::_bind_methods() {
ClassDB::bind_method(D_METHOD("_text_changed", "txt"), &EditorPropertyText::_text_changed);
ClassDB::bind_method(D_METHOD("_text_entered", "txt"), &EditorPropertyText::_text_entered);
}
EditorPropertyText::EditorPropertyText() {
text = memnew(LineEdit);
add_child(text);
add_focusable(text);
text->connect_compat("text_changed", this, "_text_changed");
text->connect_compat("text_entered", this, "_text_entered");
text->connect("text_changed", callable_mp(this, &EditorPropertyText::_text_changed));
text->connect("text_entered", callable_mp(this, &EditorPropertyText::_text_entered));
string_name = false;
updating = false;
@ -118,7 +115,7 @@ void EditorPropertyMultilineText::_open_big_text() {
if (!big_text_dialog) {
big_text = memnew(TextEdit);
big_text->connect_compat("text_changed", this, "_big_text_changed");
big_text->connect("text_changed", callable_mp(this, &EditorPropertyMultilineText::_big_text_changed));
big_text->set_wrap_enabled(true);
big_text_dialog = memnew(AcceptDialog);
big_text_dialog->add_child(big_text);
@ -153,10 +150,6 @@ void EditorPropertyMultilineText::_notification(int p_what) {
}
void EditorPropertyMultilineText::_bind_methods() {
ClassDB::bind_method(D_METHOD("_text_changed"), &EditorPropertyMultilineText::_text_changed);
ClassDB::bind_method(D_METHOD("_big_text_changed"), &EditorPropertyMultilineText::_big_text_changed);
ClassDB::bind_method(D_METHOD("_open_big_text"), &EditorPropertyMultilineText::_open_big_text);
}
EditorPropertyMultilineText::EditorPropertyMultilineText() {
@ -164,13 +157,13 @@ EditorPropertyMultilineText::EditorPropertyMultilineText() {
add_child(hb);
set_bottom_editor(hb);
text = memnew(TextEdit);
text->connect_compat("text_changed", this, "_text_changed");
text->connect("text_changed", callable_mp(this, &EditorPropertyMultilineText::_text_changed));
text->set_wrap_enabled(true);
add_focusable(text);
hb->add_child(text);
text->set_h_size_flags(SIZE_EXPAND_FILL);
open_big_text = memnew(ToolButton);
open_big_text->connect_compat("pressed", this, "_open_big_text");
open_big_text->connect("pressed", callable_mp(this, &EditorPropertyMultilineText::_open_big_text));
hb->add_child(open_big_text);
big_text_dialog = NULL;
big_text = NULL;
@ -208,8 +201,6 @@ void EditorPropertyTextEnum::setup(const Vector<String> &p_options, bool p_strin
}
void EditorPropertyTextEnum::_bind_methods() {
ClassDB::bind_method(D_METHOD("_option_selected"), &EditorPropertyTextEnum::_option_selected);
}
EditorPropertyTextEnum::EditorPropertyTextEnum() {
@ -220,7 +211,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
add_child(options);
add_focusable(options);
options->connect_compat("item_selected", this, "_option_selected");
options->connect("item_selected", callable_mp(this, &EditorPropertyTextEnum::_option_selected));
}
///////////////////// PATH /////////////////////////
@ -233,8 +224,8 @@ void EditorPropertyPath::_path_pressed() {
if (!dialog) {
dialog = memnew(EditorFileDialog);
dialog->connect_compat("file_selected", this, "_path_selected");
dialog->connect_compat("dir_selected", this, "_path_selected");
dialog->connect("file_selected", callable_mp(this, &EditorPropertyPath::_path_selected));
dialog->connect("dir_selected", callable_mp(this, &EditorPropertyPath::_path_selected));
add_child(dialog);
}
@ -297,10 +288,6 @@ void EditorPropertyPath::_path_focus_exited() {
}
void EditorPropertyPath::_bind_methods() {
ClassDB::bind_method(D_METHOD("_path_pressed"), &EditorPropertyPath::_path_pressed);
ClassDB::bind_method(D_METHOD("_path_selected"), &EditorPropertyPath::_path_selected);
ClassDB::bind_method(D_METHOD("_path_focus_exited"), &EditorPropertyPath::_path_focus_exited);
}
EditorPropertyPath::EditorPropertyPath() {
@ -308,8 +295,8 @@ EditorPropertyPath::EditorPropertyPath() {
add_child(path_hb);
path = memnew(LineEdit);
path_hb->add_child(path);
path->connect_compat("text_entered", this, "_path_selected");
path->connect_compat("focus_exited", this, "_path_focus_exited");
path->connect("text_entered", callable_mp(this, &EditorPropertyPath::_path_selected));
path->connect("focus_exited", callable_mp(this, &EditorPropertyPath::_path_focus_exited));
path->set_h_size_flags(SIZE_EXPAND_FILL);
path_edit = memnew(Button);
@ -317,7 +304,7 @@ EditorPropertyPath::EditorPropertyPath() {
path_hb->add_child(path_edit);
add_focusable(path);
dialog = NULL;
path_edit->connect_compat("pressed", this, "_path_pressed");
path_edit->connect("pressed", callable_mp(this, &EditorPropertyPath::_path_pressed));
folder = false;
global = false;
save_mode = false;
@ -351,8 +338,6 @@ void EditorPropertyClassName::_dialog_created() {
}
void EditorPropertyClassName::_bind_methods() {
ClassDB::bind_method(D_METHOD("_dialog_created"), &EditorPropertyClassName::_dialog_created);
ClassDB::bind_method(D_METHOD("_property_selected"), &EditorPropertyClassName::_property_selected);
}
EditorPropertyClassName::EditorPropertyClassName() {
@ -361,10 +346,10 @@ EditorPropertyClassName::EditorPropertyClassName() {
add_child(property);
add_focusable(property);
property->set_text(selected_type);
property->connect_compat("pressed", this, "_property_selected");
property->connect("pressed", callable_mp(this, &EditorPropertyClassName::_property_selected));
dialog = memnew(CreateDialog);
dialog->set_base_type(base_type);
dialog->connect_compat("create", this, "_dialog_created");
dialog->connect("create", callable_mp(this, &EditorPropertyClassName::_dialog_created));
add_child(dialog);
}
@ -380,7 +365,7 @@ void EditorPropertyMember::_property_select() {
if (!selector) {
selector = memnew(PropertySelector);
selector->connect_compat("selected", this, "_property_selected");
selector->connect("selected", callable_mp(this, &EditorPropertyMember::_property_selected));
add_child(selector);
}
@ -460,8 +445,6 @@ void EditorPropertyMember::update_property() {
}
void EditorPropertyMember::_bind_methods() {
ClassDB::bind_method(D_METHOD("_property_selected"), &EditorPropertyMember::_property_selected);
ClassDB::bind_method(D_METHOD("_property_select"), &EditorPropertyMember::_property_select);
}
EditorPropertyMember::EditorPropertyMember() {
@ -470,7 +453,7 @@ EditorPropertyMember::EditorPropertyMember() {
property->set_clip_text(true);
add_child(property);
add_focusable(property);
property->connect_compat("pressed", this, "_property_select");
property->connect("pressed", callable_mp(this, &EditorPropertyMember::_property_select));
}
///////////////////// CHECK /////////////////////////
@ -486,8 +469,6 @@ void EditorPropertyCheck::update_property() {
}
void EditorPropertyCheck::_bind_methods() {
ClassDB::bind_method(D_METHOD("_checkbox_pressed"), &EditorPropertyCheck::_checkbox_pressed);
}
EditorPropertyCheck::EditorPropertyCheck() {
@ -495,7 +476,7 @@ EditorPropertyCheck::EditorPropertyCheck() {
checkbox->set_text(TTR("On"));
add_child(checkbox);
add_focusable(checkbox);
checkbox->connect_compat("pressed", this, "_checkbox_pressed");
checkbox->connect("pressed", callable_mp(this, &EditorPropertyCheck::_checkbox_pressed));
}
///////////////////// ENUM /////////////////////////
@ -536,8 +517,6 @@ void EditorPropertyEnum::set_option_button_clip(bool p_enable) {
}
void EditorPropertyEnum::_bind_methods() {
ClassDB::bind_method(D_METHOD("_option_selected"), &EditorPropertyEnum::_option_selected);
}
EditorPropertyEnum::EditorPropertyEnum() {
@ -546,7 +525,7 @@ EditorPropertyEnum::EditorPropertyEnum() {
options->set_flat(true);
add_child(options);
add_focusable(options);
options->connect_compat("item_selected", this, "_option_selected");
options->connect("item_selected", callable_mp(this, &EditorPropertyEnum::_option_selected));
}
///////////////////// FLAGS /////////////////////////
@ -591,7 +570,7 @@ void EditorPropertyFlags::setup(const Vector<String> &p_options) {
CheckBox *cb = memnew(CheckBox);
cb->set_text(option);
cb->set_clip_text(true);
cb->connect_compat("pressed", this, "_flag_toggled");
cb->connect("pressed", callable_mp(this, &EditorPropertyFlags::_flag_toggled));
add_focusable(cb);
vbox->add_child(cb);
flags.push_back(cb);
@ -605,8 +584,6 @@ void EditorPropertyFlags::setup(const Vector<String> &p_options) {
}
void EditorPropertyFlags::_bind_methods() {
ClassDB::bind_method(D_METHOD("_flag_toggled"), &EditorPropertyFlags::_flag_toggled);
}
EditorPropertyFlags::EditorPropertyFlags() {
@ -791,10 +768,6 @@ void EditorPropertyLayers::_menu_pressed(int p_menu) {
}
void EditorPropertyLayers::_bind_methods() {
ClassDB::bind_method(D_METHOD("_grid_changed"), &EditorPropertyLayers::_grid_changed);
ClassDB::bind_method(D_METHOD("_button_pressed"), &EditorPropertyLayers::_button_pressed);
ClassDB::bind_method(D_METHOD("_menu_pressed"), &EditorPropertyLayers::_menu_pressed);
}
EditorPropertyLayers::EditorPropertyLayers() {
@ -802,19 +775,19 @@ EditorPropertyLayers::EditorPropertyLayers() {
HBoxContainer *hb = memnew(HBoxContainer);
add_child(hb);
grid = memnew(EditorPropertyLayersGrid);
grid->connect_compat("flag_changed", this, "_grid_changed");
grid->connect("flag_changed", callable_mp(this, &EditorPropertyLayers::_grid_changed));
grid->set_h_size_flags(SIZE_EXPAND_FILL);
hb->add_child(grid);
button = memnew(Button);
button->set_toggle_mode(true);
button->set_text("..");
button->connect_compat("pressed", this, "_button_pressed");
button->connect("pressed", callable_mp(this, &EditorPropertyLayers::_button_pressed));
hb->add_child(button);
set_bottom_editor(hb);
layers = memnew(PopupMenu);
add_child(layers);
layers->set_hide_on_checkable_item_selection(false);
layers->connect_compat("id_pressed", this, "_menu_pressed");
layers->connect("id_pressed", callable_mp(this, &EditorPropertyLayers::_menu_pressed));
layers->connect_compat("popup_hide", button, "set_pressed", varray(false));
}
@ -840,7 +813,6 @@ void EditorPropertyInteger::update_property() {
}
void EditorPropertyInteger::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyInteger::_value_changed);
}
void EditorPropertyInteger::setup(int64_t p_min, int64_t p_max, int64_t p_step, bool p_allow_greater, bool p_allow_lesser) {
@ -856,7 +828,7 @@ EditorPropertyInteger::EditorPropertyInteger() {
spin->set_flat(true);
add_child(spin);
add_focusable(spin);
spin->connect_compat("value_changed", this, "_value_changed");
spin->connect("value_changed", callable_mp(this, &EditorPropertyInteger::_value_changed));
setting = false;
}
@ -889,14 +861,13 @@ void EditorPropertyObjectID::setup(const String &p_base_type) {
}
void EditorPropertyObjectID::_bind_methods() {
ClassDB::bind_method(D_METHOD("_edit_pressed"), &EditorPropertyObjectID::_edit_pressed);
}
EditorPropertyObjectID::EditorPropertyObjectID() {
edit = memnew(Button);
add_child(edit);
add_focusable(edit);
edit->connect_compat("pressed", this, "_edit_pressed");
edit->connect("pressed", callable_mp(this, &EditorPropertyObjectID::_edit_pressed));
}
///////////////////// FLOAT /////////////////////////
@ -916,8 +887,6 @@ void EditorPropertyFloat::update_property() {
}
void EditorPropertyFloat::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyFloat::_value_changed);
}
void EditorPropertyFloat::setup(double p_min, double p_max, double p_step, bool p_no_slider, bool p_exp_range, bool p_greater, bool p_lesser) {
@ -936,7 +905,7 @@ EditorPropertyFloat::EditorPropertyFloat() {
spin->set_flat(true);
add_child(spin);
add_focusable(spin);
spin->connect_compat("value_changed", this, "_value_changed");
spin->connect("value_changed", callable_mp(this, &EditorPropertyFloat::_value_changed));
setting = false;
}
@ -1103,26 +1072,19 @@ void EditorPropertyEasing::_notification(int p_what) {
}
void EditorPropertyEasing::_bind_methods() {
ClassDB::bind_method("_draw_easing", &EditorPropertyEasing::_draw_easing);
ClassDB::bind_method("_drag_easing", &EditorPropertyEasing::_drag_easing);
ClassDB::bind_method("_set_preset", &EditorPropertyEasing::_set_preset);
ClassDB::bind_method("_spin_value_changed", &EditorPropertyEasing::_spin_value_changed);
ClassDB::bind_method("_spin_focus_exited", &EditorPropertyEasing::_spin_focus_exited);
}
EditorPropertyEasing::EditorPropertyEasing() {
easing_draw = memnew(Control);
easing_draw->connect_compat("draw", this, "_draw_easing");
easing_draw->connect_compat("gui_input", this, "_drag_easing");
easing_draw->connect("draw", callable_mp(this, &EditorPropertyEasing::_draw_easing));
easing_draw->connect("gui_input", callable_mp(this, &EditorPropertyEasing::_drag_easing));
easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE);
add_child(easing_draw);
preset = memnew(PopupMenu);
add_child(preset);
preset->connect_compat("id_pressed", this, "_set_preset");
preset->connect("id_pressed", callable_mp(this, &EditorPropertyEasing::_set_preset));
spin = memnew(EditorSpinSlider);
spin->set_flat(true);
@ -1132,8 +1094,8 @@ EditorPropertyEasing::EditorPropertyEasing() {
spin->set_hide_slider(true);
spin->set_allow_lesser(true);
spin->set_allow_greater(true);
spin->connect_compat("value_changed", this, "_spin_value_changed");
spin->get_line_edit()->connect_compat("focus_exited", this, "_spin_focus_exited");
spin->connect("value_changed", callable_mp(this, &EditorPropertyEasing::_spin_value_changed));
spin->get_line_edit()->connect("focus_exited", callable_mp(this, &EditorPropertyEasing::_spin_focus_exited));
spin->hide();
add_child(spin);
@ -1175,8 +1137,6 @@ void EditorPropertyVector2::_notification(int p_what) {
}
void EditorPropertyVector2::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyVector2::_value_changed);
}
void EditorPropertyVector2::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1211,7 +1171,7 @@ EditorPropertyVector2::EditorPropertyVector2() {
spin[i]->set_label(desc[i]);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyVector2::_value_changed), varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
@ -1258,8 +1218,6 @@ void EditorPropertyRect2::_notification(int p_what) {
}
}
void EditorPropertyRect2::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyRect2::_value_changed);
}
void EditorPropertyRect2::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1295,7 +1253,7 @@ EditorPropertyRect2::EditorPropertyRect2() {
spin[i]->set_flat(true);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyRect2::_value_changed), varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
@ -1340,8 +1298,6 @@ void EditorPropertyVector3::_notification(int p_what) {
}
}
void EditorPropertyVector3::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyVector3::_value_changed);
}
void EditorPropertyVector3::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1376,7 +1332,7 @@ EditorPropertyVector3::EditorPropertyVector3() {
spin[i]->set_label(desc[i]);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyVector3::_value_changed), varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
@ -1422,8 +1378,6 @@ void EditorPropertyPlane::_notification(int p_what) {
}
}
void EditorPropertyPlane::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyPlane::_value_changed);
}
void EditorPropertyPlane::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1459,7 +1413,7 @@ EditorPropertyPlane::EditorPropertyPlane() {
spin[i]->set_label(desc[i]);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyPlane::_value_changed), varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
@ -1506,8 +1460,6 @@ void EditorPropertyQuat::_notification(int p_what) {
}
}
void EditorPropertyQuat::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyQuat::_value_changed);
}
void EditorPropertyQuat::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1542,7 +1494,7 @@ EditorPropertyQuat::EditorPropertyQuat() {
spin[i]->set_label(desc[i]);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyQuat::_value_changed), varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
@ -1595,8 +1547,6 @@ void EditorPropertyAABB::_notification(int p_what) {
}
}
void EditorPropertyAABB::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyAABB::_value_changed);
}
void EditorPropertyAABB::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1624,7 +1574,7 @@ EditorPropertyAABB::EditorPropertyAABB() {
g->add_child(spin[i]);
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyAABB::_value_changed), varray(desc[i]));
}
set_bottom_editor(g);
setting = false;
@ -1671,8 +1621,6 @@ void EditorPropertyTransform2D::_notification(int p_what) {
}
}
void EditorPropertyTransform2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyTransform2D::_value_changed);
}
void EditorPropertyTransform2D::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1699,7 +1647,7 @@ EditorPropertyTransform2D::EditorPropertyTransform2D() {
g->add_child(spin[i]);
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform2D::_value_changed), varray(desc[i]));
}
set_bottom_editor(g);
setting = false;
@ -1752,8 +1700,6 @@ void EditorPropertyBasis::_notification(int p_what) {
}
}
void EditorPropertyBasis::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyBasis::_value_changed);
}
void EditorPropertyBasis::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1780,7 +1726,7 @@ EditorPropertyBasis::EditorPropertyBasis() {
g->add_child(spin[i]);
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyBasis::_value_changed), varray(desc[i]));
}
set_bottom_editor(g);
setting = false;
@ -1839,8 +1785,6 @@ void EditorPropertyTransform::_notification(int p_what) {
}
}
void EditorPropertyTransform::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyTransform::_value_changed);
}
void EditorPropertyTransform::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
@ -1867,7 +1811,7 @@ EditorPropertyTransform::EditorPropertyTransform() {
g->add_child(spin[i]);
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
add_focusable(spin[i]);
spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i]));
spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform::_value_changed), varray(desc[i]));
}
set_bottom_editor(g);
setting = false;
@ -1895,10 +1839,6 @@ void EditorPropertyColor::_picker_created() {
}
void EditorPropertyColor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_color_changed"), &EditorPropertyColor::_color_changed);
ClassDB::bind_method(D_METHOD("_popup_closed"), &EditorPropertyColor::_popup_closed);
ClassDB::bind_method(D_METHOD("_picker_created"), &EditorPropertyColor::_picker_created);
}
void EditorPropertyColor::update_property() {
@ -1932,9 +1872,9 @@ EditorPropertyColor::EditorPropertyColor() {
picker = memnew(ColorPickerButton);
add_child(picker);
picker->set_flat(true);
picker->connect_compat("color_changed", this, "_color_changed");
picker->connect_compat("popup_closed", this, "_popup_closed");
picker->connect_compat("picker_created", this, "_picker_created");
picker->connect("color_changed", callable_mp(this, &EditorPropertyColor::_color_changed));
picker->connect("popup_closed", callable_mp(this, &EditorPropertyColor::_popup_closed));
picker->connect("picker_created", callable_mp(this, &EditorPropertyColor::_picker_created));
}
////////////// NODE PATH //////////////////////
@ -1981,7 +1921,7 @@ void EditorPropertyNodePath::_node_assign() {
scene_tree->get_scene_tree()->set_show_enabled_subscene(true);
scene_tree->get_scene_tree()->set_valid_types(valid_types);
add_child(scene_tree);
scene_tree->connect_compat("selected", this, "_node_selected");
scene_tree->connect("selected", callable_mp(this, &EditorPropertyNodePath::_node_selected));
}
scene_tree->popup_centered_ratio();
}
@ -2049,10 +1989,6 @@ void EditorPropertyNodePath::_notification(int p_what) {
}
void EditorPropertyNodePath::_bind_methods() {
ClassDB::bind_method(D_METHOD("_node_selected"), &EditorPropertyNodePath::_node_selected);
ClassDB::bind_method(D_METHOD("_node_assign"), &EditorPropertyNodePath::_node_assign);
ClassDB::bind_method(D_METHOD("_node_clear"), &EditorPropertyNodePath::_node_clear);
}
EditorPropertyNodePath::EditorPropertyNodePath() {
@ -2063,12 +1999,12 @@ EditorPropertyNodePath::EditorPropertyNodePath() {
assign->set_flat(true);
assign->set_h_size_flags(SIZE_EXPAND_FILL);
assign->set_clip_text(true);
assign->connect_compat("pressed", this, "_node_assign");
assign->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_assign));
hbc->add_child(assign);
clear = memnew(Button);
clear->set_flat(true);
clear->connect_compat("pressed", this, "_node_clear");
clear->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_clear));
hbc->add_child(clear);
use_path_from_scene_root = false;
@ -2135,7 +2071,7 @@ void EditorPropertyResource::_menu_option(int p_which) {
if (!file) {
file = memnew(EditorFileDialog);
file->connect_compat("file_selected", this, "_file_selected");
file->connect("file_selected", callable_mp(this, &EditorPropertyResource::_file_selected));
add_child(file);
}
file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
@ -2304,7 +2240,7 @@ void EditorPropertyResource::_menu_option(int p_which) {
scene_tree->get_scene_tree()->set_valid_types(valid_types);
scene_tree->get_scene_tree()->set_show_enabled_subscene(true);
add_child(scene_tree);
scene_tree->connect_compat("selected", this, "_viewport_selected");
scene_tree->connect("selected", callable_mp(this, &EditorPropertyResource::_viewport_selected));
scene_tree->set_title(TTR("Pick a Viewport"));
}
scene_tree->popup_centered_ratio();
@ -2622,9 +2558,9 @@ void EditorPropertyResource::update_property() {
sub_inspector->set_sub_inspector(true);
sub_inspector->set_enable_capitalize_paths(true);
sub_inspector->connect_compat("property_keyed", this, "_sub_inspector_property_keyed");
sub_inspector->connect_compat("resource_selected", this, "_sub_inspector_resource_selected");
sub_inspector->connect_compat("object_id_selected", this, "_sub_inspector_object_id_selected");
sub_inspector->connect("property_keyed", callable_mp(this, &EditorPropertyResource::_sub_inspector_property_keyed));
sub_inspector->connect("resource_selected", callable_mp(this, &EditorPropertyResource::_sub_inspector_resource_selected));
sub_inspector->connect("object_id_selected", callable_mp(this, &EditorPropertyResource::_sub_inspector_object_id_selected));
sub_inspector->set_keying(is_keying());
sub_inspector->set_read_only(is_read_only());
sub_inspector->set_use_folding(is_using_folding());
@ -2876,21 +2812,11 @@ void EditorPropertyResource::set_use_sub_inspector(bool p_enable) {
void EditorPropertyResource::_bind_methods() {
ClassDB::bind_method(D_METHOD("_file_selected"), &EditorPropertyResource::_file_selected);
ClassDB::bind_method(D_METHOD("_menu_option"), &EditorPropertyResource::_menu_option);
ClassDB::bind_method(D_METHOD("_update_menu"), &EditorPropertyResource::_update_menu);
ClassDB::bind_method(D_METHOD("_resource_preview"), &EditorPropertyResource::_resource_preview);
ClassDB::bind_method(D_METHOD("_resource_selected"), &EditorPropertyResource::_resource_selected);
ClassDB::bind_method(D_METHOD("_viewport_selected"), &EditorPropertyResource::_viewport_selected);
ClassDB::bind_method(D_METHOD("_sub_inspector_property_keyed"), &EditorPropertyResource::_sub_inspector_property_keyed);
ClassDB::bind_method(D_METHOD("_sub_inspector_resource_selected"), &EditorPropertyResource::_sub_inspector_resource_selected);
ClassDB::bind_method(D_METHOD("_sub_inspector_object_id_selected"), &EditorPropertyResource::_sub_inspector_object_id_selected);
ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &EditorPropertyResource::get_drag_data_fw);
ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &EditorPropertyResource::can_drop_data_fw);
ClassDB::bind_method(D_METHOD("drop_data_fw"), &EditorPropertyResource::drop_data_fw);
ClassDB::bind_method(D_METHOD("_button_draw"), &EditorPropertyResource::_button_draw);
ClassDB::bind_method(D_METHOD("_open_editor_pressed"), &EditorPropertyResource::_open_editor_pressed);
ClassDB::bind_method(D_METHOD("_button_input"), &EditorPropertyResource::_button_input);
ClassDB::bind_method(D_METHOD("_fold_other_editors"), &EditorPropertyResource::_fold_other_editors);
}
@ -2907,9 +2833,9 @@ EditorPropertyResource::EditorPropertyResource() {
assign->set_flat(true);
assign->set_h_size_flags(SIZE_EXPAND_FILL);
assign->set_clip_text(true);
assign->connect_compat("pressed", this, "_resource_selected");
assign->connect("pressed", callable_mp(this, &EditorPropertyResource::_resource_selected));
assign->set_drag_forwarding(this);
assign->connect_compat("draw", this, "_button_draw");
assign->connect("draw", callable_mp(this, &EditorPropertyResource::_button_draw));
hbc->add_child(assign);
add_focusable(assign);
@ -2920,18 +2846,18 @@ EditorPropertyResource::EditorPropertyResource() {
preview->set_margin(MARGIN_BOTTOM, -1);
preview->set_margin(MARGIN_RIGHT, -1);
assign->add_child(preview);
assign->connect_compat("gui_input", this, "_button_input");
assign->connect("gui_input", callable_mp(this, &EditorPropertyResource::_button_input));
menu = memnew(PopupMenu);
add_child(menu);
edit = memnew(Button);
edit->set_flat(true);
edit->set_toggle_mode(true);
menu->connect_compat("id_pressed", this, "_menu_option");
menu->connect("id_pressed", callable_mp(this, &EditorPropertyResource::_menu_option));
menu->connect_compat("popup_hide", edit, "set_pressed", varray(false));
edit->connect_compat("pressed", this, "_update_menu");
edit->connect("pressed", callable_mp(this, &EditorPropertyResource::_update_menu));
hbc->add_child(edit);
edit->connect_compat("gui_input", this, "_button_input");
edit->connect("gui_input", callable_mp(this, &EditorPropertyResource::_button_input));
add_focusable(edit);
file = NULL;