class_editorfiledialog.rst 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorFileDialog.xml.
  6. .. _class_EditorFileDialog:
  7. EditorFileDialog
  8. ================
  9. **Inherits:** :ref:`ConfirmationDialog<class_ConfirmationDialog>` **<** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`Window<class_Window>` **<** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A modified version of :ref:`FileDialog<class_FileDialog>` used by the editor.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **EditorFileDialog** is an enhanced version of :ref:`FileDialog<class_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.
  15. Unlike :ref:`FileDialog<class_FileDialog>`, **EditorFileDialog** does not have a property for using native dialogs. Instead, native dialogs can be enabled globally via the :ref:`EditorSettings.interface/editor/use_native_file_dialogs<class_EditorSettings_property_interface/editor/use_native_file_dialogs>` editor setting. They are also enabled automatically when running in sandbox (e.g. on macOS).
  16. \ **Note:** **EditorFileDialog** is invisible by default. To make it visible, call one of the ``popup_*`` methods from :ref:`Window<class_Window>` on the node, such as :ref:`Window.popup_centered_clamped()<class_Window_method_popup_centered_clamped>`.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  23. | :ref:`Access<enum_EditorFileDialog_Access>` | :ref:`access<class_EditorFileDialog_property_access>` | ``0`` |
  24. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_String>` | :ref:`current_dir<class_EditorFileDialog_property_current_dir>` | |
  26. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  27. | :ref:`String<class_String>` | :ref:`current_file<class_EditorFileDialog_property_current_file>` | |
  28. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  29. | :ref:`String<class_String>` | :ref:`current_path<class_EditorFileDialog_property_current_path>` | |
  30. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_dialog_hide_on_ok>`) |
  32. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`disable_overwrite_warning<class_EditorFileDialog_property_disable_overwrite_warning>` | ``false`` |
  34. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  35. | :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` | :ref:`display_mode<class_EditorFileDialog_property_display_mode>` | ``0`` |
  36. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  37. | :ref:`FileMode<enum_EditorFileDialog_FileMode>` | :ref:`file_mode<class_EditorFileDialog_property_file_mode>` | ``4`` |
  38. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  39. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`filters<class_EditorFileDialog_property_filters>` | ``PackedStringArray()`` |
  40. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`option_count<class_EditorFileDialog_property_option_count>` | ``0`` |
  42. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`show_hidden_files<class_EditorFileDialog_property_show_hidden_files>` | ``false`` |
  44. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  45. | :ref:`String<class_String>` | title | ``"Save a File"`` (overrides :ref:`Window<class_Window_property_title>`) |
  46. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  47. .. rst-class:: classref-reftable-group
  48. Methods
  49. -------
  50. .. table::
  51. :widths: auto
  52. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | |void| | :ref:`add_filter<class_EditorFileDialog_method_add_filter>`\ (\ filter\: :ref:`String<class_String>`, description\: :ref:`String<class_String>` = ""\ ) |
  54. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | |void| | :ref:`add_option<class_EditorFileDialog_method_add_option>`\ (\ name\: :ref:`String<class_String>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`, default_value_index\: :ref:`int<class_int>`\ ) |
  56. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | |void| | :ref:`add_side_menu<class_EditorFileDialog_method_add_side_menu>`\ (\ menu\: :ref:`Control<class_Control>`, title\: :ref:`String<class_String>` = ""\ ) |
  58. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | |void| | :ref:`clear_filename_filter<class_EditorFileDialog_method_clear_filename_filter>`\ (\ ) |
  60. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | |void| | :ref:`clear_filters<class_EditorFileDialog_method_clear_filters>`\ (\ ) |
  62. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_String>` | :ref:`get_filename_filter<class_EditorFileDialog_method_get_filename_filter>`\ (\ ) |const| |
  64. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`LineEdit<class_LineEdit>` | :ref:`get_line_edit<class_EditorFileDialog_method_get_line_edit>`\ (\ ) |
  66. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`int<class_int>` | :ref:`get_option_default<class_EditorFileDialog_method_get_option_default>`\ (\ option\: :ref:`int<class_int>`\ ) |const| |
  68. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`String<class_String>` | :ref:`get_option_name<class_EditorFileDialog_method_get_option_name>`\ (\ option\: :ref:`int<class_int>`\ ) |const| |
  70. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_option_values<class_EditorFileDialog_method_get_option_values>`\ (\ option\: :ref:`int<class_int>`\ ) |const| |
  72. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_selected_options<class_EditorFileDialog_method_get_selected_options>`\ (\ ) |const| |
  74. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`VBoxContainer<class_VBoxContainer>` | :ref:`get_vbox<class_EditorFileDialog_method_get_vbox>`\ (\ ) |
  76. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | |void| | :ref:`invalidate<class_EditorFileDialog_method_invalidate>`\ (\ ) |
  78. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | |void| | :ref:`popup_file_dialog<class_EditorFileDialog_method_popup_file_dialog>`\ (\ ) |
  80. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | |void| | :ref:`set_filename_filter<class_EditorFileDialog_method_set_filename_filter>`\ (\ filter\: :ref:`String<class_String>`\ ) |
  82. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | |void| | :ref:`set_option_default<class_EditorFileDialog_method_set_option_default>`\ (\ option\: :ref:`int<class_int>`, default_value_index\: :ref:`int<class_int>`\ ) |
  84. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | |void| | :ref:`set_option_name<class_EditorFileDialog_method_set_option_name>`\ (\ option\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
  86. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | |void| | :ref:`set_option_values<class_EditorFileDialog_method_set_option_values>`\ (\ option\: :ref:`int<class_int>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) |
  88. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. .. rst-class:: classref-section-separator
  90. ----
  91. .. rst-class:: classref-descriptions-group
  92. Signals
  93. -------
  94. .. _class_EditorFileDialog_signal_dir_selected:
  95. .. rst-class:: classref-signal
  96. **dir_selected**\ (\ dir\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileDialog_signal_dir_selected>`
  97. Emitted when a directory is selected.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_EditorFileDialog_signal_file_selected:
  101. .. rst-class:: classref-signal
  102. **file_selected**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileDialog_signal_file_selected>`
  103. Emitted when a file is selected.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_EditorFileDialog_signal_filename_filter_changed:
  107. .. rst-class:: classref-signal
  108. **filename_filter_changed**\ (\ filter\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileDialog_signal_filename_filter_changed>`
  109. Emitted when the filter for file names changes.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_EditorFileDialog_signal_files_selected:
  113. .. rst-class:: classref-signal
  114. **files_selected**\ (\ paths\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_EditorFileDialog_signal_files_selected>`
  115. Emitted when multiple files are selected.
  116. .. rst-class:: classref-section-separator
  117. ----
  118. .. rst-class:: classref-descriptions-group
  119. Enumerations
  120. ------------
  121. .. _enum_EditorFileDialog_FileMode:
  122. .. rst-class:: classref-enumeration
  123. enum **FileMode**: :ref:`🔗<enum_EditorFileDialog_FileMode>`
  124. .. _class_EditorFileDialog_constant_FILE_MODE_OPEN_FILE:
  125. .. rst-class:: classref-enumeration-constant
  126. :ref:`FileMode<enum_EditorFileDialog_FileMode>` **FILE_MODE_OPEN_FILE** = ``0``
  127. The **EditorFileDialog** can select only one file. Accepting the window will open the file.
  128. .. _class_EditorFileDialog_constant_FILE_MODE_OPEN_FILES:
  129. .. rst-class:: classref-enumeration-constant
  130. :ref:`FileMode<enum_EditorFileDialog_FileMode>` **FILE_MODE_OPEN_FILES** = ``1``
  131. The **EditorFileDialog** can select multiple files. Accepting the window will open all files.
  132. .. _class_EditorFileDialog_constant_FILE_MODE_OPEN_DIR:
  133. .. rst-class:: classref-enumeration-constant
  134. :ref:`FileMode<enum_EditorFileDialog_FileMode>` **FILE_MODE_OPEN_DIR** = ``2``
  135. The **EditorFileDialog** can select only one directory. Accepting the window will open the directory.
  136. .. _class_EditorFileDialog_constant_FILE_MODE_OPEN_ANY:
  137. .. rst-class:: classref-enumeration-constant
  138. :ref:`FileMode<enum_EditorFileDialog_FileMode>` **FILE_MODE_OPEN_ANY** = ``3``
  139. The **EditorFileDialog** can select a file or directory. Accepting the window will open it.
  140. .. _class_EditorFileDialog_constant_FILE_MODE_SAVE_FILE:
  141. .. rst-class:: classref-enumeration-constant
  142. :ref:`FileMode<enum_EditorFileDialog_FileMode>` **FILE_MODE_SAVE_FILE** = ``4``
  143. The **EditorFileDialog** can select only one file. Accepting the window will save the file.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _enum_EditorFileDialog_Access:
  147. .. rst-class:: classref-enumeration
  148. enum **Access**: :ref:`🔗<enum_EditorFileDialog_Access>`
  149. .. _class_EditorFileDialog_constant_ACCESS_RESOURCES:
  150. .. rst-class:: classref-enumeration-constant
  151. :ref:`Access<enum_EditorFileDialog_Access>` **ACCESS_RESOURCES** = ``0``
  152. The **EditorFileDialog** can only view ``res://`` directory contents.
  153. .. _class_EditorFileDialog_constant_ACCESS_USERDATA:
  154. .. rst-class:: classref-enumeration-constant
  155. :ref:`Access<enum_EditorFileDialog_Access>` **ACCESS_USERDATA** = ``1``
  156. The **EditorFileDialog** can only view ``user://`` directory contents.
  157. .. _class_EditorFileDialog_constant_ACCESS_FILESYSTEM:
  158. .. rst-class:: classref-enumeration-constant
  159. :ref:`Access<enum_EditorFileDialog_Access>` **ACCESS_FILESYSTEM** = ``2``
  160. The **EditorFileDialog** can view the entire local file system.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _enum_EditorFileDialog_DisplayMode:
  164. .. rst-class:: classref-enumeration
  165. enum **DisplayMode**: :ref:`🔗<enum_EditorFileDialog_DisplayMode>`
  166. .. _class_EditorFileDialog_constant_DISPLAY_THUMBNAILS:
  167. .. rst-class:: classref-enumeration-constant
  168. :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **DISPLAY_THUMBNAILS** = ``0``
  169. The **EditorFileDialog** displays resources as thumbnails.
  170. .. _class_EditorFileDialog_constant_DISPLAY_LIST:
  171. .. rst-class:: classref-enumeration-constant
  172. :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **DISPLAY_LIST** = ``1``
  173. The **EditorFileDialog** displays resources as a list of filenames.
  174. .. rst-class:: classref-section-separator
  175. ----
  176. .. rst-class:: classref-descriptions-group
  177. Property Descriptions
  178. ---------------------
  179. .. _class_EditorFileDialog_property_access:
  180. .. rst-class:: classref-property
  181. :ref:`Access<enum_EditorFileDialog_Access>` **access** = ``0`` :ref:`🔗<class_EditorFileDialog_property_access>`
  182. .. rst-class:: classref-property-setget
  183. - |void| **set_access**\ (\ value\: :ref:`Access<enum_EditorFileDialog_Access>`\ )
  184. - :ref:`Access<enum_EditorFileDialog_Access>` **get_access**\ (\ )
  185. The location from which the user may select a file, including ``res://``, ``user://``, and the local file system.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_EditorFileDialog_property_current_dir:
  189. .. rst-class:: classref-property
  190. :ref:`String<class_String>` **current_dir** :ref:`🔗<class_EditorFileDialog_property_current_dir>`
  191. .. rst-class:: classref-property-setget
  192. - |void| **set_current_dir**\ (\ value\: :ref:`String<class_String>`\ )
  193. - :ref:`String<class_String>` **get_current_dir**\ (\ )
  194. The currently occupied directory.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_EditorFileDialog_property_current_file:
  198. .. rst-class:: classref-property
  199. :ref:`String<class_String>` **current_file** :ref:`🔗<class_EditorFileDialog_property_current_file>`
  200. .. rst-class:: classref-property-setget
  201. - |void| **set_current_file**\ (\ value\: :ref:`String<class_String>`\ )
  202. - :ref:`String<class_String>` **get_current_file**\ (\ )
  203. The currently selected file.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_EditorFileDialog_property_current_path:
  207. .. rst-class:: classref-property
  208. :ref:`String<class_String>` **current_path** :ref:`🔗<class_EditorFileDialog_property_current_path>`
  209. .. rst-class:: classref-property-setget
  210. - |void| **set_current_path**\ (\ value\: :ref:`String<class_String>`\ )
  211. - :ref:`String<class_String>` **get_current_path**\ (\ )
  212. The file system path in the address bar.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_EditorFileDialog_property_disable_overwrite_warning:
  216. .. rst-class:: classref-property
  217. :ref:`bool<class_bool>` **disable_overwrite_warning** = ``false`` :ref:`🔗<class_EditorFileDialog_property_disable_overwrite_warning>`
  218. .. rst-class:: classref-property-setget
  219. - |void| **set_disable_overwrite_warning**\ (\ value\: :ref:`bool<class_bool>`\ )
  220. - :ref:`bool<class_bool>` **is_overwrite_warning_disabled**\ (\ )
  221. If ``true``, the **EditorFileDialog** will not warn the user before overwriting files.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_EditorFileDialog_property_display_mode:
  225. .. rst-class:: classref-property
  226. :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **display_mode** = ``0`` :ref:`🔗<class_EditorFileDialog_property_display_mode>`
  227. .. rst-class:: classref-property-setget
  228. - |void| **set_display_mode**\ (\ value\: :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>`\ )
  229. - :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **get_display_mode**\ (\ )
  230. The view format in which the **EditorFileDialog** displays resources to the user.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_EditorFileDialog_property_file_mode:
  234. .. rst-class:: classref-property
  235. :ref:`FileMode<enum_EditorFileDialog_FileMode>` **file_mode** = ``4`` :ref:`🔗<class_EditorFileDialog_property_file_mode>`
  236. .. rst-class:: classref-property-setget
  237. - |void| **set_file_mode**\ (\ value\: :ref:`FileMode<enum_EditorFileDialog_FileMode>`\ )
  238. - :ref:`FileMode<enum_EditorFileDialog_FileMode>` **get_file_mode**\ (\ )
  239. The dialog's open or save mode, which affects the selection behavior.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_EditorFileDialog_property_filters:
  243. .. rst-class:: classref-property
  244. :ref:`PackedStringArray<class_PackedStringArray>` **filters** = ``PackedStringArray()`` :ref:`🔗<class_EditorFileDialog_property_filters>`
  245. .. rst-class:: classref-property-setget
  246. - |void| **set_filters**\ (\ value\: :ref:`PackedStringArray<class_PackedStringArray>`\ )
  247. - :ref:`PackedStringArray<class_PackedStringArray>` **get_filters**\ (\ )
  248. The available file type filters. For example, this shows only ``.png`` and ``.gd`` files: ``set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))``. Multiple file types can also be specified in a single filter. ``"*.png, *.jpg, *.jpeg ; Supported Images"`` will show both PNG and JPEG files when selected.
  249. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray<class_PackedStringArray>` for more details.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_EditorFileDialog_property_option_count:
  253. .. rst-class:: classref-property
  254. :ref:`int<class_int>` **option_count** = ``0`` :ref:`🔗<class_EditorFileDialog_property_option_count>`
  255. .. rst-class:: classref-property-setget
  256. - |void| **set_option_count**\ (\ value\: :ref:`int<class_int>`\ )
  257. - :ref:`int<class_int>` **get_option_count**\ (\ )
  258. The number of additional :ref:`OptionButton<class_OptionButton>`\ s and :ref:`CheckBox<class_CheckBox>`\ es in the dialog.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _class_EditorFileDialog_property_show_hidden_files:
  262. .. rst-class:: classref-property
  263. :ref:`bool<class_bool>` **show_hidden_files** = ``false`` :ref:`🔗<class_EditorFileDialog_property_show_hidden_files>`
  264. .. rst-class:: classref-property-setget
  265. - |void| **set_show_hidden_files**\ (\ value\: :ref:`bool<class_bool>`\ )
  266. - :ref:`bool<class_bool>` **is_showing_hidden_files**\ (\ )
  267. If ``true``, hidden files and directories will be visible in the **EditorFileDialog**. This property is synchronized with :ref:`EditorSettings.filesystem/file_dialog/show_hidden_files<class_EditorSettings_property_filesystem/file_dialog/show_hidden_files>`.
  268. .. rst-class:: classref-section-separator
  269. ----
  270. .. rst-class:: classref-descriptions-group
  271. Method Descriptions
  272. -------------------
  273. .. _class_EditorFileDialog_method_add_filter:
  274. .. rst-class:: classref-method
  275. |void| **add_filter**\ (\ filter\: :ref:`String<class_String>`, description\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_EditorFileDialog_method_add_filter>`
  276. Adds a comma-separated file name ``filter`` option to the **EditorFileDialog** with an optional ``description``, which restricts what files can be picked.
  277. A ``filter`` should be of the form ``"filename.extension"``, where filename and extension can be ``*`` to match any string. Filters starting with ``.`` (i.e. empty filenames) are not allowed.
  278. For example, a ``filter`` of ``"*.tscn, *.scn"`` and a ``description`` of ``"Scenes"`` results in filter text "Scenes (\*.tscn, \*.scn)".
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_EditorFileDialog_method_add_option:
  282. .. rst-class:: classref-method
  283. |void| **add_option**\ (\ name\: :ref:`String<class_String>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`, default_value_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EditorFileDialog_method_add_option>`
  284. Adds an additional :ref:`OptionButton<class_OptionButton>` to the file dialog. If ``values`` is empty, a :ref:`CheckBox<class_CheckBox>` is added instead.
  285. \ ``default_value_index`` should be an index of the value in the ``values``. If ``values`` is empty it should be either ``1`` (checked), or ``0`` (unchecked).
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_EditorFileDialog_method_add_side_menu:
  289. .. rst-class:: classref-method
  290. |void| **add_side_menu**\ (\ menu\: :ref:`Control<class_Control>`, title\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_EditorFileDialog_method_add_side_menu>`
  291. **Deprecated:** This feature is no longer supported.
  292. This method is kept for compatibility and does nothing. As an alternative, you can display another dialog after showing the file dialog.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_EditorFileDialog_method_clear_filename_filter:
  296. .. rst-class:: classref-method
  297. |void| **clear_filename_filter**\ (\ ) :ref:`🔗<class_EditorFileDialog_method_clear_filename_filter>`
  298. Clear the filter for file names.
  299. .. rst-class:: classref-item-separator
  300. ----
  301. .. _class_EditorFileDialog_method_clear_filters:
  302. .. rst-class:: classref-method
  303. |void| **clear_filters**\ (\ ) :ref:`🔗<class_EditorFileDialog_method_clear_filters>`
  304. Removes all filters except for "All Files (\*.\*)".
  305. .. rst-class:: classref-item-separator
  306. ----
  307. .. _class_EditorFileDialog_method_get_filename_filter:
  308. .. rst-class:: classref-method
  309. :ref:`String<class_String>` **get_filename_filter**\ (\ ) |const| :ref:`🔗<class_EditorFileDialog_method_get_filename_filter>`
  310. Returns the value of the filter for file names.
  311. .. rst-class:: classref-item-separator
  312. ----
  313. .. _class_EditorFileDialog_method_get_line_edit:
  314. .. rst-class:: classref-method
  315. :ref:`LineEdit<class_LineEdit>` **get_line_edit**\ (\ ) :ref:`🔗<class_EditorFileDialog_method_get_line_edit>`
  316. Returns the LineEdit for the selected file.
  317. \ **Warning:** 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 :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  318. .. rst-class:: classref-item-separator
  319. ----
  320. .. _class_EditorFileDialog_method_get_option_default:
  321. .. rst-class:: classref-method
  322. :ref:`int<class_int>` **get_option_default**\ (\ option\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileDialog_method_get_option_default>`
  323. Returns the default value index of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_EditorFileDialog_method_get_option_name:
  327. .. rst-class:: classref-method
  328. :ref:`String<class_String>` **get_option_name**\ (\ option\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileDialog_method_get_option_name>`
  329. Returns the name of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_EditorFileDialog_method_get_option_values:
  333. .. rst-class:: classref-method
  334. :ref:`PackedStringArray<class_PackedStringArray>` **get_option_values**\ (\ option\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileDialog_method_get_option_values>`
  335. Returns an array of values of the :ref:`OptionButton<class_OptionButton>` with index ``option``.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_EditorFileDialog_method_get_selected_options:
  339. .. rst-class:: classref-method
  340. :ref:`Dictionary<class_Dictionary>` **get_selected_options**\ (\ ) |const| :ref:`🔗<class_EditorFileDialog_method_get_selected_options>`
  341. Returns a :ref:`Dictionary<class_Dictionary>` with the selected values of the additional :ref:`OptionButton<class_OptionButton>`\ s and/or :ref:`CheckBox<class_CheckBox>`\ es. :ref:`Dictionary<class_Dictionary>` keys are names and values are selected value indices.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_EditorFileDialog_method_get_vbox:
  345. .. rst-class:: classref-method
  346. :ref:`VBoxContainer<class_VBoxContainer>` **get_vbox**\ (\ ) :ref:`🔗<class_EditorFileDialog_method_get_vbox>`
  347. Returns the :ref:`VBoxContainer<class_VBoxContainer>` used to display the file system.
  348. \ **Warning:** 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 :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  349. .. rst-class:: classref-item-separator
  350. ----
  351. .. _class_EditorFileDialog_method_invalidate:
  352. .. rst-class:: classref-method
  353. |void| **invalidate**\ (\ ) :ref:`🔗<class_EditorFileDialog_method_invalidate>`
  354. Notify the **EditorFileDialog** that its view of the data is no longer accurate. Updates the view contents on next view update.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_EditorFileDialog_method_popup_file_dialog:
  358. .. rst-class:: classref-method
  359. |void| **popup_file_dialog**\ (\ ) :ref:`🔗<class_EditorFileDialog_method_popup_file_dialog>`
  360. Shows the **EditorFileDialog** at the default size and position for file dialogs in the editor, and selects the file name if there is a current file.
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_EditorFileDialog_method_set_filename_filter:
  364. .. rst-class:: classref-method
  365. |void| **set_filename_filter**\ (\ filter\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileDialog_method_set_filename_filter>`
  366. Sets the value of the filter for file names.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _class_EditorFileDialog_method_set_option_default:
  370. .. rst-class:: classref-method
  371. |void| **set_option_default**\ (\ option\: :ref:`int<class_int>`, default_value_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EditorFileDialog_method_set_option_default>`
  372. Sets the default value index of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_EditorFileDialog_method_set_option_name:
  376. .. rst-class:: classref-method
  377. |void| **set_option_name**\ (\ option\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileDialog_method_set_option_name>`
  378. Sets the name of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  379. .. rst-class:: classref-item-separator
  380. ----
  381. .. _class_EditorFileDialog_method_set_option_values:
  382. .. rst-class:: classref-method
  383. |void| **set_option_values**\ (\ option\: :ref:`int<class_int>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_EditorFileDialog_method_set_option_values>`
  384. Sets the option values of the :ref:`OptionButton<class_OptionButton>` with index ``option``.
  385. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  386. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  387. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  388. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  389. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  390. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  391. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  392. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  393. .. |void| replace:: :abbr:`void (No return value.)`