summaryrefslogtreecommitdiff
path: root/editor/animation_bezier_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/animation_bezier_editor.cpp')
-rw-r--r--editor/animation_bezier_editor.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 719e4af6b5..e0839a9f27 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -502,12 +502,12 @@ void AnimationBezierTrackEdit::set_animation_and_track(const Ref<Animation> &p_a
animation = p_animation;
track = p_track;
- if (is_connected("select_key", editor, "_key_selected"))
- disconnect("select_key", editor, "_key_selected");
- if (is_connected("deselect_key", editor, "_key_deselected"))
- disconnect("deselect_key", editor, "_key_deselected");
- connect("select_key", editor, "_key_selected", varray(p_track), CONNECT_DEFERRED);
- connect("deselect_key", editor, "_key_deselected", varray(p_track), CONNECT_DEFERRED);
+ if (is_connected_compat("select_key", editor, "_key_selected"))
+ disconnect_compat("select_key", editor, "_key_selected");
+ if (is_connected_compat("deselect_key", editor, "_key_deselected"))
+ disconnect_compat("deselect_key", editor, "_key_deselected");
+ connect_compat("select_key", editor, "_key_selected", varray(p_track), CONNECT_DEFERRED);
+ connect_compat("deselect_key", editor, "_key_deselected", varray(p_track), CONNECT_DEFERRED);
update();
}
@@ -522,11 +522,11 @@ void AnimationBezierTrackEdit::set_undo_redo(UndoRedo *p_undo_redo) {
void AnimationBezierTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) {
timeline = p_timeline;
- timeline->connect("zoom_changed", this, "_zoom_changed");
+ timeline->connect("zoom_changed", callable_mp(this, &AnimationBezierTrackEdit::_zoom_changed));
}
void AnimationBezierTrackEdit::set_editor(AnimationTrackEditor *p_editor) {
editor = p_editor;
- connect("clear_selection", editor, "_clear_selection", varray(false));
+ connect_compat("clear_selection", editor, "_clear_selection", varray(false));
}
void AnimationBezierTrackEdit::_play_position_draw() {
@@ -1141,25 +1141,22 @@ void AnimationBezierTrackEdit::set_block_animation_update_ptr(bool *p_block_ptr)
void AnimationBezierTrackEdit::_bind_methods() {
- ClassDB::bind_method("_zoom_changed", &AnimationBezierTrackEdit::_zoom_changed);
- ClassDB::bind_method("_menu_selected", &AnimationBezierTrackEdit::_menu_selected);
ClassDB::bind_method("_gui_input", &AnimationBezierTrackEdit::_gui_input);
- ClassDB::bind_method("_play_position_draw", &AnimationBezierTrackEdit::_play_position_draw);
ClassDB::bind_method("_clear_selection", &AnimationBezierTrackEdit::_clear_selection);
ClassDB::bind_method("_clear_selection_for_anim", &AnimationBezierTrackEdit::_clear_selection_for_anim);
ClassDB::bind_method("_select_at_anim", &AnimationBezierTrackEdit::_select_at_anim);
- ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
+ ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track")));
- ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::REAL, "ofs")));
+ ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "ofs")));
ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single")));
ADD_SIGNAL(MethodInfo("deselect_key", PropertyInfo(Variant::INT, "index")));
ADD_SIGNAL(MethodInfo("clear_selection"));
ADD_SIGNAL(MethodInfo("close_request"));
ADD_SIGNAL(MethodInfo("move_selection_begin"));
- ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::REAL, "ofs")));
+ ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::FLOAT, "ofs")));
ADD_SIGNAL(MethodInfo("move_selection_commit"));
ADD_SIGNAL(MethodInfo("move_selection_cancel"));
}
@@ -1184,7 +1181,7 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() {
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
add_child(play_position);
play_position->set_anchors_and_margins_preset(PRESET_WIDE);
- play_position->connect("draw", this, "_play_position_draw");
+ play_position->connect("draw", callable_mp(this, &AnimationBezierTrackEdit::_play_position_draw));
set_focus_mode(FOCUS_CLICK);
v_scroll = 0;
@@ -1198,7 +1195,7 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() {
menu = memnew(PopupMenu);
add_child(menu);
- menu->connect("id_pressed", this, "_menu_selected");
+ menu->connect("id_pressed", callable_mp(this, &AnimationBezierTrackEdit::_menu_selected));
//set_mouse_filter(MOUSE_FILTER_PASS); //scroll has to work too for selection
}