diff options
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 187 |
1 files changed, 95 insertions, 92 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index cc64db22cc..8758fbcfc9 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 }; @@ -548,9 +548,9 @@ public: if (use_fps && animation->get_step() > 0) { float max_frame = animation->get_length() / animation->get_step(); - p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); } else { - p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); } switch (animation->track_get_type(track)) { @@ -593,7 +593,7 @@ public: } break; case Animation::TYPE_METHOD: { - p_list->push_back(PropertyInfo(Variant::STRING, "name")); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "name")); p_list->push_back(PropertyInfo(Variant::INT, "arg_count", PROPERTY_HINT_RANGE, "0,5,1")); Dictionary d = animation->track_get_key_value(track, key); @@ -617,7 +617,7 @@ public: } break; case Animation::TYPE_BEZIER: { - p_list->push_back(PropertyInfo(Variant::REAL, "value")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "value")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle")); @@ -625,8 +625,8 @@ public: case Animation::TYPE_AUDIO: { p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream")); - p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); - p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); } break; case Animation::TYPE_ANIMATION: { @@ -654,13 +654,13 @@ public: } animations += "[stop]"; - p_list->push_back(PropertyInfo(Variant::STRING, "animation", PROPERTY_HINT_ENUM, animations)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "animation", PROPERTY_HINT_ENUM, animations)); } break; } if (animation->track_get_type(track) == Animation::TYPE_VALUE) { - p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "easing", PROPERTY_HINT_EXP_EASING)); } } @@ -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 }; @@ -1243,9 +1243,9 @@ public: if (use_fps && animation->get_step() > 0) { float max_frame = animation->get_length() / animation->get_step(); - p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); } else { - p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); } } @@ -1289,11 +1289,11 @@ public: p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); } - p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "easing", PROPERTY_HINT_EXP_EASING)); } break; case Animation::TYPE_METHOD: { - p_list->push_back(PropertyInfo(Variant::STRING, "name")); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "name")); p_list->push_back(PropertyInfo(Variant::INT, "arg_count", PROPERTY_HINT_RANGE, "0,5,1")); Dictionary d = animation->track_get_key_value(first_track, first_key); @@ -1316,15 +1316,15 @@ public: } break; case Animation::TYPE_BEZIER: { - p_list->push_back(PropertyInfo(Variant::REAL, "value")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "value")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle")); } break; case Animation::TYPE_AUDIO: { p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream")); - p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); - p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); } break; case Animation::TYPE_ANIMATION: { @@ -1354,7 +1354,7 @@ public: } animations += "[stop]"; - p_list->push_back(PropertyInfo(Variant::STRING, "animation", PROPERTY_HINT_ENUM, animations)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "animation", PROPERTY_HINT_ENUM, animations)); } break; } } @@ -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) { @@ -1854,9 +1854,9 @@ void AnimationTimelineEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("zoom_changed")); ADD_SIGNAL(MethodInfo("name_limit_changed")); - 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("track_added", PropertyInfo(Variant::INT, "track"))); - ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::REAL, "size"))); + ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size"))); } AnimationTimelineEdit::AnimationTimelineEdit() { @@ -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; @@ -2480,6 +2480,9 @@ void AnimationTrackEdit::_path_entered(const String &p_text) { bool AnimationTrackEdit::_is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const { + if (root == nullptr) + return false; + RES res; Vector<StringName> leftover_path; Node *node = root->get_node_and_resource(animation->track_get_path(track), res, leftover_path); @@ -2688,7 +2691,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 +2710,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 +2728,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 +2823,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 +2851,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)); @@ -3073,16 +3076,16 @@ void AnimationTrackEdit::_bind_methods() { 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::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("dropped", PropertyInfo(Variant::INT, "from_track"), PropertyInfo(Variant::INT, "to_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("bezier_edit")); 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")); @@ -3111,7 +3114,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 +3141,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 +3220,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 +3261,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 +3271,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 +3314,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(); @@ -3482,7 +3485,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { switch (insert_data[i].value.get_type()) { case Variant::INT: - case Variant::REAL: + case Variant::FLOAT: case Variant::VECTOR2: case Variant::VECTOR3: case Variant::QUAT: @@ -3913,7 +3916,7 @@ static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool case Variant::INT: { subindices.push_back(""); } break; - case Variant::REAL: { + case Variant::FLOAT: { subindices.push_back(""); } break; case Variant::VECTOR2: { @@ -3991,7 +3994,7 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo PropertyInfo h = _find_hint_for_track(animation->get_track_count() - 1, np); animation->remove_track(animation->get_track_count() - 1); //hack - if (h.type == Variant::REAL || + if (h.type == Variant::FLOAT || h.type == Variant::VECTOR2 || h.type == Variant::RECT2 || h.type == Variant::VECTOR3 || @@ -4257,21 +4260,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 +4387,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) { @@ -4473,7 +4476,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) { Vector<Variant::Type> filter; filter.push_back(Variant::INT); - filter.push_back(Variant::REAL); + filter.push_back(Variant::FLOAT); filter.push_back(Variant::VECTOR2); filter.push_back(Variant::VECTOR3); filter.push_back(Variant::QUAT); @@ -4543,7 +4546,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) { animation->track_set_path(animation->get_track_count() - 1, full_path); PropertyInfo h = _find_hint_for_track(animation->get_track_count() - 1, np); animation->remove_track(animation->get_track_count() - 1); //hack - if (h.type == Variant::REAL || + if (h.type == Variant::FLOAT || h.type == Variant::VECTOR2 || h.type == Variant::RECT2 || h.type == Variant::VECTOR3 || @@ -4753,7 +4756,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); } @@ -5707,7 +5710,7 @@ float AnimationTrackEditor::snap_time(float p_value, bool p_relative) { return p_value; } -void AnimationTrackEditor::_show_imported_anim_warning() const { +void AnimationTrackEditor::_show_imported_anim_warning() { // It looks terrible on a single line but the TTR extractor doesn't support line breaks yet. EditorNode::get_singleton()->show_warning(TTR("This animation belongs to an imported scene, so changes to imported tracks will not be saved.\n\nTo enable the ability to add custom tracks, navigate to the scene's import settings and set\n\"Animation > Storage\" to \"Files\", enable \"Animation > Keep Custom Tracks\", then re-import.\nAlternatively, use an import preset that imports animations to separate files."), @@ -5777,10 +5780,10 @@ void AnimationTrackEditor::_bind_methods() { 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); - 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("keying_changed")); - ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::REAL, "len"))); - ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::REAL, "step"))); + ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::FLOAT, "len"))); + ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::FLOAT, "step"))); } AnimationTrackEditor::AnimationTrackEditor() { @@ -5813,11 +5816,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 +5828,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 +5837,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 +5861,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 +5896,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 +5948,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 +5969,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 +5987,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 +6025,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 +6051,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 +6063,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 +6076,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 +6084,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; } |