diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-04 15:44:29 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-04 15:44:29 +0200 |
commit | 4321806e46047c0a97f56919a60f6632adb92823 (patch) | |
tree | bd5f0d10bc919b8a7c33b4ee1054bab0d2101853 | |
parent | 46b8f4a85996aacafa85bbe2bf5d189c0091784c (diff) | |
parent | 2d9ba45e7676cbab55e58ae29f32b12b4c49e530 (diff) | |
download | redot-engine-4321806e46047c0a97f56919a60f6632adb92823.tar.gz |
Merge pull request #82743 from bruvzg/fd_no_editor
[File Dialog] Do not open native file dialogs in the edited scene.
-rw-r--r-- | scene/gui/file_dialog.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index b4649c2401..be05273a09 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -56,6 +56,12 @@ void FileDialog::_focus_file_text() { } void FileDialog::popup(const Rect2i &p_rect) { +#ifdef TOOLS_ENABLED + if (is_part_of_edited_scene()) { + ConfirmationDialog::popup(p_rect); + } +#endif + if (access == ACCESS_FILESYSTEM && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG) && (use_native_dialog || OS::get_singleton()->is_sandboxed())) { DisplayServer::get_singleton()->file_dialog_show(get_title(), dir->get_text(), file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, callable_mp(this, &FileDialog::_native_dialog_cb)); } else { @@ -64,6 +70,13 @@ void FileDialog::popup(const Rect2i &p_rect) { } void FileDialog::set_visible(bool p_visible) { +#ifdef TOOLS_ENABLED + if (is_part_of_edited_scene()) { + ConfirmationDialog::set_visible(p_visible); + return; + } +#endif + if (access == ACCESS_FILESYSTEM && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG) && (use_native_dialog || OS::get_singleton()->is_sandboxed())) { if (p_visible) { DisplayServer::get_singleton()->file_dialog_show(get_title(), dir->get_text(), file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, callable_mp(this, &FileDialog::_native_dialog_cb)); |