EditorFileDialog

Inherits: ConfirmationDialog < AcceptDialog < WindowDialog < Popup < Control < CanvasItem < Node < Object

A modified version of FileDialog used by the editor.

Properties

Accessaccess0
Stringcurrent_dir"res://"
Stringcurrent_file""
Stringcurrent_path"res://"
booldialog_hide_on_okO: false
booldisable_overwrite_warningfalse
DisplayModedisplay_mode0
Modemode4
boolresizableO: true
boolshow_hidden_filesfalse
Stringwindow_titleO: "Save a File"

Methods

voidadd_filter ( String filter )
voidclear_filters ( )
VBoxContainerget_vbox ( )
voidinvalidate ( )

Signals

Emitted when a directory is selected.


Emitted when a file is selected.


Emitted when multiple files are selected.

Enumerations

enum Mode:

  • MODE_OPEN_FILE = 0 — The EditorFileDialog can select only one file. Accepting the window will open the file.
  • MODE_OPEN_FILES = 1 — The EditorFileDialog can select multiple files. Accepting the window will open all files.
  • MODE_OPEN_DIR = 2 — The EditorFileDialog can select only one directory. Accepting the window will open the directory.
  • MODE_OPEN_ANY = 3 — The EditorFileDialog can select a file or directory. Accepting the window will open it.
  • MODE_SAVE_FILE = 4 — The EditorFileDialog can select only one file. Accepting the window will save the file.

enum Access:

  • ACCESS_RESOURCES = 0 — The EditorFileDialog can only view res:// directory contents.
  • ACCESS_USERDATA = 1 — The EditorFileDialog can only view user:// directory contents.
  • ACCESS_FILESYSTEM = 2 — The EditorFileDialog can view the entire local file system.

enum DisplayMode:

  • DISPLAY_THUMBNAILS = 0 — The EditorFileDialog displays resources as thumbnails.
  • DISPLAY_LIST = 1 — The EditorFileDialog displays resources as a list of filenames.

Property Descriptions

Default0
Setterset_access(value)
Getterget_access()

The location from which the user may select a file, including res://, user://, and the local file system.


Default"res://"
Setterset_current_dir(value)
Getterget_current_dir()

The currently occupied directory.


Default""
Setterset_current_file(value)
Getterget_current_file()

The currently selected file.


Default"res://"
Setterset_current_path(value)
Getterget_current_path()

The file system path in the address bar.


  • bool disable_overwrite_warning
Defaultfalse
Setterset_disable_overwrite_warning(value)
Getteris_overwrite_warning_disabled()

If true, the EditorFileDialog will not warn the user before overwriting files.


Default0
Setterset_display_mode(value)
Getterget_display_mode()

The view format in which the EditorFileDialog displays resources to the user.


Default4
Setterset_mode(value)
Getterget_mode()

The purpose of the EditorFileDialog, which defines the allowed behaviors.


  • bool show_hidden_files
Defaultfalse
Setterset_show_hidden_files(value)
Getteris_showing_hidden_files()

If true, hidden files and directories will be visible in the EditorFileDialog.

Method Descriptions

  • void add_filter ( String filter )

Adds a comma-delimited file extension filter option to the EditorFileDialog with an optional semi-colon-delimited label.

For example, "*.tscn, *.scn; Scenes" results in filter text “Scenes (*.tscn, *.scn)”.


  • void clear_filters ( )

Removes all filters except for “All Files (*)”.


Returns the VBoxContainer used to display the file system.


  • void invalidate ( )

Notify the EditorFileDialog that its view of the data is no longer accurate. Updates the view contents on next view update.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.