2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 10:08:05 +02:00
<class name= "EditorFileDialog" inherits= "ConfirmationDialog" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 22:42:36 +02:00
<brief_description >
2020-03-03 19:21:21 +01:00
A modified version of [FileDialog] used by the editor.
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2023-04-30 16:26:09 +02:00
[EditorFileDialog] is an enhanced version of [FileDialog] available only to editor plugins. Additional features include list of favorited/recent files and the ability to see files as thumbnails grid instead of list.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_filter" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "filter" type= "String" />
<param index= "1" name= "description" type= "String" default= """" />
2017-09-12 22:42:36 +02:00
<description >
2022-08-12 18:07:53 +02:00
Adds a comma-delimited file name [param filter] option to the [EditorFileDialog] 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]"*.tscn, *.scn"[/code] and a [param description] of [code]"Scenes"[/code] results in filter text "Scenes (*.tscn, *.scn)".
2017-09-12 22:42:36 +02:00
</description>
</method>
2024-03-21 09:42:38 +01:00
<method name= "add_option" >
<return type= "void" />
<param index= "0" name= "name" type= "String" />
<param index= "1" name= "values" type= "PackedStringArray" />
<param index= "2" name= "default_value_index" type= "int" />
<description >
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).
</description>
</method>
2023-09-12 01:05:18 +02:00
<method name= "add_side_menu" >
<return type= "void" />
<param index= "0" name= "menu" type= "Control" />
<param index= "1" name= "title" type= "String" default= """" />
<description >
Adds the given [param menu] to the side of the file dialog with the given [param title] text on top. Only one side menu is allowed.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "clear_filters" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2017-12-04 23:11:31 +01:00
Removes all filters except for "All Files (*)".
2017-09-12 22:42:36 +02:00
</description>
</method>
2023-02-22 10:55:08 +01:00
<method name= "get_line_edit" >
<return type= "LineEdit" />
<description >
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.
</description>
</method>
2024-03-21 09:42:38 +01:00
<method name= "get_option_default" qualifiers= "const" >
<return type= "int" />
<param index= "0" name= "option" type= "int" />
<description >
Returns the default value index of the [OptionButton] or [CheckBox] with index [param option].
</description>
</method>
<method name= "get_option_name" qualifiers= "const" >
<return type= "String" />
<param index= "0" name= "option" type= "int" />
<description >
Returns the name of the [OptionButton] or [CheckBox] with index [param option].
</description>
</method>
<method name= "get_option_values" qualifiers= "const" >
<return type= "PackedStringArray" />
<param index= "0" name= "option" type= "int" />
<description >
Returns an array of values of the [OptionButton] with index [param option].
</description>
</method>
<method name= "get_selected_options" qualifiers= "const" >
<return type= "Dictionary" />
<description >
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.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_vbox" >
2021-07-30 15:28:05 +02:00
<return type= "VBoxContainer" />
2017-09-12 22:42:36 +02:00
<description >
2023-10-02 20:11:43 +02:00
Returns the [VBoxContainer] used to display the file system.
2021-10-10 21:28:56 +02:00
[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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "invalidate" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2019-03-29 23:37:35 +01:00
Notify the [EditorFileDialog] that its view of the data is no longer accurate. Updates the view contents on next view update.
2017-09-12 22:42:36 +02:00
</description>
</method>
2024-03-21 09:42:38 +01:00
<method name= "set_option_default" >
<return type= "void" />
<param index= "0" name= "option" type= "int" />
<param index= "1" name= "default_value_index" type= "int" />
<description >
Sets the default value index of the [OptionButton] or [CheckBox] with index [param option].
</description>
</method>
<method name= "set_option_name" >
<return type= "void" />
<param index= "0" name= "option" type= "int" />
<param index= "1" name= "name" type= "String" />
<description >
Sets the name of the [OptionButton] or [CheckBox] with index [param option].
</description>
</method>
<method name= "set_option_values" >
<return type= "void" />
<param index= "0" name= "option" type= "int" />
<param index= "1" name= "values" type= "PackedStringArray" />
<description >
Sets the option values of the [OptionButton] with index [param option].
</description>
</method>
2017-09-12 22:42:36 +02:00
</methods>
2017-12-04 23:11:31 +01:00
<members >
2019-06-29 12:38:01 +02:00
<member name= "access" type= "int" setter= "set_access" getter= "get_access" enum= "EditorFileDialog.Access" default= "0" >
2017-12-04 23:11:31 +01:00
The location from which the user may select a file, including [code]res://[/code], [code]user://[/code], and the local file system.
</member>
2021-10-29 20:15:33 +02:00
<member name= "current_dir" type= "String" setter= "set_current_dir" getter= "get_current_dir" >
2017-12-04 23:11:31 +01:00
The currently occupied directory.
</member>
2021-10-29 20:15:33 +02:00
<member name= "current_file" type= "String" setter= "set_current_file" getter= "get_current_file" >
2017-12-04 23:11:31 +01:00
The currently selected file.
</member>
2021-10-29 20:15:33 +02:00
<member name= "current_path" type= "String" setter= "set_current_path" getter= "get_current_path" >
2017-12-04 23:11:31 +01:00
The file system path in the address bar.
</member>
2021-12-02 20:38:49 +01:00
<member name= "dialog_hide_on_ok" type= "bool" setter= "set_hide_on_ok" getter= "get_hide_on_ok" overrides= "AcceptDialog" default= "false" />
2019-06-29 12:38:01 +02:00
<member name= "disable_overwrite_warning" type= "bool" setter= "set_disable_overwrite_warning" getter= "is_overwrite_warning_disabled" default= "false" >
2019-03-29 23:37:35 +01:00
If [code]true[/code], the [EditorFileDialog] will not warn the user before overwriting files.
2017-12-04 23:11:31 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "display_mode" type= "int" setter= "set_display_mode" getter= "get_display_mode" enum= "EditorFileDialog.DisplayMode" default= "0" >
2019-03-29 23:37:35 +01:00
The view format in which the [EditorFileDialog] displays resources to the user.
2017-12-07 08:23:08 +01:00
</member>
2020-03-31 11:56:58 +02:00
<member name= "file_mode" type= "int" setter= "set_file_mode" getter= "get_file_mode" enum= "EditorFileDialog.FileMode" default= "4" >
2023-03-09 07:56:23 +01:00
The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
2017-12-07 08:23:08 +01:00
</member>
2023-02-22 10:55:08 +01:00
<member name= "filters" type= "PackedStringArray" setter= "set_filters" getter= "get_filters" default= "PackedStringArray()" >
The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code]. Multiple file types can also be specified in a single filter. [code]"*.png, *.jpg, *.jpeg ; Supported Images"[/code] will show both PNG and JPEG files when selected.
</member>
2024-03-21 09:42:38 +01:00
<member name= "option_count" type= "int" setter= "set_option_count" getter= "get_option_count" default= "0" >
The number of additional [OptionButton]s and [CheckBox]es in the dialog.
</member>
2019-06-29 12:38:01 +02:00
<member name= "show_hidden_files" type= "bool" setter= "set_show_hidden_files" getter= "is_showing_hidden_files" default= "false" >
2022-10-06 21:59:48 +02:00
If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog]. This property is synchronized with [member EditorSettings.filesystem/file_dialog/show_hidden_files].
2017-12-07 08:23:08 +01:00
</member>
2021-12-02 20:38:49 +01:00
<member name= "title" type= "String" setter= "set_title" getter= "get_title" overrides= "Window" default= ""Save a File"" />
2017-12-04 23:11:31 +01:00
</members>
2017-09-12 22:42:36 +02:00
<signals >
<signal name= "dir_selected" >
2022-08-06 20:11:48 +02:00
<param index= "0" name= "dir" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2017-12-04 23:11:31 +01:00
Emitted when a directory is selected.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "file_selected" >
2022-08-06 20:11:48 +02:00
<param index= "0" name= "path" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2017-12-04 23:11:31 +01:00
Emitted when a file is selected.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "files_selected" >
2022-08-06 20:11:48 +02:00
<param index= "0" name= "paths" type= "PackedStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2017-12-04 23:11:31 +01:00
Emitted when multiple files are selected.
2017-09-12 22:42:36 +02:00
</description>
</signal>
</signals>
<constants >
2020-03-31 11:56:58 +02:00
<constant name= "FILE_MODE_OPEN_FILE" value= "0" enum= "FileMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can select only one file. Accepting the window will open the file.
2017-09-12 22:42:36 +02:00
</constant>
2020-03-31 11:56:58 +02:00
<constant name= "FILE_MODE_OPEN_FILES" value= "1" enum= "FileMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can select multiple files. Accepting the window will open all files.
2017-09-12 22:42:36 +02:00
</constant>
2020-03-31 11:56:58 +02:00
<constant name= "FILE_MODE_OPEN_DIR" value= "2" enum= "FileMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can select only one directory. Accepting the window will open the directory.
2017-09-12 22:42:36 +02:00
</constant>
2020-03-31 11:56:58 +02:00
<constant name= "FILE_MODE_OPEN_ANY" value= "3" enum= "FileMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can select a file or directory. Accepting the window will open it.
2017-09-12 22:42:36 +02:00
</constant>
2020-03-31 11:56:58 +02:00
<constant name= "FILE_MODE_SAVE_FILE" value= "4" enum= "FileMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can select only one file. Accepting the window will save the file.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ACCESS_RESOURCES" value= "0" enum= "Access" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can only view [code]res://[/code] directory contents.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ACCESS_USERDATA" value= "1" enum= "Access" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can only view [code]user://[/code] directory contents.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ACCESS_FILESYSTEM" value= "2" enum= "Access" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] can view the entire local file system.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DISPLAY_THUMBNAILS" value= "0" enum= "DisplayMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] displays resources as thumbnails.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DISPLAY_LIST" value= "1" enum= "DisplayMode" >
2019-03-29 23:37:35 +01:00
The [EditorFileDialog] displays resources as a list of filenames.
2017-09-16 01:46:14 +02:00
</constant>
2017-09-12 22:42:36 +02:00
</constants>
</class>