Browse Source

Update FileDialog filters documentation

RedMser 1 year ago
parent
commit
6415ac27ec
2 changed files with 3 additions and 1 deletions
  1. 2 0
      doc/classes/DisplayServer.xml
  2. 1 1
      doc/classes/FileDialog.xml

+ 2 - 0
doc/classes/DisplayServer.xml

@@ -136,6 +136,7 @@
 			<param index="6" name="callback" type="Callable" />
 			<param index="6" name="callback" type="Callable" />
 			<description>
 			<description>
 				Displays OS native dialog for selecting files or directories in the file system.
 				Displays OS native dialog for selecting files or directories in the file system.
+				Each filter string in the [param filters] array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters].
 				Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int[/code].
 				Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int[/code].
 				[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
 				[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
 				[b]Note:[/b] [param current_directory] might be ignored.
 				[b]Note:[/b] [param current_directory] might be ignored.
@@ -157,6 +158,7 @@
 			<param index="8" name="callback" type="Callable" />
 			<param index="8" name="callback" type="Callable" />
 			<description>
 			<description>
 				Displays OS native dialog for selecting files or directories in the file system with additional user selectable options.
 				Displays OS native dialog for selecting files or directories in the file system with additional user selectable options.
+				Each filter string in the [param filters] array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters].
 				[param options] is array of [Dictionary]s with the following keys:
 				[param options] is array of [Dictionary]s with the following keys:
 				- [code]"name"[/code] - option's name [String].
 				- [code]"name"[/code] - option's name [String].
 				- [code]"values"[/code] - [PackedStringArray] of values. If empty, boolean option (check box) is used.
 				- [code]"values"[/code] - [PackedStringArray] of values. If empty, boolean option (check box) is used.

+ 1 - 1
doc/classes/FileDialog.xml

@@ -131,7 +131,7 @@
 			The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
 			The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
 		</member>
 		</member>
 		<member name="filters" type="PackedStringArray" setter="set_filters" getter="get_filters" default="PackedStringArray()">
 		<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.
+			The available file type filters. Each filter string in the array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted.
 		</member>
 		</member>
 		<member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title" default="true">
 		<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 [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").
 			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").