diff options
author | SnailRhymer <harrymilnes@hotmail.com> | 2022-05-14 17:54:14 +0100 |
---|---|---|
committer | SnailRhymer <harrymilnes@hotmail.com> | 2022-05-17 00:02:51 +0100 |
commit | d79818acb6d07c97232eb82932c91c676054ce6c (patch) | |
tree | b8c0796c1cef62c7a2fd952242b1c13e2adc8485 /editor/plugins/animation_library_editor.cpp | |
parent | 067c1eb923dd38bac7ad86da52d94394eeac44e5 (diff) | |
download | redot-engine-d79818acb6d07c97232eb82932c91c676054ce6c.tar.gz |
Fix errors and improve UX relating to new animation libraries
- Fix a bug causing an error message when a scene containing an AnimationPlayer with a reset track is saved, by correctly referencing the temporary "default" library.
- Make library dropdown in new animation window assign correct library when creating an animation.
- Similarly allow choice of library when duplicating animation.
- Make library dropdown default to library of currently selected animation.
- Make library dropdown show when exactly one library exists, and it isn't [Global]. Include [Global] on the dropdown in this case (will be newly created if dialog is confirmed).
- When appending (x) to avoid New Anim name collisions, correctly check target library instead of [Global].
- Add parentheses when appending x when duplicating animations in the library editor, for consistency.
- Change titles and prompts to be distinct in name/rename/duplicate dialiogs.
- Fix bug in OprionButton.get_selectable_item(true) when last is not selectable.
- Fix issues where animation wasn't found on deletion/rename by correctly prepending library name.
- Remove an extraneous print_line from animation_track_editor.
- Add messages to errors when an animation isn't found.
Diffstat (limited to 'editor/plugins/animation_library_editor.cpp')
-rw-r--r-- | editor/plugins/animation_library_editor.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp index b43a4215b1..363969f6d3 100644 --- a/editor/plugins/animation_library_editor.cpp +++ b/editor/plugins/animation_library_editor.cpp @@ -75,12 +75,16 @@ void AnimationLibraryEditor::_add_library_validate(const String &p_name) { add_library_validate->set_text(error); add_library_dialog->get_ok_button()->set_disabled(true); } else { - add_library_validate->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor"))); - if (p_name == "") { - add_library_validate->set_text(TTR("Global library will be created.")); + if (adding_animation) { + add_library_validate->set_text(TTR("Animation name is valid.")); } else { - add_library_validate->set_text(TTR("Library name is valid.")); + if (p_name == "") { + add_library_validate->set_text(TTR("Global library will be created.")); + } else { + add_library_validate->set_text(TTR("Library name is valid.")); + } } + add_library_validate->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor"))); add_library_dialog->get_ok_button()->set_disabled(false); } } @@ -469,7 +473,7 @@ void AnimationLibraryEditor::_button_pressed(TreeItem *p_item, int p_column, int int attempt = 1; while (al->has_animation(name)) { attempt++; - name = base_name + " " + itos(attempt); + name = base_name + " (" + itos(attempt) + ")"; } UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); |