Преглед изворни кода

Merge pull request #65900 from YuriSizov/editor-animation-loopity-loops-loop

Fix loop mode button update in the Animation editor
Rémi Verschelde пре 3 година
родитељ
комит
519191d2f1
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      editor/animation_track_editor.cpp

+ 4 - 0
editor/animation_track_editor.cpp

@@ -1445,7 +1445,9 @@ void AnimationTimelineEdit::_anim_loop_pressed() {
 			default:
 			default:
 				break;
 				break;
 		}
 		}
+		undo_redo->add_do_method(this, "update_values");
 		undo_redo->add_undo_method(animation.ptr(), "set_loop_mode", animation->get_loop_mode());
 		undo_redo->add_undo_method(animation.ptr(), "set_loop_mode", animation->get_loop_mode());
+		undo_redo->add_undo_method(this, "update_values");
 		undo_redo->commit_action();
 		undo_redo->commit_action();
 	} else {
 	} else {
 		String base_path = animation->get_path();
 		String base_path = animation->get_path();
@@ -1913,6 +1915,8 @@ void AnimationTimelineEdit::_bind_methods() {
 	ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only")));
 	ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only")));
 	ADD_SIGNAL(MethodInfo("track_added", PropertyInfo(Variant::INT, "track")));
 	ADD_SIGNAL(MethodInfo("track_added", PropertyInfo(Variant::INT, "track")));
 	ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size")));
 	ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size")));
+
+	ClassDB::bind_method(D_METHOD("update_values"), &AnimationTimelineEdit::update_values);
 }
 }
 
 
 AnimationTimelineEdit::AnimationTimelineEdit() {
 AnimationTimelineEdit::AnimationTimelineEdit() {