summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-20 08:50:40 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-20 08:50:40 +0100
commit28a24639c3c6a95b5b9828f5f02bf0dc2f5ce54b (patch)
tree10c25a323bc00c1a0609cc26b99ae5677b7e5e82
parent822edfdb40f926bed3f1eb7db40273e52317c316 (diff)
parent23dcc3345bb4b81a2801c143767fdc57b6715dd7 (diff)
Merge pull request #48570 from Calinou/animation-editors-new-name
Tweak the name for new animations in the editor
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp4
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index caee7514d0..06241d07cf 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -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());
@@ -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++;
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 75e1199a6e..74c9286325 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -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;