Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak the name for new animations in the editor #48570

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -304,7 +304,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 @@ -317,7 +317,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 @@ -756,11 +756,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