summaryrefslogtreecommitdiff
path: root/editor/editor_dir_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_dir_dialog.cpp')
-rw-r--r--editor/editor_dir_dialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp
index 32ef87a4ab..866f28c03b 100644
--- a/editor/editor_dir_dialog.cpp
+++ b/editor/editor_dir_dialog.cpp
@@ -156,10 +156,15 @@ void EditorDirDialog::_make_dir_confirm() {
String dir = ti->get_metadata(0);
+ if (EditorFileSystem::get_singleton()->get_filesystem_path(dir + makedirname->get_text())) {
+ mkdirerr->set_text(TTR("Could not create folder. File with that name already exists."));
+ mkdirerr->popup_centered();
+ return;
+ }
+
DirAccessRef d = DirAccess::open(dir);
ERR_FAIL_COND_MSG(!d, "Cannot open directory '" + dir + "'.");
Error err = d->make_dir(makedirname->get_text());
-
if (err != OK) {
mkdirerr->popup_centered(Size2(250, 80) * EDSCALE);
} else {