1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Tweak the name for new animations in the editor

- Use snake_case to "suggest" the naming that fits the Godot style guide.
- Fully spell out "new_animation" since both editors can fit it in full.
- Don't internationalize the new animation name to have consistent
  behavior between both editors.
  - Since the recommendation is to follow snake_case, special characters
    should also be avoided in the name to make animations easier to refer
    to in code.
This commit is contained in:
Hugo Locurcio
2021-05-09 09:06:37 +02:00
parent 98d5b37a4c
commit 23dcc3345b
2 changed files with 4 additions and 4 deletions

View File

@@ -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());
@@ -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++;