You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Fix rename animation in SpriteFramesEditor/AnimationNodeStateMachineEditor
When the name suffix grows, the old name is used if it is obtained first.
Fix the case where the following error message would appear when renaming
an animation.
```
ERROR: Animation '' doesn't exist.
at: get_frame_count (scene/resources/sprite_frames.cpp:71)
```
(cherry picked from commit e9cd29cf22)
This commit is contained in:
@@ -1507,6 +1507,10 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) {
|
||||
int base = 1;
|
||||
String name = base_name;
|
||||
while (state_machine->has_node(name)) {
|
||||
if (name == prev_name) {
|
||||
name_edit_popup->hide(); // The old name wins, the name doesn't change, just hide the popup.
|
||||
return;
|
||||
}
|
||||
base++;
|
||||
name = base_name + " " + itos(base);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user