123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <class name="FileDialog" inherits="ConfirmationDialog" version="3.3">
- <brief_description>
- Dialog for selecting files or directories in the filesystem.
- </brief_description>
- <description>
- 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 mode]. If you want to use a custom title, disable this by setting [member mode_overrides_title] to [code]false[/code].
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="add_filter">
- <return type="void" />
- <argument index="0" name="filter" type="String" />
- <description>
- Adds [code]filter[/code] as a custom filter; [code]filter[/code] should be of the form [code]"filename.extension ; Description"[/code]. For example, [code]"*.png ; PNG Images"[/code].
- </description>
- </method>
- <method name="clear_filters">
- <return type="void" />
- <description>
- Clear all the added filters in the dialog.
- </description>
- </method>
- <method name="deselect_items">
- <return type="void" />
- <description>
- Clear currently selected items in the dialog.
- </description>
- </method>
- <method name="get_line_edit">
- <return type="LineEdit" />
- <description>
- Returns the LineEdit for the selected file.
- </description>
- </method>
- <method name="get_vbox">
- <return type="VBoxContainer" />
- <description>
- Returns the vertical box container of the dialog, custom controls can be added to it.
- </description>
- </method>
- <method name="invalidate">
- <return type="void" />
- <description>
- Invalidate and update the current dialog content list.
- </description>
- </method>
- </methods>
- <members>
- <member name="access" type="int" setter="set_access" getter="get_access" enum="FileDialog.Access" default="0">
- The file system access scope. See enum [code]Access[/code] constants.
- [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].
- </member>
- <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default=""res://"">
- The current working directory of the file dialog.
- </member>
- <member name="current_file" type="String" setter="set_current_file" getter="get_current_file" default="""">
- The currently selected file of the file dialog.
- </member>
- <member name="current_path" type="String" setter="set_current_path" getter="get_current_path" default=""res://"">
- The currently selected file path of the file dialog.
- </member>
- <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" override="true" default="false" />
- <member name="filters" type="PoolStringArray" setter="set_filters" getter="get_filters" default="PoolStringArray( )">
- The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PoolStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code].
- </member>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="FileDialog.Mode" default="4">
- The dialog's open or save mode, which affects the selection behavior. See enum [code]Mode[/code] constants.
- </member>
- <member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title" default="true">
- If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant MODE_OPEN_FILE] will change the window title to "Open a File").
- </member>
- <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false">
- If [code]true[/code], the dialog will show hidden files.
- </member>
- <member name="window_title" type="String" setter="set_title" getter="get_title" override="true" default=""Save a File"" />
- </members>
- <signals>
- <signal name="dir_selected">
- <argument index="0" name="dir" type="String" />
- <description>
- Emitted when the user selects a directory.
- </description>
- </signal>
- <signal name="file_selected">
- <argument index="0" name="path" type="String" />
- <description>
- Emitted when the user selects a file by double-clicking it or pressing the [b]OK[/b] button.
- </description>
- </signal>
- <signal name="files_selected">
- <argument index="0" name="paths" type="PoolStringArray" />
- <description>
- Emitted when the user selects multiple files.
- </description>
- </signal>
- </signals>
- <constants>
- <constant name="MODE_OPEN_FILE" value="0" enum="Mode">
- The dialog allows selecting one, and only one file.
- </constant>
- <constant name="MODE_OPEN_FILES" value="1" enum="Mode">
- The dialog allows selecting multiple files.
- </constant>
- <constant name="MODE_OPEN_DIR" value="2" enum="Mode">
- The dialog only allows selecting a directory, disallowing the selection of any file.
- </constant>
- <constant name="MODE_OPEN_ANY" value="3" enum="Mode">
- The dialog allows selecting one file or directory.
- </constant>
- <constant name="MODE_SAVE_FILE" value="4" enum="Mode">
- The dialog will warn when a file exists.
- </constant>
- <constant name="ACCESS_RESOURCES" value="0" enum="Access">
- The dialog only allows accessing files under the [Resource] path ([code]res://[/code]).
- </constant>
- <constant name="ACCESS_USERDATA" value="1" enum="Access">
- The dialog only allows accessing files under user data path ([code]user://[/code]).
- </constant>
- <constant name="ACCESS_FILESYSTEM" value="2" enum="Access">
- The dialog allows accessing files on the whole file system.
- </constant>
- </constants>
- <theme_items>
- <theme_item name="file" type="Texture">
- Custom icon for files.
- </theme_item>
- <theme_item name="file_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
- The color modulation applied to the file icon.
- </theme_item>
- <theme_item name="files_disabled" type="Color" default="Color( 0, 0, 0, 0.7 )">
- The color tint for disabled files (when the [FileDialog] is used in open folder mode).
- </theme_item>
- <theme_item name="folder" type="Texture">
- Custom icon for folders.
- </theme_item>
- <theme_item name="folder_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
- The color modulation applied to the folder icon.
- </theme_item>
- <theme_item name="parent_folder" type="Texture">
- Custom icon for the parent folder arrow.
- </theme_item>
- <theme_item name="reload" type="Texture">
- Custom icon for the reload button.
- </theme_item>
- <theme_item name="toggle_hidden" type="Texture">
- Custom icon for the toggle hidden button.
- </theme_item>
- </theme_items>
- </class>
|