summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authormiremrie <dusanmirkovic89@gmail.com>2022-03-01 20:29:19 +0100
committermiremrie <dusanmirkovic89@gmail.com>2022-03-02 19:42:39 +0100
commita5e30c0228ace4f5ae87e034e9370ee4f0925e54 (patch)
treebcf121c547e94464c518f4d311a1a3b8e3bbec3d /editor
parente6f00a0f73a0332366741c2de31c0f5b9a1079dc (diff)
Allow absolute file paths in file dialogs
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_dialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index e6343100df..0fef4597be 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -394,7 +394,8 @@ void EditorFileDialog::_action_pressed() {
return;
}
- String f = dir_access->get_current_dir().plus_file(file->get_text());
+ String file_text = file->get_text();
+ String f = file_text.is_absolute_path() ? file_text : dir_access->get_current_dir().plus_file(file_text);
if ((mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_FILE) && dir_access->file_exists(f)) {
_save_to_recent();