diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-07-16 16:53:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-16 16:53:34 +0200 |
| commit | c39223e0db14b58bf48aafc22497d076a4540966 (patch) | |
| tree | 4934526266ca53da407e61820e4c1be802bb6f15 /editor/plugins/animation_blend_space_2d_editor.cpp | |
| parent | ae5668f81e9ed7ae9e9a13b120d89de884b718be (diff) | |
| parent | 9be288edf9475d4e85b533dd4681bbccd471f6d5 (diff) | |
| download | redot-engine-c39223e0db14b58bf48aafc22497d076a4540966.tar.gz | |
Merge pull request #62623 from TokageItLab/refactor-sync-animtree
Add `sync` to `NodeTransition` and `BlendSpace1D/2D` and refactor `sync` in `AnimationTree`
Diffstat (limited to 'editor/plugins/animation_blend_space_2d_editor.cpp')
| -rw-r--r-- | editor/plugins/animation_blend_space_2d_editor.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index dfde63ecb6..51aaa4f010 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -595,6 +595,7 @@ void AnimationNodeBlendSpace2DEditor::_update_space() { auto_triangles->set_pressed(blend_space->get_auto_triangles()); + sync->set_pressed(blend_space->is_using_sync()); interpolation->select(blend_space->get_blend_mode()); max_x_value->set_value(blend_space->get_max_space().x); @@ -620,13 +621,15 @@ void AnimationNodeBlendSpace2DEditor::_config_changed(double) { } updating = true; - undo_redo->create_action(TTR("Change BlendSpace2D Limits")); + undo_redo->create_action(TTR("Change BlendSpace2D Config")); undo_redo->add_do_method(blend_space.ptr(), "set_max_space", Vector2(max_x_value->get_value(), max_y_value->get_value())); undo_redo->add_undo_method(blend_space.ptr(), "set_max_space", blend_space->get_max_space()); undo_redo->add_do_method(blend_space.ptr(), "set_min_space", Vector2(min_x_value->get_value(), min_y_value->get_value())); undo_redo->add_undo_method(blend_space.ptr(), "set_min_space", blend_space->get_min_space()); undo_redo->add_do_method(blend_space.ptr(), "set_snap", Vector2(snap_x->get_value(), snap_y->get_value())); undo_redo->add_undo_method(blend_space.ptr(), "set_snap", blend_space->get_snap()); + undo_redo->add_do_method(blend_space.ptr(), "set_use_sync", sync->is_pressed()); + undo_redo->add_undo_method(blend_space.ptr(), "set_use_sync", blend_space->is_using_sync()); undo_redo->add_do_method(blend_space.ptr(), "set_blend_mode", interpolation->get_selected()); undo_redo->add_undo_method(blend_space.ptr(), "set_blend_mode", blend_space->get_blend_mode()); undo_redo->add_do_method(this, "_update_space"); @@ -899,6 +902,13 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(memnew(VSeparator)); + top_hb->add_child(memnew(Label(TTR("Sync:")))); + sync = memnew(CheckBox); + top_hb->add_child(sync); + sync->connect("toggled", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed)); + + top_hb->add_child(memnew(VSeparator)); + top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); |
