2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 21:18:53 +08:00
<class name= "FileDialog" inherits= "ConfirmationDialog" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-13 04:42:36 +08:00
<brief_description >
Dialog for selecting files or directories in the filesystem.
</brief_description>
<description >
2020-06-05 21:47:45 +08:00
FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The 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].
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_filter" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
<argument index= "0" name= "filter" type= "String" />
2022-07-05 05:26:26 +08:00
<argument index= "1" name= "description" type= "String" default= """" />
2017-09-13 04:42:36 +08:00
<description >
2022-07-05 05:26:26 +08:00
Adds a comma-delimited file name [code]filter[/code] option to the [FileDialog] with an optional [code]description[/code], which restricts what files can be picked.
A [code]filter[/code] 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 [code]filter[/code] of [code]"*.png, *.jpg"[/code] and a [code]description[/code] of [code]"Images"[/code] results in filter text "Images (*.png, *.jpg)".
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "clear_filters" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2017-09-13 04:42:36 +08:00
<description >
Clear all the added filters in the dialog.
</description>
</method>
2020-12-21 18:26:41 +08:00
<method name= "deselect_all" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2017-11-28 06:37:47 +08:00
<description >
2020-12-21 18:26:41 +08:00
Clear all currently selected items in the dialog.
2017-11-28 06:37:47 +08:00
</description>
</method>
2018-06-12 00:41:16 +08:00
<method name= "get_line_edit" >
2021-07-30 21:28:05 +08:00
<return type= "LineEdit" />
2018-06-12 00:41:16 +08:00
<description >
2018-10-12 01:28:36 +08:00
Returns the LineEdit for the selected file.
2021-10-11 03:28:56 +08: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.
2018-06-12 00:41:16 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_vbox" >
2021-07-30 21:28:05 +08:00
<return type= "VBoxContainer" />
2017-09-13 04:42:36 +08:00
<description >
2019-05-24 10:15:43 +08:00
Returns the vertical box container of the dialog, custom controls can be added to it.
2021-10-11 03:28:56 +08: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-13 04:42:36 +08:00
</description>
</method>
<method name= "invalidate" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2017-09-13 04:42:36 +08:00
<description >
Invalidate and update the current dialog content list.
</description>
</method>
</methods>
<members >
2019-06-29 18:38:01 +08:00
<member name= "access" type= "int" setter= "set_access" getter= "get_access" enum= "FileDialog.Access" default= "0" >
2018-10-12 01:28:36 +08:00
The file system access scope. See enum [code]Access[/code] constants.
2020-09-01 06:58:51 +08:00
[b]Warning:[/b] Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url].
2017-09-13 04:42:36 +08:00
</member>
2021-10-30 02:15:33 +08:00
<member name= "current_dir" type= "String" setter= "set_current_dir" getter= "get_current_dir" >
2018-01-12 06:38:35 +08:00
The current working directory of the file dialog.
</member>
2021-10-30 02:15:33 +08:00
<member name= "current_file" type= "String" setter= "set_current_file" getter= "get_current_file" >
2018-01-12 06:38:35 +08:00
The currently selected file of the file dialog.
</member>
2021-10-30 02:15:33 +08:00
<member name= "current_path" type= "String" setter= "set_current_path" getter= "get_current_path" >
2018-01-12 06:38:35 +08:00
The currently selected file path of the file dialog.
</member>
2021-12-03 03:38:49 +08:00
<member name= "dialog_hide_on_ok" type= "bool" setter= "set_hide_on_ok" getter= "get_hide_on_ok" overrides= "AcceptDialog" default= "false" />
2020-03-31 17:56:58 +08:00
<member name= "file_mode" type= "int" setter= "set_file_mode" getter= "get_file_mode" enum= "FileDialog.FileMode" default= "4" >
The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
</member>
2019-09-25 01:45:03 +08:00
<member name= "filters" type= "PackedStringArray" setter= "set_filters" getter= "get_filters" default= "PackedStringArray()" >
2022-01-11 12:38:25 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "mode_overrides_title" type= "bool" setter= "set_mode_overrides_title" getter= "is_mode_overriding_title" default= "true" >
2020-03-31 17:56:58 +08:00
If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File").
2017-12-03 09:54:06 +08:00
</member>
2022-03-13 08:35:20 +08:00
<member name= "root_subfolder" type= "String" setter= "set_root_subfolder" getter= "get_root_subfolder" default= """" >
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.
</member>
2019-06-29 18:38:01 +08:00
<member name= "show_hidden_files" type= "bool" setter= "set_show_hidden_files" getter= "is_showing_hidden_files" default= "false" >
2018-10-12 01:28:36 +08:00
If [code]true[/code], the dialog will show hidden files.
2017-09-13 04:42:36 +08:00
</member>
2021-12-03 03:38:49 +08:00
<member name= "title" type= "String" setter= "set_title" getter= "get_title" overrides= "Window" default= ""Save a File"" />
2017-09-13 04:42:36 +08:00
</members>
<signals >
<signal name= "dir_selected" >
2021-07-30 21:28:05 +08:00
<argument index= "0" name= "dir" type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
Emitted when the user selects a directory.
2017-09-13 04:42:36 +08:00
</description>
</signal>
<signal name= "file_selected" >
2021-07-30 21:28:05 +08:00
<argument index= "0" name= "path" type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
Emitted when the user selects a file by double-clicking it or pressing the [b]OK[/b] button.
2017-09-13 04:42:36 +08:00
</description>
</signal>
<signal name= "files_selected" >
2021-07-30 21:28:05 +08:00
<argument index= "0" name= "paths" type= "PackedStringArray" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
Emitted when the user selects multiple files.
2017-09-13 04:42:36 +08:00
</description>
</signal>
</signals>
<constants >
2020-03-31 17:56:58 +08:00
<constant name= "FILE_MODE_OPEN_FILE" value= "0" enum= "FileMode" >
2019-06-22 07:04:47 +08:00
The dialog allows selecting one, and only one file.
2017-09-13 04:42:36 +08:00
</constant>
2020-03-31 17:56:58 +08:00
<constant name= "FILE_MODE_OPEN_FILES" value= "1" enum= "FileMode" >
2019-06-22 07:04:47 +08:00
The dialog allows selecting multiple files.
2017-09-13 04:42:36 +08:00
</constant>
2020-03-31 17:56:58 +08:00
<constant name= "FILE_MODE_OPEN_DIR" value= "2" enum= "FileMode" >
2019-06-22 07:04:47 +08:00
The dialog only allows selecting a directory, disallowing the selection of any file.
2017-09-13 04:42:36 +08:00
</constant>
2020-03-31 17:56:58 +08:00
<constant name= "FILE_MODE_OPEN_ANY" value= "3" enum= "FileMode" >
2019-06-22 07:04:47 +08:00
The dialog allows selecting one file or directory.
2017-09-13 04:42:36 +08:00
</constant>
2020-03-31 17:56:58 +08:00
<constant name= "FILE_MODE_SAVE_FILE" value= "4" enum= "FileMode" >
2017-09-13 04:42:36 +08:00
The dialog will warn when a file exists.
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ACCESS_RESOURCES" value= "0" enum= "Access" >
2019-06-22 07:04:47 +08:00
The dialog only allows accessing files under the [Resource] path ([code]res://[/code]).
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ACCESS_USERDATA" value= "1" enum= "Access" >
2019-06-22 07:04:47 +08:00
The dialog only allows accessing files under user data path ([code]user://[/code]).
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ACCESS_FILESYSTEM" value= "2" enum= "Access" >
2019-06-22 07:04:47 +08:00
The dialog allows accessing files on the whole file system.
2017-09-13 04:42:36 +08:00
</constant>
</constants>
<theme_items >
2021-08-05 00:54:41 +08:00
<theme_item name= "file_icon_modulate" data_type= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-06-08 20:41:45 +08:00
The color modulation applied to the file icon.
</theme_item>
2022-05-20 22:07:49 +08:00
<theme_item name= "files_disabled" data_type= "color" type= "Color" default= "Color(1, 1, 1, 0.25)" >
2020-03-04 02:21:21 +08:00
The color tint for disabled files (when the [FileDialog] is used in open folder mode).
2017-09-13 04:42:36 +08:00
</theme_item>
2021-08-05 00:54:41 +08:00
<theme_item name= "folder_icon_modulate" data_type= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-03-04 02:21:21 +08:00
The color modulation applied to the folder icon.
2019-08-22 00:43:01 +08:00
</theme_item>
2021-12-02 02:02:20 +08:00
<theme_item name= "back_folder" data_type= "icon" type= "Texture2D" >
Custom icon for the back arrow.
</theme_item>
<theme_item name= "file" data_type= "icon" type= "Texture2D" >
Custom icon for files.
</theme_item>
<theme_item name= "folder" data_type= "icon" type= "Texture2D" >
Custom icon for folders.
</theme_item>
2021-08-05 00:54:41 +08:00
<theme_item name= "forward_folder" data_type= "icon" type= "Texture2D" >
2021-03-19 20:01:03 +08:00
Custom icon for the forward arrow.
</theme_item>
2021-08-05 00:54:41 +08:00
<theme_item name= "parent_folder" data_type= "icon" type= "Texture2D" >
2020-03-04 02:21:21 +08:00
Custom icon for the parent folder arrow.
2017-12-07 15:23:08 +08:00
</theme_item>
2021-08-05 00:54:41 +08:00
<theme_item name= "reload" data_type= "icon" type= "Texture2D" >
2020-03-04 02:21:21 +08:00
Custom icon for the reload button.
2017-09-13 04:42:36 +08:00
</theme_item>
2021-08-05 00:54:41 +08:00
<theme_item name= "toggle_hidden" data_type= "icon" type= "Texture2D" >
2020-03-04 02:21:21 +08:00
Custom icon for the toggle hidden button.
2019-06-15 06:04:55 +08:00
</theme_item>
2017-09-13 04:42:36 +08:00
</theme_items>
</class>