EditorFileDialog
A modified version of FileDialog
used by the editor.
class EditorFileDialog
EditorFileDialog
is an enhanced version of 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.
This object emits the following signals:
Superclasses
class ConfirmationDialog
A dialog used for confirmation of actions.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
enum Access
enum DisplayMode
enum FileMode
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
Type members
Instance members
var access: EditorFileDialog.Access
The location from which the user may select a file, including
res://
,user://
, and the local file system.var currentDir: String
The currently occupied directory.
var currentFile: String
The currently selected file.
var currentPath: String
The file system path in the address bar.
var dirSelected: Signal3
Emitted when a directory is selected.
var disableOverwriteWarning: Bool
If
true
, theEditorFileDialog
will not warn the user before overwriting files.var displayMode: EditorFileDialog.DisplayMode
The view format in which the
EditorFileDialog
displays resources to the user.var fileMode: EditorFileDialog.FileMode
The dialog’s open or save mode, which affects the selection behavior. See
FileMode
.var fileSelected: Signal1
Emitted when a file is selected.
var filesSelected: Signal2
Emitted when multiple files are selected.
var filters: PackedStringArray
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.var optionCount: Int32
The number of additional
OptionButton
s andCheckBox
es in the dialog.var showHiddenFiles: Bool
If
true
, hidden files and directories will be visible in theEditorFileDialog
. This property is synchronized withEditorSettings/filesystem/fileDialog/showHiddenFiles
.func addFilter(String, description: String
) Adds a comma-delimited file name
filter
option to theEditorFileDialog
with an optionaldescription
, which restricts what files can be picked.func addOption(name: String, values: PackedStringArray, defaultValueIndex: Int32
) Adds an additional
OptionButton
to the file dialog. Ifvalues
is empty, aCheckBox
is added instead.func addSideMenu(Control?, title: String
) Adds the given
menu
to the side of the file dialog with the giventitle
text on top. Only one side menu is allowed.func clearFilters(
) Removes all filters except for “All Files (*)”.
func getLineEdit(
) -> LineEdit? Returns the LineEdit for the selected file.
func getOptionDefault(option: Int32
) -> Int32 Returns the default value index of the
OptionButton
orCheckBox
with indexoption
.func getOptionName(option: Int32
) -> String Returns the name of the
OptionButton
orCheckBox
with indexoption
.func getOptionValues(option: Int32
) -> PackedStringArray Returns an array of values of the
OptionButton
with indexoption
.func getSelectedOptions(
) -> GDictionary Returns a
GDictionary
with the selected values of the additionalOptionButton
s and/orCheckBox
es.GDictionary
keys are names and values are selected value indices.func getVbox(
) -> VBoxContainer? Returns the
VBoxContainer
used to display the file system.func invalidate(
) Notify the
EditorFileDialog
that its view of the data is no longer accurate. Updates the view contents on next view update.func popupFileDialog(
) 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.func setOptionDefault(option: Int32, defaultValueIndex: Int32
) Sets the default value index of the
OptionButton
orCheckBox
with indexoption
.func setOptionName(option: Int32, name: String
) Sets the name of the
OptionButton
orCheckBox
with indexoption
.func setOptionValues(option: Int32, values: PackedStringArray
) Sets the option values of the
OptionButton
with indexoption
.