1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Select correct animation on creation of a new one

-  Select the correct animation when creating a new one.
- Removed unneeded new_name variable.
This commit is contained in:
bncastle
2017-11-01 15:40:58 -04:00
parent 025f138561
commit 95408c8670

View File

@@ -365,13 +365,11 @@ void SpriteFramesEditor::_animation_name_edited() {
} }
void SpriteFramesEditor::_animation_add() { void SpriteFramesEditor::_animation_add() {
String new_name = "New Anim"; String name = "New Anim";
String name = new_name;
int counter = 0; int counter = 0;
while (frames->has_animation(name)) { while (frames->has_animation(name)) {
counter++; counter++;
name = new_name + " " + itos(counter); name = "New Anim " + itos(counter);
} }
List<Node *> nodes; List<Node *> nodes;
@@ -393,7 +391,7 @@ void SpriteFramesEditor::_animation_add() {
undo_redo->add_undo_method(E->get(), "set_animation", current); undo_redo->add_undo_method(E->get(), "set_animation", current);
} }
edited_anim = new_name; edited_anim = name;
undo_redo->commit_action(); undo_redo->commit_action();
} }