summaryrefslogtreecommitdiff
path: root/editor/animation_track_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r--editor/animation_track_editor.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index cc64db22cc..b538161443 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -235,7 +235,7 @@ public:
Variant::Type t = Variant::Type(int(p_value));
if (t != args[idx].get_type()) {
- Variant::CallError err;
+ Callable::CallError err;
if (Variant::can_convert(args[idx].get_type(), t)) {
Variant old = args[idx];
Variant *ptrs[1] = { &old };
@@ -898,7 +898,7 @@ public:
Variant::Type t = Variant::Type(int(p_value));
if (t != args[idx].get_type()) {
- Variant::CallError err;
+ Callable::CallError err;
if (Variant::can_convert(args[idx].get_type(), t)) {
Variant old = args[idx];
Variant *ptrs[1] = { &old };
@@ -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("value_changed", this, "_zoom_changed");
+ zoom->connect_compat("value_changed", this, "_zoom_changed");
}
void AnimationTimelineEdit::set_play_position(float p_pos) {
@@ -1871,7 +1871,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("draw", this, "_play_position_draw");
+ play_position->connect_compat("draw", this, "_play_position_draw");
add_track = memnew(MenuButton);
add_track->set_position(Vector2(0, 0));
@@ -1895,17 +1895,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("value_changed", this, "_anim_length_changed");
+ length->connect_compat("value_changed", this, "_anim_length_changed");
len_hb->add_child(length);
loop = memnew(ToolButton);
loop->set_tooltip(TTR("Animation Looping"));
- loop->connect("pressed", this, "_anim_loop_pressed");
+ loop->connect_compat("pressed", this, "_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("index_pressed", this, "_track_added");
+ add_track->get_popup()->connect_compat("index_pressed", this, "_track_added");
len_hb->hide();
panning_timeline = false;
@@ -2429,8 +2429,8 @@ void AnimationTrackEdit::set_undo_redo(UndoRedo *p_undo_redo) {
void AnimationTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) {
timeline = p_timeline;
- timeline->connect("zoom_changed", this, "_zoom_changed");
- timeline->connect("name_limit_changed", this, "_zoom_changed");
+ timeline->connect_compat("zoom_changed", this, "_zoom_changed");
+ timeline->connect_compat("name_limit_changed", this, "_zoom_changed");
}
void AnimationTrackEdit::set_editor(AnimationTrackEditor *p_editor) {
editor = p_editor;
@@ -2688,7 +2688,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (!menu) {
menu = memnew(PopupMenu);
add_child(menu);
- menu->connect("id_pressed", this, "_menu_selected");
+ menu->connect_compat("id_pressed", this, "_menu_selected");
}
menu->clear();
menu->add_icon_item(get_icon("TrackContinuous", "EditorIcons"), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS);
@@ -2707,7 +2707,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (!menu) {
menu = memnew(PopupMenu);
add_child(menu);
- menu->connect("id_pressed", this, "_menu_selected");
+ menu->connect_compat("id_pressed", this, "_menu_selected");
}
menu->clear();
menu->add_icon_item(get_icon("InterpRaw", "EditorIcons"), TTR("Nearest"), MENU_INTERPOLATION_NEAREST);
@@ -2725,7 +2725,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (!menu) {
menu = memnew(PopupMenu);
add_child(menu);
- menu->connect("id_pressed", this, "_menu_selected");
+ menu->connect_compat("id_pressed", this, "_menu_selected");
}
menu->clear();
menu->add_icon_item(get_icon("InterpWrapClamp", "EditorIcons"), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP);
@@ -2820,7 +2820,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (!menu) {
menu = memnew(PopupMenu);
add_child(menu);
- menu->connect("id_pressed", this, "_menu_selected");
+ menu->connect_compat("id_pressed", this, "_menu_selected");
}
menu->clear();
@@ -2848,7 +2848,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
path = memnew(LineEdit);
add_child(path);
path->set_as_toplevel(true);
- path->connect("text_entered", this, "_path_entered");
+ path->connect_compat("text_entered", this, "_path_entered");
}
path->set_text(animation->track_get_path(track));
@@ -3111,7 +3111,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("draw", this, "_play_position_draw");
+ play_position->connect_compat("draw", this, "_play_position_draw");
set_focus_mode(FOCUS_CLICK);
set_mouse_filter(MOUSE_FILTER_PASS); //scroll has to work too for selection
}
@@ -3138,7 +3138,7 @@ AnimationTrackEdit *AnimationTrackEditPlugin::create_value_track_edit(Object *p_
&args[5]
};
- Variant::CallError ce;
+ Callable::CallError ce;
return Object::cast_to<AnimationTrackEdit>(get_script_instance()->call("create_value_track_edit", (const Variant **)&argptrs, 6, ce).operator Object *());
}
return NULL;
@@ -3217,8 +3217,8 @@ Size2 AnimationTrackEditGroup::get_minimum_size() const {
void AnimationTrackEditGroup::set_timeline(AnimationTimelineEdit *p_timeline) {
timeline = p_timeline;
- timeline->connect("zoom_changed", this, "_zoom_changed");
- timeline->connect("name_limit_changed", this, "_zoom_changed");
+ timeline->connect_compat("zoom_changed", this, "_zoom_changed");
+ timeline->connect_compat("name_limit_changed", this, "_zoom_changed");
}
void AnimationTrackEditGroup::set_root(Node *p_root) {
@@ -3258,7 +3258,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim) {
track_edits[_get_track_selected()]->release_focus();
}
if (animation.is_valid()) {
- animation->disconnect("changed", this, "_animation_changed");
+ animation->disconnect_compat("changed", this, "_animation_changed");
_clear_selection();
}
animation = p_anim;
@@ -3268,7 +3268,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim) {
_update_tracks();
if (animation.is_valid()) {
- animation->connect("changed", this, "_animation_changed");
+ animation->connect_compat("changed", this, "_animation_changed");
hscroll->show();
edit->set_disabled(false);
@@ -3311,13 +3311,13 @@ void AnimationTrackEditor::_root_removed(Node *p_root) {
void AnimationTrackEditor::set_root(Node *p_root) {
if (root) {
- root->disconnect("tree_exiting", this, "_root_removed");
+ root->disconnect_compat("tree_exiting", this, "_root_removed");
}
root = p_root;
if (root) {
- root->connect("tree_exiting", this, "_root_removed", make_binds(), CONNECT_ONESHOT);
+ root->connect_compat("tree_exiting", this, "_root_removed", make_binds(), CONNECT_ONESHOT);
}
_update_tracks();
@@ -4257,21 +4257,21 @@ void AnimationTrackEditor::_update_tracks() {
track_edit->grab_focus();
}
- track_edit->connect("timeline_changed", this, "_timeline_changed");
- track_edit->connect("remove_request", this, "_track_remove_request", varray(), CONNECT_DEFERRED);
- track_edit->connect("dropped", this, "_dropped_track", varray(), CONNECT_DEFERRED);
- track_edit->connect("insert_key", this, "_insert_key_from_track", varray(i), CONNECT_DEFERRED);
- track_edit->connect("select_key", this, "_key_selected", varray(i), CONNECT_DEFERRED);
- track_edit->connect("deselect_key", this, "_key_deselected", varray(i), CONNECT_DEFERRED);
- track_edit->connect("bezier_edit", this, "_bezier_edit", varray(i), CONNECT_DEFERRED);
- track_edit->connect("move_selection_begin", this, "_move_selection_begin");
- track_edit->connect("move_selection", this, "_move_selection");
- track_edit->connect("move_selection_commit", this, "_move_selection_commit");
- track_edit->connect("move_selection_cancel", this, "_move_selection_cancel");
+ 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("duplicate_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_SELECTION), CONNECT_DEFERRED);
- track_edit->connect("duplicate_transpose_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_TRANSPOSED), CONNECT_DEFERRED);
- track_edit->connect("delete_request", this, "_edit_menu_pressed", varray(EDIT_DELETE_SELECTION), CONNECT_DEFERRED);
+ 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);
}
}
@@ -4384,7 +4384,7 @@ void AnimationTrackEditor::_notification(int p_what) {
}
if (p_what == NOTIFICATION_READY) {
- EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", this, "_selection_changed");
+ EditorNode::get_singleton()->get_editor_selection()->connect_compat("selection_changed", this, "_selection_changed");
}
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
@@ -4753,7 +4753,7 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) {
Variant arg = E->get().default_arguments[i - first_defarg];
params.push_back(arg);
} else {
- Variant::CallError ce;
+ Callable::CallError ce;
Variant arg = Variant::construct(E->get().arguments[i].type, NULL, 0, ce);
params.push_back(arg);
}
@@ -5813,11 +5813,11 @@ AnimationTrackEditor::AnimationTrackEditor() {
timeline = memnew(AnimationTimelineEdit);
timeline->set_undo_redo(undo_redo);
timeline_vbox->add_child(timeline);
- timeline->connect("timeline_changed", this, "_timeline_changed");
- timeline->connect("name_limit_changed", this, "_name_limit_changed");
- timeline->connect("track_added", this, "_add_track");
- timeline->connect("value_changed", this, "_timeline_value_changed");
- timeline->connect("length_changed", this, "_update_length");
+ 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");
scroll = memnew(ScrollContainer);
timeline_vbox->add_child(scroll);
@@ -5825,7 +5825,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("gui_input", this, "_scroll_input");
+ scroll->connect_compat("gui_input", this, "_scroll_input");
bezier_edit = memnew(AnimationBezierTrackEdit);
timeline_vbox->add_child(bezier_edit);
@@ -5834,14 +5834,14 @@ AnimationTrackEditor::AnimationTrackEditor() {
bezier_edit->set_timeline(timeline);
bezier_edit->hide();
bezier_edit->set_v_size_flags(SIZE_EXPAND_FILL);
- bezier_edit->connect("close_request", this, "_cancel_bezier_edit");
+ bezier_edit->connect_compat("close_request", this, "_cancel_bezier_edit");
timeline_vbox->set_custom_minimum_size(Size2(0, 150) * EDSCALE);
hscroll = memnew(HScrollBar);
hscroll->share(timeline);
hscroll->hide();
- hscroll->connect("value_changed", this, "_update_scroll");
+ hscroll->connect_compat("value_changed", this, "_update_scroll");
timeline_vbox->add_child(hscroll);
timeline->set_hscroll(hscroll);
@@ -5858,20 +5858,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("pressed", this, "_show_imported_anim_warning");
+ imported_anim_warning->connect_compat("pressed", this, "_show_imported_anim_warning");
bottom_hb->add_child(imported_anim_warning);
bottom_hb->add_spacer();
selected_filter = memnew(ToolButton);
- selected_filter->connect("pressed", this, "_view_group_toggle"); //same function works the same
+ selected_filter->connect_compat("pressed", this, "_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("pressed", this, "_view_group_toggle");
+ view_group->connect_compat("pressed", this, "_view_group_toggle");
view_group->set_toggle_mode(true);
view_group->set_tooltip(TTR("Group tracks by node or display them as plain list."));
@@ -5893,14 +5893,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("value_changed", this, "_update_step");
+ step->connect_compat("value_changed", this, "_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("item_selected", this, "_snap_mode_changed");
+ snap_mode->connect_compat("item_selected", this, "_snap_mode_changed");
snap_mode->set_disabled(true);
bottom_hb->add_child(memnew(VSeparator));
@@ -5945,19 +5945,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("id_pressed", this, "_edit_menu_pressed");
+ edit->get_popup()->connect_compat("id_pressed", this, "_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("selected", this, "_new_track_node_selected");
+ pick_track->connect_compat("selected", this, "_new_track_node_selected");
prop_selector = memnew(PropertySelector);
add_child(prop_selector);
- prop_selector->connect("selected", this, "_new_track_property_selected");
+ prop_selector->connect_compat("selected", this, "_new_track_property_selected");
method_selector = memnew(PropertySelector);
add_child(method_selector);
- method_selector->connect("selected", this, "_add_method_key");
+ method_selector->connect_compat("selected", this, "_add_method_key");
inserting = false;
insert_query = false;
@@ -5966,7 +5966,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
insert_confirm = memnew(ConfirmationDialog);
add_child(insert_confirm);
- insert_confirm->connect("confirmed", this, "_confirm_insert_list");
+ insert_confirm->connect_compat("confirmed", this, "_confirm_insert_list");
VBoxContainer *icvb = memnew(VBoxContainer);
insert_confirm->add_child(icvb);
insert_confirm_text = memnew(Label);
@@ -5984,7 +5984,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
box_selection->set_as_toplevel(true);
box_selection->set_mouse_filter(MOUSE_FILTER_IGNORE);
box_selection->hide();
- box_selection->connect("draw", this, "_box_selection_draw");
+ box_selection->connect_compat("draw", this, "_box_selection_draw");
box_selecting = false;
//default plugins
@@ -6022,7 +6022,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
optimize_max_angle->set_value(22);
optimize_dialog->get_ok()->set_text(TTR("Optimize"));
- optimize_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM));
+ optimize_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM));
//
@@ -6048,7 +6048,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("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM));
+ cleanup_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM));
//
scale_dialog = memnew(ConfirmationDialog);
@@ -6060,7 +6060,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
scale->set_max(99999);
scale->set_step(0.001);
vbc->add_margin_child(TTR("Scale Ratio:"), scale);
- scale_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_SCALE_CONFIRM));
+ scale_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_SCALE_CONFIRM));
add_child(scale_dialog);
track_copy_dialog = memnew(ConfirmationDialog);
@@ -6073,7 +6073,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
Button *select_all_button = memnew(Button);
select_all_button->set_text(TTR("Select All/None"));
- select_all_button->connect("pressed", this, "_select_all_tracks_for_copy");
+ select_all_button->connect_compat("pressed", this, "_select_all_tracks_for_copy");
track_vbox->add_child(select_all_button);
track_copy_select = memnew(Tree);
@@ -6081,7 +6081,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("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM));
+ track_copy_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM));
animation_changing_awaiting_update = false;
}