summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2023-01-14 16:43:33 +0000
committerPaulb23 <p_batty@hotmail.co.uk>2023-01-14 16:43:33 +0000
commit659d9b0fa313879096d0f77253f72f0dd9a31ba5 (patch)
treeee7d0f64a8385a7dc1b152a3d53d630e2c32a570
parentd2d5e548c9cac48a89b97ed4dd9bfc93b4528f0d (diff)
Globalise path for New TextFile in FileSystemDock
-rw-r--r--editor/filesystem_dock.cpp3
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 6eed3e3e61..17cdab60c8 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -2051,7 +2051,8 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
if (!fpath.ends_with("/")) {
fpath = fpath.get_base_dir();
}
- ScriptEditor::get_singleton()->open_text_file_create_dialog(fpath);
+ String dir = ProjectSettings::get_singleton()->globalize_path(fpath);
+ ScriptEditor::get_singleton()->open_text_file_create_dialog(dir);
} break;
}
}
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index caa42b677c..2ca26ff2b9 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2553,9 +2553,9 @@ void ScriptEditor::open_script_create_dialog(const String &p_base_name, const St
}
void ScriptEditor::open_text_file_create_dialog(const String &p_base_path, const String &p_base_name) {
- file_dialog->set_current_file(p_base_name);
- file_dialog->set_current_dir(p_base_path);
_menu_option(FILE_NEW_TEXTFILE);
+ file_dialog->set_current_dir(p_base_path);
+ file_dialog->set_current_file(p_base_name);
open_textfile_after_create = false;
}