EditorFileDialog.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorFileDialog" inherits="ConfirmationDialog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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">
  44. The currently occupied directory.
  45. </member>
  46. <member name="current_file" type="String" setter="set_current_file" getter="get_current_file">
  47. The currently selected file.
  48. </member>
  49. <member name="current_path" type="String" setter="set_current_path" getter="get_current_path">
  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" overrides="AcceptDialog" 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="mode" type="int" setter="set_mode" getter="get_mode" enum="EditorFileDialog.Mode" default="4">
  60. The purpose of the [EditorFileDialog], which defines the allowed behaviors.
  61. </member>
  62. <member name="resizable" type="bool" setter="set_resizable" getter="get_resizable" overrides="WindowDialog" default="true" />
  63. <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false">
  64. If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog].
  65. </member>
  66. <member name="window_title" type="String" setter="set_title" getter="get_title" overrides="WindowDialog" default="&quot;Save a File&quot;" />
  67. </members>
  68. <signals>
  69. <signal name="dir_selected">
  70. <argument index="0" name="dir" type="String" />
  71. <description>
  72. Emitted when a directory is selected.
  73. </description>
  74. </signal>
  75. <signal name="file_selected">
  76. <argument index="0" name="path" type="String" />
  77. <description>
  78. Emitted when a file is selected.
  79. </description>
  80. </signal>
  81. <signal name="files_selected">
  82. <argument index="0" name="paths" type="PoolStringArray" />
  83. <description>
  84. Emitted when multiple files are selected.
  85. </description>
  86. </signal>
  87. </signals>
  88. <constants>
  89. <constant name="MODE_OPEN_FILE" value="0" enum="Mode">
  90. The [EditorFileDialog] can select only one file. Accepting the window will open the file.
  91. </constant>
  92. <constant name="MODE_OPEN_FILES" value="1" enum="Mode">
  93. The [EditorFileDialog] can select multiple files. Accepting the window will open all files.
  94. </constant>
  95. <constant name="MODE_OPEN_DIR" value="2" enum="Mode">
  96. The [EditorFileDialog] can select only one directory. Accepting the window will open the directory.
  97. </constant>
  98. <constant name="MODE_OPEN_ANY" value="3" enum="Mode">
  99. The [EditorFileDialog] can select a file or directory. Accepting the window will open it.
  100. </constant>
  101. <constant name="MODE_SAVE_FILE" value="4" enum="Mode">
  102. The [EditorFileDialog] can select only one file. Accepting the window will save the file.
  103. </constant>
  104. <constant name="ACCESS_RESOURCES" value="0" enum="Access">
  105. The [EditorFileDialog] can only view [code]res://[/code] directory contents.
  106. </constant>
  107. <constant name="ACCESS_USERDATA" value="1" enum="Access">
  108. The [EditorFileDialog] can only view [code]user://[/code] directory contents.
  109. </constant>
  110. <constant name="ACCESS_FILESYSTEM" value="2" enum="Access">
  111. The [EditorFileDialog] can view the entire local file system.
  112. </constant>
  113. <constant name="DISPLAY_THUMBNAILS" value="0" enum="DisplayMode">
  114. The [EditorFileDialog] displays resources as thumbnails.
  115. </constant>
  116. <constant name="DISPLAY_LIST" value="1" enum="DisplayMode">
  117. The [EditorFileDialog] displays resources as a list of filenames.
  118. </constant>
  119. </constants>
  120. </class>