A dialog for selecting files or directories in the filesystem.
[FileDialog] is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. [FileDialog] automatically sets its window title according to the [member file_mode]. If you want to use a custom title, disable this by setting [member mode_overrides_title] to [code]false[/code].
Adds a comma-delimited file name [param filter] option to the [FileDialog] with an optional [param description], which restricts what files can be picked. A [param filter] should be of the form [code]"filename.extension"[/code], where filename and extension can be [code]*[/code] to match any string. Filters starting with [code].[/code] (i.e. empty filenames) are not allowed. For example, a [param filter] of [code]"*.png, *.jpg"[/code] and a [param description] of [code]"Images"[/code] results in filter text "Images (*.png, *.jpg)".
Adds an additional [OptionButton] to the file dialog. If [param values] is empty, a [CheckBox] is added instead. [param default_value_index] should be an index of the value in the [param values]. If [param values] is empty it should be either [code]1[/code] (checked), or [code]0[/code] (unchecked).
Clear the filter for file names.
Clear all the added filters in the dialog.
Clear all currently selected items in the dialog.
Returns the LineEdit for the selected file. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
Returns the default value index of the [OptionButton] or [CheckBox] with index [param option].
Returns the name of the [OptionButton] or [CheckBox] with index [param option].
Returns an array of values of the [OptionButton] with index [param option].
Returns a [Dictionary] with the selected values of the additional [OptionButton]s and/or [CheckBox]es. [Dictionary] keys are names and values are selected value indices.
Returns the vertical box container of the dialog, custom controls can be added to it. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. [b]Note:[/b] Changes to this node are ignored by native file dialogs, use [method add_option] to add custom elements to the dialog instead.
Invalidate and update the current dialog content list. [b]Note:[/b] This method does nothing on native file dialogs.
Sets the default value index of the [OptionButton] or [CheckBox] with index [param option].
Sets the name of the [OptionButton] or [CheckBox] with index [param option].
Sets the option values of the [OptionButton] with index [param option].
- The file system access scope. See [enum Access] constants. [b]Warning:[/b] In Web builds, FileDialog cannot access the host file system. In sandboxed Linux and macOS environments, [member use_native_dialog] is automatically used to allow limited access to host file system.
- The current working directory of the file dialog. [b]Note:[/b] For native file dialogs, this property is only treated as a hint and may not be respected by specific OS implementations.
- The currently selected file of the file dialog.
- The currently selected file path of the file dialog.
- The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
- The filter for file names (case-insensitive). When set to a non-empty string, only files that contains the substring will be shown. [member filename_filter] can be edited by the user with the filter button at the top of the file dialog. See also [member filters], which should be used to restrict the file types that can be selected instead of [member filename_filter] which is meant to be set by the user.
- The available file type filters. Each filter string in the array should be formatted like this: [code]*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg[/code]. The description text of the filter is optional and can be omitted. Both file extensions and MIME type should be always set. [b]Note:[/b] Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types.
- If [code]true[/code], changing the [member file_mode] property will set the window title accordingly (e.g. setting [member file_mode] to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File").
- The number of additional [OptionButton]s and [CheckBox]es in the dialog.
- If non-empty, the given sub-folder will be "root" of this [FileDialog], i.e. user won't be able to go to its parent directory. [b]Note:[/b] This property is ignored by native file dialogs.
- If [code]true[/code], the dialog will show hidden files. [b]Note:[/b] This property is ignored by native file dialogs on Android and Linux.
- If [code]true[/code], and if supported by the current [DisplayServer], OS native dialog will be used instead of custom one. [b]Note:[/b] On Android, it is only supported when using [constant ACCESS_FILESYSTEM]. For access mode [constant ACCESS_RESOURCES] and [constant ACCESS_USERDATA], the system will fall back to custom FileDialog. [b]Note:[/b] On Linux and macOS, sandboxed apps always use native dialogs to access the host file system. [b]Note:[/b] On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks. [b]Note:[/b] Native dialogs are isolated from the base process, file dialog properties can't be modified once the dialog is shown.
Emitted when the user selects a directory.
Emitted when the user selects a file by double-clicking it or pressing the [b]OK[/b] button.
Emitted when the filter for file names changes.
Emitted when the user selects multiple files.
The dialog allows selecting one, and only one file.
The dialog allows selecting multiple files.
The dialog only allows selecting a directory, disallowing the selection of any file.
The dialog allows selecting one file or directory.
The dialog will warn when a file exists.
The dialog only allows accessing files under the [Resource] path ([code]res://[/code]).
The dialog only allows accessing files under user data path ([code]user://[/code]).
The dialog allows accessing files on the whole file system.
The color tint for disabled files (when the [FileDialog] is used in open folder mode).
The color modulation applied to the file icon.
The color modulation applied to the folder icon.
Custom icon for the back arrow.
Custom icon for the create folder button.
Custom icon for files.
Custom icon for folders.
Custom icon for the forward arrow.
Custom icon for the parent folder arrow.
Custom icon for the reload button.
Custom icon for the toggle button for the filter for file names.
Custom icon for the toggle hidden button.