summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_state_machine_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_state_machine_editor.cpp')
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 49f073f245..0b2af0172c 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -50,6 +50,7 @@
#include "scene/gui/tree.h"
#include "scene/main/viewport.h"
#include "scene/main/window.h"
+#include "scene/resources/style_box_flat.h"
#include "scene/scene_string_names.h"
bool AnimationNodeStateMachineEditor::can_edit(const Ref<AnimationNode> &p_node) {
@@ -1507,6 +1508,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);
}