Skip to content

Commit

Permalink
Merge pull request #48570 from Calinou/animation-editors-new-name
Browse files Browse the repository at this point in the history
Tweak the name for new animations in the editor
  • Loading branch information
akien-mga committed Jan 20, 2023
2 parents 822edfd + 23dcc33 commit 28a2463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions editor/plugins/animation_player_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void AnimationPlayerEditor::_animation_selected(int p_which) {

void AnimationPlayerEditor::_animation_new() {
int count = 1;
String base = TTR("New Anim");
String base = "new_animation";
String current_library_name = "";
if (animation->has_selectable_items()) {
String current_animation_name = animation->get_item_text(animation->get_selected());
Expand All @@ -337,7 +337,7 @@ void AnimationPlayerEditor::_animation_new() {
while (true) {
String attempt = base;
if (count > 1) {
attempt += " (" + itos(count) + ")";
attempt += vformat("_%d", count);
}
if (player->has_animation(attempt_prefix + attempt)) {
count++;
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/sprite_frames_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,11 +788,11 @@ void SpriteFramesEditor::_animation_name_edited() {
}

void SpriteFramesEditor::_animation_add() {
String name = "New Anim";
String name = "new_animation";
int counter = 0;
while (frames->has_animation(name)) {
counter++;
name = "New Anim " + itos(counter);
name = vformat("new_animation_%d", counter);
}

List<Node *> nodes;
Expand Down

0 comments on commit 28a2463

Please sign in to comment.