Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
FileMode
EditorFileDialog.swift:26enum FileMode
Cases
case openFile
The
EditorFileDialog
can select only one file. Accepting the window will open the file.case openFiles
The
EditorFileDialog
can select multiple files. Accepting the window will open all files.case openDir
The
EditorFileDialog
can select only one directory. Accepting the window will open the directory.case openAny
The
EditorFileDialog
can select a file or directory. Accepting the window will open it.case saveFile
The
EditorFileDialog
can select only one file. Accepting the window will save the file.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (34) members.
Types
enum Access
enum DisplayMode
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
.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.