diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-03-04 12:25:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 12:25:15 +0100 |
commit | 7de48982fed1bcc60ae3f4a9a08d04b167b26356 (patch) | |
tree | 90403c92bc65fd815cabc35f29be5af10daef613 /scene/gui | |
parent | 9d5d20ae6d6d19d4435edf5de1fdb3b13982b108 (diff) | |
parent | a5e30c0228ace4f5ae87e034e9370ee4f0925e54 (diff) |
Merge pull request #58691 from miremrie/absolute-file-path-in-file-browser
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/file_dialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 79aaf5c511..678229683f 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -262,7 +262,8 @@ void FileDialog::_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)) { emit_signal(SNAME("file_selected"), f); |