Merge pull request #42779 from volzhs/editor-file-dialog
Enhance editor file dialog
This commit is contained in:
@ -2313,7 +2313,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
int scene_idx = (p_option == FILE_SAVE_SCENE) ? -1 : tab_closing;
|
||||
|
||||
Node *scene = editor_data.get_edited_scene_root(scene_idx);
|
||||
if (scene && scene->get_filename() != "") {
|
||||
if (scene && scene->get_filename() != "" && FileAccess::exists(scene->get_filename())) {
|
||||
if (scene_idx != editor_data.get_edited_scene()) {
|
||||
_save_scene_with_preview(scene->get_filename(), scene_idx);
|
||||
} else {
|
||||
@ -2358,11 +2358,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
}
|
||||
|
||||
if (scene->get_filename() != "") {
|
||||
file->set_current_path(scene->get_filename());
|
||||
String path = scene->get_filename();
|
||||
file->set_current_path(path);
|
||||
if (extensions.size()) {
|
||||
String ext = scene->get_filename().get_extension().to_lower();
|
||||
String ext = path.get_extension().to_lower();
|
||||
if (extensions.find(ext) == nullptr) {
|
||||
file->set_current_path(scene->get_filename().replacen("." + ext, "." + extensions.front()->get()));
|
||||
file->set_current_path(path.replacen("." + ext, "." + extensions.front()->get()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user