You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +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:
@@ -55,12 +55,12 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_changed() {
|
||||
void AnimationNodeBlendSpace2DEditor::edit(const Ref<AnimationNode> &p_node) {
|
||||
|
||||
if (blend_space.is_valid()) {
|
||||
blend_space->disconnect_compat("triangles_updated", this, "_blend_space_changed");
|
||||
blend_space->disconnect("triangles_updated", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_blend_space_changed));
|
||||
}
|
||||
blend_space = p_node;
|
||||
|
||||
if (!blend_space.is_null()) {
|
||||
blend_space->connect_compat("triangles_updated", this, "_blend_space_changed");
|
||||
blend_space->connect("triangles_updated", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_blend_space_changed));
|
||||
_update_space();
|
||||
}
|
||||
}
|
||||
@@ -825,30 +825,12 @@ void AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled() {
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_blend_space_gui_input", &AnimationNodeBlendSpace2DEditor::_blend_space_gui_input);
|
||||
ClassDB::bind_method("_blend_space_draw", &AnimationNodeBlendSpace2DEditor::_blend_space_draw);
|
||||
ClassDB::bind_method("_config_changed", &AnimationNodeBlendSpace2DEditor::_config_changed);
|
||||
ClassDB::bind_method("_labels_changed", &AnimationNodeBlendSpace2DEditor::_labels_changed);
|
||||
ClassDB::bind_method("_update_space", &AnimationNodeBlendSpace2DEditor::_update_space);
|
||||
ClassDB::bind_method("_snap_toggled", &AnimationNodeBlendSpace2DEditor::_snap_toggled);
|
||||
ClassDB::bind_method("_tool_switch", &AnimationNodeBlendSpace2DEditor::_tool_switch);
|
||||
ClassDB::bind_method("_erase_selected", &AnimationNodeBlendSpace2DEditor::_erase_selected);
|
||||
ClassDB::bind_method("_update_tool_erase", &AnimationNodeBlendSpace2DEditor::_update_tool_erase);
|
||||
ClassDB::bind_method("_edit_point_pos", &AnimationNodeBlendSpace2DEditor::_edit_point_pos);
|
||||
|
||||
ClassDB::bind_method("_add_menu_type", &AnimationNodeBlendSpace2DEditor::_add_menu_type);
|
||||
ClassDB::bind_method("_add_animation_type", &AnimationNodeBlendSpace2DEditor::_add_animation_type);
|
||||
|
||||
ClassDB::bind_method("_update_edited_point_pos", &AnimationNodeBlendSpace2DEditor::_update_edited_point_pos);
|
||||
|
||||
ClassDB::bind_method("_open_editor", &AnimationNodeBlendSpace2DEditor::_open_editor);
|
||||
|
||||
ClassDB::bind_method("_removed_from_graph", &AnimationNodeBlendSpace2DEditor::_removed_from_graph);
|
||||
|
||||
ClassDB::bind_method("_auto_triangles_toggled", &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled);
|
||||
ClassDB::bind_method("_blend_space_changed", &AnimationNodeBlendSpace2DEditor::_blend_space_changed);
|
||||
|
||||
ClassDB::bind_method("_file_opened", &AnimationNodeBlendSpace2DEditor::_file_opened);
|
||||
}
|
||||
|
||||
AnimationNodeBlendSpace2DEditor *AnimationNodeBlendSpace2DEditor::singleton = NULL;
|
||||
@@ -870,42 +852,42 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
top_hb->add_child(tool_blend);
|
||||
tool_blend->set_pressed(true);
|
||||
tool_blend->set_tooltip(TTR("Set the blending position within the space"));
|
||||
tool_blend->connect_compat("pressed", this, "_tool_switch", varray(3));
|
||||
tool_blend->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch), varray(3));
|
||||
|
||||
tool_select = memnew(ToolButton);
|
||||
tool_select->set_toggle_mode(true);
|
||||
tool_select->set_button_group(bg);
|
||||
top_hb->add_child(tool_select);
|
||||
tool_select->set_tooltip(TTR("Select and move points, create points with RMB."));
|
||||
tool_select->connect_compat("pressed", this, "_tool_switch", varray(0));
|
||||
tool_select->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch), varray(0));
|
||||
|
||||
tool_create = memnew(ToolButton);
|
||||
tool_create->set_toggle_mode(true);
|
||||
tool_create->set_button_group(bg);
|
||||
top_hb->add_child(tool_create);
|
||||
tool_create->set_tooltip(TTR("Create points."));
|
||||
tool_create->connect_compat("pressed", this, "_tool_switch", varray(1));
|
||||
tool_create->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch), varray(1));
|
||||
|
||||
tool_triangle = memnew(ToolButton);
|
||||
tool_triangle->set_toggle_mode(true);
|
||||
tool_triangle->set_button_group(bg);
|
||||
top_hb->add_child(tool_triangle);
|
||||
tool_triangle->set_tooltip(TTR("Create triangles by connecting points."));
|
||||
tool_triangle->connect_compat("pressed", this, "_tool_switch", varray(2));
|
||||
tool_triangle->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch), varray(2));
|
||||
|
||||
tool_erase_sep = memnew(VSeparator);
|
||||
top_hb->add_child(tool_erase_sep);
|
||||
tool_erase = memnew(ToolButton);
|
||||
top_hb->add_child(tool_erase);
|
||||
tool_erase->set_tooltip(TTR("Erase points and triangles."));
|
||||
tool_erase->connect_compat("pressed", this, "_erase_selected");
|
||||
tool_erase->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_erase_selected));
|
||||
tool_erase->set_disabled(true);
|
||||
|
||||
top_hb->add_child(memnew(VSeparator));
|
||||
|
||||
auto_triangles = memnew(ToolButton);
|
||||
top_hb->add_child(auto_triangles);
|
||||
auto_triangles->connect_compat("pressed", this, "_auto_triangles_toggled");
|
||||
auto_triangles->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled));
|
||||
auto_triangles->set_toggle_mode(true);
|
||||
auto_triangles->set_tooltip(TTR("Generate blend triangles automatically (instead of manually)"));
|
||||
|
||||
@@ -916,7 +898,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
top_hb->add_child(snap);
|
||||
snap->set_pressed(true);
|
||||
snap->set_tooltip(TTR("Enable snap and show grid."));
|
||||
snap->connect_compat("pressed", this, "_snap_toggled");
|
||||
snap->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_snap_toggled));
|
||||
|
||||
snap_x = memnew(SpinBox);
|
||||
top_hb->add_child(snap_x);
|
||||
@@ -937,7 +919,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
top_hb->add_child(memnew(Label(TTR("Blend:"))));
|
||||
interpolation = memnew(OptionButton);
|
||||
top_hb->add_child(interpolation);
|
||||
interpolation->connect_compat("item_selected", this, "_config_changed");
|
||||
interpolation->connect("item_selected", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
|
||||
edit_hb = memnew(HBoxContainer);
|
||||
top_hb->add_child(edit_hb);
|
||||
@@ -948,17 +930,17 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
edit_x->set_min(-1000);
|
||||
edit_x->set_step(0.01);
|
||||
edit_x->set_max(1000);
|
||||
edit_x->connect_compat("value_changed", this, "_edit_point_pos");
|
||||
edit_x->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_edit_point_pos));
|
||||
edit_y = memnew(SpinBox);
|
||||
edit_hb->add_child(edit_y);
|
||||
edit_y->set_min(-1000);
|
||||
edit_y->set_step(0.01);
|
||||
edit_y->set_max(1000);
|
||||
edit_y->connect_compat("value_changed", this, "_edit_point_pos");
|
||||
edit_y->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_edit_point_pos));
|
||||
open_editor = memnew(Button);
|
||||
edit_hb->add_child(open_editor);
|
||||
open_editor->set_text(TTR("Open Editor"));
|
||||
open_editor->connect_compat("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED);
|
||||
open_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_open_editor), varray(), CONNECT_DEFERRED);
|
||||
edit_hb->hide();
|
||||
open_editor->hide();
|
||||
|
||||
@@ -999,8 +981,8 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
panel->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
|
||||
blend_space_draw = memnew(Control);
|
||||
blend_space_draw->connect_compat("gui_input", this, "_blend_space_gui_input");
|
||||
blend_space_draw->connect_compat("draw", this, "_blend_space_draw");
|
||||
blend_space_draw->connect("gui_input", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_blend_space_gui_input));
|
||||
blend_space_draw->connect("draw", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_blend_space_draw));
|
||||
blend_space_draw->set_focus_mode(FOCUS_ALL);
|
||||
|
||||
panel->add_child(blend_space_draw);
|
||||
@@ -1029,14 +1011,14 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
min_x_value->set_step(0.01);
|
||||
}
|
||||
|
||||
snap_x->connect_compat("value_changed", this, "_config_changed");
|
||||
snap_y->connect_compat("value_changed", this, "_config_changed");
|
||||
max_x_value->connect_compat("value_changed", this, "_config_changed");
|
||||
min_x_value->connect_compat("value_changed", this, "_config_changed");
|
||||
max_y_value->connect_compat("value_changed", this, "_config_changed");
|
||||
min_y_value->connect_compat("value_changed", this, "_config_changed");
|
||||
label_x->connect_compat("text_changed", this, "_labels_changed");
|
||||
label_y->connect_compat("text_changed", this, "_labels_changed");
|
||||
snap_x->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
snap_y->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
max_x_value->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
min_x_value->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
max_y_value->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
min_y_value->connect("value_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed));
|
||||
label_x->connect("text_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_labels_changed));
|
||||
label_y->connect("text_changed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_labels_changed));
|
||||
|
||||
error_panel = memnew(PanelContainer);
|
||||
add_child(error_panel);
|
||||
@@ -1050,18 +1032,18 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
||||
|
||||
menu = memnew(PopupMenu);
|
||||
add_child(menu);
|
||||
menu->connect_compat("id_pressed", this, "_add_menu_type");
|
||||
menu->connect("id_pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_add_menu_type));
|
||||
|
||||
animations_menu = memnew(PopupMenu);
|
||||
menu->add_child(animations_menu);
|
||||
animations_menu->set_name("animations");
|
||||
animations_menu->connect_compat("index_pressed", this, "_add_animation_type");
|
||||
animations_menu->connect("index_pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_add_animation_type));
|
||||
|
||||
open_file = memnew(EditorFileDialog);
|
||||
add_child(open_file);
|
||||
open_file->set_title(TTR("Open Animation Node"));
|
||||
open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
|
||||
open_file->connect_compat("file_selected", this, "_file_opened");
|
||||
open_file->connect("file_selected", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_file_opened));
|
||||
undo_redo = EditorNode::get_undo_redo();
|
||||
|
||||
selected_point = -1;
|
||||
|
||||
Reference in New Issue
Block a user