1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Improve EditorDirDialog

* Automatically selects the newly created directory
* Automatically selects "res://" when nothing is selected
* Fixes an error when overwrite/replace dialog appears
* Changes "copy checkbox + action button" to "copy button + move button"
* Double clicking a directory (un)collapses it instead of copy/move
* Uses DirectoryCreateDialog for "Create Folder"
This commit is contained in:
Haoyu Qiu
2023-12-24 13:59:32 +08:00
parent 13a0d6e9b2
commit a42ead59da
5 changed files with 94 additions and 108 deletions

View File

@@ -110,7 +110,7 @@ void DirectoryCreateDialog::ok_pressed() {
err = da->make_dir_recursive(path);
if (err == OK) {
emit_signal(SNAME("dir_created"));
emit_signal(SNAME("dir_created"), base_dir.path_join(path));
} else {
EditorNode::get_singleton()->show_warning(TTR("Could not create folder."));
}
@@ -131,7 +131,7 @@ void DirectoryCreateDialog::config(const String &p_base_dir) {
}
void DirectoryCreateDialog::_bind_methods() {
ADD_SIGNAL(MethodInfo("dir_created"));
ADD_SIGNAL(MethodInfo("dir_created", PropertyInfo(Variant::STRING, "path")));
}
DirectoryCreateDialog::DirectoryCreateDialog() {