diff options
| author | Juan Linietsky | 2017-09-01 14:25:01 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-09-01 14:25:01 -0300 |
| commit | 5f8df8bc11ffd9b13138b085ded1640737e24c19 (patch) | |
| tree | 91b0c8f5d025c4fa7a08c5f468b4047c1a441cc8 /editor/script_create_dialog.cpp | |
| parent | 8f30c52a3751586edab6d7482425075aef8de6e3 (diff) | |
| download | godot-5f8df8bc11ffd9b13138b085ded1640737e24c19.tar.gz godot-5f8df8bc11ffd9b13138b085ded1640737e24c19.tar.zst godot-5f8df8bc11ffd9b13138b085ded1640737e24c19.zip | |
Diffstat (limited to 'editor/script_create_dialog.cpp')
| -rw-r--r-- | editor/script_create_dialog.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index d0e2e0c24..089c054b5 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -352,9 +352,16 @@ void ScriptCreateDialog::_path_changed(const String &p_path) { /* Does file already exist */ DirAccess *f = DirAccess::create(DirAccess::ACCESS_RESOURCES); - if (f->file_exists(p) && !(f->current_is_dir())) { + if (f->dir_exists(p)) { + is_new_script_created = false; + is_path_valid = false; + _msg_path_valid(false, TTR("Directory of the same name exists")); + } else if (f->file_exists(p)) { is_new_script_created = false; is_path_valid = true; + _msg_path_valid(true, TTR("File exists, will be reused")); + } else { + path_error_label->set_text(""); } memdelete(f); _update_dialog(); |
