diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-28 17:19:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 17:19:08 +0100 |
commit | 324e5a60dd068cbbff9c433802f8ecb78cff3364 (patch) | |
tree | 41edf077bcafa3c959a417aa4700318d483ff680 /editor/animation_track_editor.cpp | |
parent | a439131c2b06b3d452e5be13530b6d2caa72c1aa (diff) | |
parent | 32ccf306f9a820e2ac5811de7c12e99a736fdf05 (diff) |
Merge pull request #36426 from akien-mga/calling-all-stations
Signals: Port connect calls to use callable_mp
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 163 |
1 files changed, 62 insertions, 101 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 8758fbcfc9..095dbd6849 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1697,7 +1697,7 @@ void AnimationTimelineEdit::set_undo_redo(UndoRedo *p_undo_redo) { void AnimationTimelineEdit::set_zoom(Range *p_zoom) { zoom = p_zoom; - zoom->connect_compat("value_changed", this, "_zoom_changed"); + zoom->connect("value_changed", callable_mp(this, &AnimationTimelineEdit::_zoom_changed)); } void AnimationTimelineEdit::set_play_position(float p_pos) { @@ -1845,12 +1845,7 @@ void AnimationTimelineEdit::_track_added(int p_track) { } void AnimationTimelineEdit::_bind_methods() { - ClassDB::bind_method("_zoom_changed", &AnimationTimelineEdit::_zoom_changed); - ClassDB::bind_method("_anim_length_changed", &AnimationTimelineEdit::_anim_length_changed); - ClassDB::bind_method("_anim_loop_pressed", &AnimationTimelineEdit::_anim_loop_pressed); - ClassDB::bind_method("_play_position_draw", &AnimationTimelineEdit::_play_position_draw); ClassDB::bind_method("_gui_input", &AnimationTimelineEdit::_gui_input); - ClassDB::bind_method("_track_added", &AnimationTimelineEdit::_track_added); ADD_SIGNAL(MethodInfo("zoom_changed")); ADD_SIGNAL(MethodInfo("name_limit_changed")); @@ -1871,7 +1866,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_margins_preset(PRESET_WIDE); - play_position->connect_compat("draw", this, "_play_position_draw"); + play_position->connect("draw", callable_mp(this, &AnimationTimelineEdit::_play_position_draw)); add_track = memnew(MenuButton); add_track->set_position(Vector2(0, 0)); @@ -1895,17 +1890,17 @@ AnimationTimelineEdit::AnimationTimelineEdit() { length->set_custom_minimum_size(Vector2(70 * EDSCALE, 0)); length->set_hide_slider(true); length->set_tooltip(TTR("Animation length (seconds)")); - length->connect_compat("value_changed", this, "_anim_length_changed"); + length->connect("value_changed", callable_mp(this, &AnimationTimelineEdit::_anim_length_changed)); len_hb->add_child(length); loop = memnew(ToolButton); loop->set_tooltip(TTR("Animation Looping")); - loop->connect_compat("pressed", this, "_anim_loop_pressed"); + loop->connect("pressed", callable_mp(this, &AnimationTimelineEdit::_anim_loop_pressed)); loop->set_toggle_mode(true); len_hb->add_child(loop); add_child(len_hb); add_track->hide(); - add_track->get_popup()->connect_compat("index_pressed", this, "_track_added"); + add_track->get_popup()->connect("index_pressed", callable_mp(this, &AnimationTimelineEdit::_track_added)); len_hb->hide(); panning_timeline = false; @@ -2429,8 +2424,8 @@ void AnimationTrackEdit::set_undo_redo(UndoRedo *p_undo_redo) { void AnimationTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { timeline = p_timeline; - timeline->connect_compat("zoom_changed", this, "_zoom_changed"); - timeline->connect_compat("name_limit_changed", this, "_zoom_changed"); + timeline->connect("zoom_changed", callable_mp(this, &AnimationTrackEdit::_zoom_changed)); + timeline->connect("name_limit_changed", callable_mp(this, &AnimationTrackEdit::_zoom_changed)); } void AnimationTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; @@ -2691,7 +2686,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect_compat("id_pressed", this, "_menu_selected"); + menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); menu->add_icon_item(get_icon("TrackContinuous", "EditorIcons"), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS); @@ -2710,7 +2705,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect_compat("id_pressed", this, "_menu_selected"); + menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); menu->add_icon_item(get_icon("InterpRaw", "EditorIcons"), TTR("Nearest"), MENU_INTERPOLATION_NEAREST); @@ -2728,7 +2723,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect_compat("id_pressed", this, "_menu_selected"); + menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); menu->add_icon_item(get_icon("InterpWrapClamp", "EditorIcons"), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP); @@ -2823,7 +2818,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect_compat("id_pressed", this, "_menu_selected"); + menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); @@ -2851,7 +2846,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { path = memnew(LineEdit); add_child(path); path->set_as_toplevel(true); - path->connect_compat("text_entered", this, "_path_entered"); + path->connect("text_entered", callable_mp(this, &AnimationTrackEdit::_path_entered)); } path->set_text(animation->track_get_path(track)); @@ -3070,11 +3065,7 @@ void AnimationTrackEdit::append_to_selection(const Rect2 &p_box, bool p_deselect void AnimationTrackEdit::_bind_methods() { - ClassDB::bind_method("_zoom_changed", &AnimationTrackEdit::_zoom_changed); - ClassDB::bind_method("_menu_selected", &AnimationTrackEdit::_menu_selected); ClassDB::bind_method("_gui_input", &AnimationTrackEdit::_gui_input); - ClassDB::bind_method("_path_entered", &AnimationTrackEdit::_path_entered); - ClassDB::bind_method("_play_position_draw", &AnimationTrackEdit::_play_position_draw); ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track"))); @@ -3114,7 +3105,7 @@ AnimationTrackEdit::AnimationTrackEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_margins_preset(PRESET_WIDE); - play_position->connect_compat("draw", this, "_play_position_draw"); + play_position->connect("draw", callable_mp(this, &AnimationTrackEdit::_play_position_draw)); set_focus_mode(FOCUS_CLICK); set_mouse_filter(MOUSE_FILTER_PASS); //scroll has to work too for selection } @@ -3220,8 +3211,8 @@ Size2 AnimationTrackEditGroup::get_minimum_size() const { void AnimationTrackEditGroup::set_timeline(AnimationTimelineEdit *p_timeline) { timeline = p_timeline; - timeline->connect_compat("zoom_changed", this, "_zoom_changed"); - timeline->connect_compat("name_limit_changed", this, "_zoom_changed"); + timeline->connect("zoom_changed", callable_mp(this, &AnimationTrackEditGroup::_zoom_changed)); + timeline->connect("name_limit_changed", callable_mp(this, &AnimationTrackEditGroup::_zoom_changed)); } void AnimationTrackEditGroup::set_root(Node *p_root) { @@ -3234,7 +3225,6 @@ void AnimationTrackEditGroup::_zoom_changed() { } void AnimationTrackEditGroup::_bind_methods() { - ClassDB::bind_method("_zoom_changed", &AnimationTrackEditGroup::_zoom_changed); } AnimationTrackEditGroup::AnimationTrackEditGroup() { @@ -3261,7 +3251,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim) { track_edits[_get_track_selected()]->release_focus(); } if (animation.is_valid()) { - animation->disconnect_compat("changed", this, "_animation_changed"); + animation->disconnect("changed", callable_mp(this, &AnimationTrackEditor::_animation_changed)); _clear_selection(); } animation = p_anim; @@ -3271,7 +3261,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim) { _update_tracks(); if (animation.is_valid()) { - animation->connect_compat("changed", this, "_animation_changed"); + animation->connect("changed", callable_mp(this, &AnimationTrackEditor::_animation_changed)); hscroll->show(); edit->set_disabled(false); @@ -3314,13 +3304,13 @@ void AnimationTrackEditor::_root_removed(Node *p_root) { void AnimationTrackEditor::set_root(Node *p_root) { if (root) { - root->disconnect_compat("tree_exiting", this, "_root_removed"); + root->disconnect("tree_exiting", callable_mp(this, &AnimationTrackEditor::_root_removed)); } root = p_root; if (root) { - root->connect_compat("tree_exiting", this, "_root_removed", make_binds(), CONNECT_ONESHOT); + root->connect("tree_exiting", callable_mp(this, &AnimationTrackEditor::_root_removed), make_binds(), CONNECT_ONESHOT); } _update_tracks(); @@ -4260,21 +4250,21 @@ void AnimationTrackEditor::_update_tracks() { track_edit->grab_focus(); } - track_edit->connect_compat("timeline_changed", this, "_timeline_changed"); - track_edit->connect_compat("remove_request", this, "_track_remove_request", varray(), CONNECT_DEFERRED); - track_edit->connect_compat("dropped", this, "_dropped_track", varray(), CONNECT_DEFERRED); - track_edit->connect_compat("insert_key", this, "_insert_key_from_track", varray(i), CONNECT_DEFERRED); - track_edit->connect_compat("select_key", this, "_key_selected", varray(i), CONNECT_DEFERRED); - track_edit->connect_compat("deselect_key", this, "_key_deselected", varray(i), CONNECT_DEFERRED); - track_edit->connect_compat("bezier_edit", this, "_bezier_edit", varray(i), CONNECT_DEFERRED); - track_edit->connect_compat("move_selection_begin", this, "_move_selection_begin"); - track_edit->connect_compat("move_selection", this, "_move_selection"); - track_edit->connect_compat("move_selection_commit", this, "_move_selection_commit"); - track_edit->connect_compat("move_selection_cancel", this, "_move_selection_cancel"); + track_edit->connect("timeline_changed", callable_mp(this, &AnimationTrackEditor::_timeline_changed)); + track_edit->connect("remove_request", callable_mp(this, &AnimationTrackEditor::_track_remove_request), varray(), CONNECT_DEFERRED); + track_edit->connect("dropped", callable_mp(this, &AnimationTrackEditor::_dropped_track), varray(), CONNECT_DEFERRED); + track_edit->connect("insert_key", callable_mp(this, &AnimationTrackEditor::_insert_key_from_track), varray(i), CONNECT_DEFERRED); + track_edit->connect("select_key", callable_mp(this, &AnimationTrackEditor::_key_selected), varray(i), CONNECT_DEFERRED); + track_edit->connect("deselect_key", callable_mp(this, &AnimationTrackEditor::_key_deselected), varray(i), CONNECT_DEFERRED); + track_edit->connect("bezier_edit", callable_mp(this, &AnimationTrackEditor::_bezier_edit), varray(i), CONNECT_DEFERRED); + track_edit->connect("move_selection_begin", callable_mp(this, &AnimationTrackEditor::_move_selection_begin)); + track_edit->connect("move_selection", callable_mp(this, &AnimationTrackEditor::_move_selection)); + track_edit->connect("move_selection_commit", callable_mp(this, &AnimationTrackEditor::_move_selection_commit)); + track_edit->connect("move_selection_cancel", callable_mp(this, &AnimationTrackEditor::_move_selection_cancel)); - track_edit->connect_compat("duplicate_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_SELECTION), CONNECT_DEFERRED); - track_edit->connect_compat("duplicate_transpose_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_TRANSPOSED), CONNECT_DEFERRED); - track_edit->connect_compat("delete_request", this, "_edit_menu_pressed", varray(EDIT_DELETE_SELECTION), CONNECT_DEFERRED); + track_edit->connect("duplicate_request", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_DUPLICATE_SELECTION), CONNECT_DEFERRED); + track_edit->connect("duplicate_transpose_request", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_DUPLICATE_TRANSPOSED), CONNECT_DEFERRED); + track_edit->connect("delete_request", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_DELETE_SELECTION), CONNECT_DEFERRED); } } @@ -4387,7 +4377,7 @@ void AnimationTrackEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_READY) { - EditorNode::get_singleton()->get_editor_selection()->connect_compat("selection_changed", this, "_selection_changed"); + EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", callable_mp(this, &AnimationTrackEditor::_selection_changed)); } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { @@ -5740,45 +5730,16 @@ void AnimationTrackEditor::_select_all_tracks_for_copy() { void AnimationTrackEditor::_bind_methods() { - ClassDB::bind_method("_animation_changed", &AnimationTrackEditor::_animation_changed); ClassDB::bind_method("_animation_update", &AnimationTrackEditor::_animation_update); - ClassDB::bind_method("_timeline_changed", &AnimationTrackEditor::_timeline_changed); - ClassDB::bind_method("_track_remove_request", &AnimationTrackEditor::_track_remove_request); ClassDB::bind_method("_track_grab_focus", &AnimationTrackEditor::_track_grab_focus); - ClassDB::bind_method("_name_limit_changed", &AnimationTrackEditor::_name_limit_changed); - ClassDB::bind_method("_update_scroll", &AnimationTrackEditor::_update_scroll); ClassDB::bind_method("_update_tracks", &AnimationTrackEditor::_update_tracks); - ClassDB::bind_method("_update_step", &AnimationTrackEditor::_update_step); - ClassDB::bind_method("_update_length", &AnimationTrackEditor::_update_length); - ClassDB::bind_method("_dropped_track", &AnimationTrackEditor::_dropped_track); - ClassDB::bind_method("_add_track", &AnimationTrackEditor::_add_track); - ClassDB::bind_method("_new_track_node_selected", &AnimationTrackEditor::_new_track_node_selected); - ClassDB::bind_method("_new_track_property_selected", &AnimationTrackEditor::_new_track_property_selected); - ClassDB::bind_method("_root_removed", &AnimationTrackEditor::_root_removed); - ClassDB::bind_method("_confirm_insert_list", &AnimationTrackEditor::_confirm_insert_list); ClassDB::bind_method("_insert_delay", &AnimationTrackEditor::_insert_delay); - ClassDB::bind_method("_timeline_value_changed", &AnimationTrackEditor::_timeline_value_changed); - ClassDB::bind_method("_insert_key_from_track", &AnimationTrackEditor::_insert_key_from_track); - ClassDB::bind_method("_add_method_key", &AnimationTrackEditor::_add_method_key); - ClassDB::bind_method("_key_selected", &AnimationTrackEditor::_key_selected); - ClassDB::bind_method("_key_deselected", &AnimationTrackEditor::_key_deselected); - ClassDB::bind_method("_clear_selection", &AnimationTrackEditor::_clear_selection); - ClassDB::bind_method("_move_selection_begin", &AnimationTrackEditor::_move_selection_begin); - ClassDB::bind_method("_move_selection", &AnimationTrackEditor::_move_selection); - ClassDB::bind_method("_move_selection_commit", &AnimationTrackEditor::_move_selection_commit); - ClassDB::bind_method("_move_selection_cancel", &AnimationTrackEditor::_move_selection_cancel); ClassDB::bind_method("_clear_selection_for_anim", &AnimationTrackEditor::_clear_selection_for_anim); ClassDB::bind_method("_select_at_anim", &AnimationTrackEditor::_select_at_anim); - ClassDB::bind_method("_scroll_input", &AnimationTrackEditor::_scroll_input); - ClassDB::bind_method("_box_selection_draw", &AnimationTrackEditor::_box_selection_draw); - ClassDB::bind_method("_bezier_edit", &AnimationTrackEditor::_bezier_edit); - ClassDB::bind_method("_cancel_bezier_edit", &AnimationTrackEditor::_cancel_bezier_edit); - ClassDB::bind_method("_edit_menu_pressed", &AnimationTrackEditor::_edit_menu_pressed); - ClassDB::bind_method("_view_group_toggle", &AnimationTrackEditor::_view_group_toggle); - ClassDB::bind_method("_selection_changed", &AnimationTrackEditor::_selection_changed); - ClassDB::bind_method("_snap_mode_changed", &AnimationTrackEditor::_snap_mode_changed); - ClassDB::bind_method("_show_imported_anim_warning", &AnimationTrackEditor::_show_imported_anim_warning); - ClassDB::bind_method("_select_all_tracks_for_copy", &AnimationTrackEditor::_select_all_tracks_for_copy); + + ClassDB::bind_method("_key_selected", &AnimationTrackEditor::_key_selected); // Still used by some connect_compat. + ClassDB::bind_method("_key_deselected", &AnimationTrackEditor::_key_deselected); // Still used by some connect_compat. + ClassDB::bind_method("_clear_selection", &AnimationTrackEditor::_clear_selection); // Still used by some connect_compat. ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("keying_changed")); @@ -5816,11 +5777,11 @@ AnimationTrackEditor::AnimationTrackEditor() { timeline = memnew(AnimationTimelineEdit); timeline->set_undo_redo(undo_redo); timeline_vbox->add_child(timeline); - timeline->connect_compat("timeline_changed", this, "_timeline_changed"); - timeline->connect_compat("name_limit_changed", this, "_name_limit_changed"); - timeline->connect_compat("track_added", this, "_add_track"); - timeline->connect_compat("value_changed", this, "_timeline_value_changed"); - timeline->connect_compat("length_changed", this, "_update_length"); + timeline->connect("timeline_changed", callable_mp(this, &AnimationTrackEditor::_timeline_changed)); + timeline->connect("name_limit_changed", callable_mp(this, &AnimationTrackEditor::_name_limit_changed)); + timeline->connect("track_added", callable_mp(this, &AnimationTrackEditor::_add_track)); + timeline->connect("value_changed", callable_mp(this, &AnimationTrackEditor::_timeline_value_changed)); + timeline->connect("length_changed", callable_mp(this, &AnimationTrackEditor::_update_length)); scroll = memnew(ScrollContainer); timeline_vbox->add_child(scroll); @@ -5828,7 +5789,7 @@ AnimationTrackEditor::AnimationTrackEditor() { VScrollBar *sb = scroll->get_v_scrollbar(); scroll->remove_child(sb); timeline_scroll->add_child(sb); //move here so timeline and tracks are always aligned - scroll->connect_compat("gui_input", this, "_scroll_input"); + scroll->connect("gui_input", callable_mp(this, &AnimationTrackEditor::_scroll_input)); bezier_edit = memnew(AnimationBezierTrackEdit); timeline_vbox->add_child(bezier_edit); @@ -5837,14 +5798,14 @@ AnimationTrackEditor::AnimationTrackEditor() { bezier_edit->set_timeline(timeline); bezier_edit->hide(); bezier_edit->set_v_size_flags(SIZE_EXPAND_FILL); - bezier_edit->connect_compat("close_request", this, "_cancel_bezier_edit"); + bezier_edit->connect("close_request", callable_mp(this, &AnimationTrackEditor::_cancel_bezier_edit)); timeline_vbox->set_custom_minimum_size(Size2(0, 150) * EDSCALE); hscroll = memnew(HScrollBar); hscroll->share(timeline); hscroll->hide(); - hscroll->connect_compat("value_changed", this, "_update_scroll"); + hscroll->connect("value_changed", callable_mp(this, &AnimationTrackEditor::_update_scroll)); timeline_vbox->add_child(hscroll); timeline->set_hscroll(hscroll); @@ -5861,20 +5822,20 @@ AnimationTrackEditor::AnimationTrackEditor() { imported_anim_warning = memnew(Button); imported_anim_warning->hide(); imported_anim_warning->set_tooltip(TTR("Warning: Editing imported animation")); - imported_anim_warning->connect_compat("pressed", this, "_show_imported_anim_warning"); + imported_anim_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_imported_anim_warning)); bottom_hb->add_child(imported_anim_warning); bottom_hb->add_spacer(); selected_filter = memnew(ToolButton); - selected_filter->connect_compat("pressed", this, "_view_group_toggle"); //same function works the same + selected_filter->connect("pressed", callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); //same function works the same selected_filter->set_toggle_mode(true); selected_filter->set_tooltip(TTR("Only show tracks from nodes selected in tree.")); bottom_hb->add_child(selected_filter); view_group = memnew(ToolButton); - view_group->connect_compat("pressed", this, "_view_group_toggle"); + view_group->connect("pressed", callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); view_group->set_toggle_mode(true); view_group->set_tooltip(TTR("Group tracks by node or display them as plain list.")); @@ -5896,14 +5857,14 @@ AnimationTrackEditor::AnimationTrackEditor() { step->set_custom_minimum_size(Size2(100, 0) * EDSCALE); step->set_tooltip(TTR("Animation step value.")); bottom_hb->add_child(step); - step->connect_compat("value_changed", this, "_update_step"); + step->connect("value_changed", callable_mp(this, &AnimationTrackEditor::_update_step)); step->set_read_only(true); snap_mode = memnew(OptionButton); snap_mode->add_item(TTR("Seconds")); snap_mode->add_item(TTR("FPS")); bottom_hb->add_child(snap_mode); - snap_mode->connect_compat("item_selected", this, "_snap_mode_changed"); + snap_mode->connect("item_selected", callable_mp(this, &AnimationTrackEditor::_snap_mode_changed)); snap_mode->set_disabled(true); bottom_hb->add_child(memnew(VSeparator)); @@ -5948,19 +5909,19 @@ AnimationTrackEditor::AnimationTrackEditor() { edit->get_popup()->add_item(TTR("Optimize Animation"), EDIT_OPTIMIZE_ANIMATION); edit->get_popup()->add_item(TTR("Clean-Up Animation"), EDIT_CLEAN_UP_ANIMATION); - edit->get_popup()->connect_compat("id_pressed", this, "_edit_menu_pressed"); + edit->get_popup()->connect("id_pressed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed)); pick_track = memnew(SceneTreeDialog); add_child(pick_track); pick_track->set_title(TTR("Pick the node that will be animated:")); - pick_track->connect_compat("selected", this, "_new_track_node_selected"); + pick_track->connect("selected", callable_mp(this, &AnimationTrackEditor::_new_track_node_selected)); prop_selector = memnew(PropertySelector); add_child(prop_selector); - prop_selector->connect_compat("selected", this, "_new_track_property_selected"); + prop_selector->connect("selected", callable_mp(this, &AnimationTrackEditor::_new_track_property_selected)); method_selector = memnew(PropertySelector); add_child(method_selector); - method_selector->connect_compat("selected", this, "_add_method_key"); + method_selector->connect("selected", callable_mp(this, &AnimationTrackEditor::_add_method_key)); inserting = false; insert_query = false; @@ -5969,7 +5930,7 @@ AnimationTrackEditor::AnimationTrackEditor() { insert_confirm = memnew(ConfirmationDialog); add_child(insert_confirm); - insert_confirm->connect_compat("confirmed", this, "_confirm_insert_list"); + insert_confirm->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_confirm_insert_list)); VBoxContainer *icvb = memnew(VBoxContainer); insert_confirm->add_child(icvb); insert_confirm_text = memnew(Label); @@ -5987,7 +5948,7 @@ AnimationTrackEditor::AnimationTrackEditor() { box_selection->set_as_toplevel(true); box_selection->set_mouse_filter(MOUSE_FILTER_IGNORE); box_selection->hide(); - box_selection->connect_compat("draw", this, "_box_selection_draw"); + box_selection->connect("draw", callable_mp(this, &AnimationTrackEditor::_box_selection_draw)); box_selecting = false; //default plugins @@ -6025,7 +5986,7 @@ AnimationTrackEditor::AnimationTrackEditor() { optimize_max_angle->set_value(22); optimize_dialog->get_ok()->set_text(TTR("Optimize")); - optimize_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); + optimize_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); // @@ -6051,7 +6012,7 @@ AnimationTrackEditor::AnimationTrackEditor() { cleanup_dialog->set_title(TTR("Clean-Up Animation(s) (NO UNDO!)")); cleanup_dialog->get_ok()->set_text(TTR("Clean-Up")); - cleanup_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); + cleanup_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); // scale_dialog = memnew(ConfirmationDialog); @@ -6063,7 +6024,7 @@ AnimationTrackEditor::AnimationTrackEditor() { scale->set_max(99999); scale->set_step(0.001); vbc->add_margin_child(TTR("Scale Ratio:"), scale); - scale_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_SCALE_CONFIRM)); + scale_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_SCALE_CONFIRM)); add_child(scale_dialog); track_copy_dialog = memnew(ConfirmationDialog); @@ -6076,7 +6037,7 @@ AnimationTrackEditor::AnimationTrackEditor() { Button *select_all_button = memnew(Button); select_all_button->set_text(TTR("Select All/None")); - select_all_button->connect_compat("pressed", this, "_select_all_tracks_for_copy"); + select_all_button->connect("pressed", callable_mp(this, &AnimationTrackEditor::_select_all_tracks_for_copy)); track_vbox->add_child(select_all_button); track_copy_select = memnew(Tree); @@ -6084,7 +6045,7 @@ AnimationTrackEditor::AnimationTrackEditor() { track_copy_select->set_v_size_flags(SIZE_EXPAND_FILL); track_copy_select->set_hide_root(true); track_vbox->add_child(track_copy_select); - track_copy_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM)); + track_copy_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_COPY_TRACKS_CONFIRM)); animation_changing_awaiting_update = false; } |