EditorFileDialog.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorFileDialog" inherits="ConfirmationDialog" version="4.0">
  3. <brief_description>
  4. A modified version of [FileDialog] used by the editor.
  5. </brief_description>
  6. <description>
  7. </description>
  8. <tutorials>
  9. </tutorials>
  10. <methods>
  11. <method name="add_filter">
  12. <return type="void" />
  13. <argument index="0" name="filter" type="String" />
  14. <description>
  15. Adds a comma-delimited file extension filter option to the [EditorFileDialog] with an optional semi-colon-delimited label.
  16. For example, [code]"*.tscn, *.scn; Scenes"[/code] results in filter text "Scenes (*.tscn, *.scn)".
  17. </description>
  18. </method>
  19. <method name="clear_filters">
  20. <return type="void" />
  21. <description>
  22. Removes all filters except for "All Files (*)".
  23. </description>
  24. </method>
  25. <method name="get_vbox">
  26. <return type="VBoxContainer" />
  27. <description>
  28. Returns the [code]VBoxContainer[/code] used to display the file system.
  29. [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.
  30. </description>
  31. </method>
  32. <method name="invalidate">
  33. <return type="void" />
  34. <description>
  35. Notify the [EditorFileDialog] that its view of the data is no longer accurate. Updates the view contents on next view update.
  36. </description>
  37. </method>
  38. </methods>
  39. <members>
  40. <member name="access" type="int" setter="set_access" getter="get_access" enum="EditorFileDialog.Access" default="0">
  41. The location from which the user may select a file, including [code]res://[/code], [code]user://[/code], and the local file system.
  42. </member>
  43. <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default="&quot;res://&quot;">
  44. The currently occupied directory.
  45. </member>
  46. <member name="current_file" type="String" setter="set_current_file" getter="get_current_file" default="&quot;&quot;">
  47. The currently selected file.
  48. </member>
  49. <member name="current_path" type="String" setter="set_current_path" getter="get_current_path" default="&quot;res://&quot;">
  50. The file system path in the address bar.
  51. </member>
  52. <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" override="true" default="false" />
  53. <member name="disable_overwrite_warning" type="bool" setter="set_disable_overwrite_warning" getter="is_overwrite_warning_disabled" default="false">
  54. If [code]true[/code], the [EditorFileDialog] will not warn the user before overwriting files.
  55. </member>
  56. <member name="display_mode" type="int" setter="set_display_mode" getter="get_display_mode" enum="EditorFileDialog.DisplayMode" default="0">
  57. The view format in which the [EditorFileDialog] displays resources to the user.
  58. </member>
  59. <member name="file_mode" type="int" setter="set_file_mode" getter="get_file_mode" enum="EditorFileDialog.FileMode" default="4">
  60. The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]
  61. </member>
  62. <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false">
  63. If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog].
  64. </member>
  65. <member name="title" type="String" setter="set_title" getter="get_title" override="true" default="&quot;Save a File&quot;" />
  66. </members>
  67. <signals>
  68. <signal name="dir_selected">
  69. <argument index="0" name="dir" type="String" />
  70. <description>
  71. Emitted when a directory is selected.
  72. </description>
  73. </signal>
  74. <signal name="file_selected">
  75. <argument index="0" name="path" type="String" />
  76. <description>
  77. Emitted when a file is selected.
  78. </description>
  79. </signal>
  80. <signal name="files_selected">
  81. <argument index="0" name="paths" type="PackedStringArray" />
  82. <description>
  83. Emitted when multiple files are selected.
  84. </description>
  85. </signal>
  86. </signals>
  87. <constants>
  88. <constant name="FILE_MODE_OPEN_FILE" value="0" enum="FileMode">
  89. The [EditorFileDialog] can select only one file. Accepting the window will open the file.
  90. </constant>
  91. <constant name="FILE_MODE_OPEN_FILES" value="1" enum="FileMode">
  92. The [EditorFileDialog] can select multiple files. Accepting the window will open all files.
  93. </constant>
  94. <constant name="FILE_MODE_OPEN_DIR" value="2" enum="FileMode">
  95. The [EditorFileDialog] can select only one directory. Accepting the window will open the directory.
  96. </constant>
  97. <constant name="FILE_MODE_OPEN_ANY" value="3" enum="FileMode">
  98. The [EditorFileDialog] can select a file or directory. Accepting the window will open it.
  99. </constant>
  100. <constant name="FILE_MODE_SAVE_FILE" value="4" enum="FileMode">
  101. The [EditorFileDialog] can select only one file. Accepting the window will save the file.
  102. </constant>
  103. <constant name="ACCESS_RESOURCES" value="0" enum="Access">
  104. The [EditorFileDialog] can only view [code]res://[/code] directory contents.
  105. </constant>
  106. <constant name="ACCESS_USERDATA" value="1" enum="Access">
  107. The [EditorFileDialog] can only view [code]user://[/code] directory contents.
  108. </constant>
  109. <constant name="ACCESS_FILESYSTEM" value="2" enum="Access">
  110. The [EditorFileDialog] can view the entire local file system.
  111. </constant>
  112. <constant name="DISPLAY_THUMBNAILS" value="0" enum="DisplayMode">
  113. The [EditorFileDialog] displays resources as thumbnails.
  114. </constant>
  115. <constant name="DISPLAY_LIST" value="1" enum="DisplayMode">
  116. The [EditorFileDialog] displays resources as a list of filenames.
  117. </constant>
  118. </constants>
  119. </class>