class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeViewportWindowAcceptDialogConfirmationDialog EditorFileDialog
A modified version of FileDialog used by the editor.
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.
Unlike FileDialog, EditorFileDialog does not have a property for using native dialogs. Instead, native dialogs can be enabled globally via the [member EditorSettings.interface/editor/use_native_file_dialogs] editor setting. They are also enabled automatically when running in sandbox (e.g. on macOS).
Enum FileMode<>():Enum

FILE_MODE_OPEN_FILE:null = 0
The EditorFileDialog can select only one file. Accepting the window will open the file.


FILE_MODE_OPEN_FILES:null = 1
The EditorFileDialog can select multiple files. Accepting the window will open all files.


FILE_MODE_OPEN_DIR:null = 2
The EditorFileDialog can select only one directory. Accepting the window will open the directory.


FILE_MODE_OPEN_ANY:null = 3
The EditorFileDialog can select a file or directory. Accepting the window will open it.


FILE_MODE_SAVE_FILE:null = 4
The EditorFileDialog can select only one file. Accepting the window will save the file.
Enum Access<>():Enum

ACCESS_RESOURCES:null = 0
The EditorFileDialog can only view res:// directory contents.


ACCESS_USERDATA:null = 1
The EditorFileDialog can only view user:// directory contents.


ACCESS_FILESYSTEM:null = 2
The EditorFileDialog can view the entire local file system.
Enum DisplayMode<>():Enum

DISPLAY_THUMBNAILS:null = 0
The EditorFileDialog displays resources as thumbnails.


DISPLAY_LIST:null = 1
The EditorFileDialog displays resources as a list of filenames.
Signal dir_selected<>( String dir=, dir:String=, ):Signal
Emitted when a directory is selected.

Signal file_selected<>( String path=, path:String=, ):Signal
Emitted when a file is selected.

Signal filename_filter_changed<>( String filter=, filter:String=, ):Signal
Emitted when the filter for file names changes.

Signal files_selected<>( PackedStringArray paths=, paths:PackedStringArray=, ):Signal
Emitted when multiple files are selected.

set get int access<>():int set get
The location from which the user may select a file, including res://, user://, and the local file system.

set get String current_dir<>():String set get
The currently occupied directory.

set get String current_file<>():String set get
The currently selected file.

set get String current_path<>():String set get
The file system path in the address bar.

set get bool dialog_hide_on_ok<>():bool set get
set get bool disable_overwrite_warning<>():bool set get
If true, the EditorFileDialog will not warn the user before overwriting files.

set get int display_mode<>():int set get
The view format in which the EditorFileDialog displays resources to the user.

set get int file_mode<>():int set get
The dialog's open or save mode, which affects the selection behavior.

set get PackedStringArray filters<>():PackedStringArray set get
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.

set get int option_count<>():int set get
The number of additional OptionButtons and CheckBoxes in the dialog.

set get bool show_hidden_files<>():bool set get
If true, hidden files and directories will be visible in the EditorFileDialog. This property is synchronized with [member EditorSettings.filesystem/file_dialog/show_hidden_files].

set get String title<>():String set get
void add_filter<>( String filter=, filter:String=, String description="", description:String="", ):void
Adds a comma-separated file name filter option to the EditorFileDialog with an optional description, which restricts what files can be picked.

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.
For example, a filter of "*.tscn, *.scn" and a description of "Scenes" results in filter text "Scenes (*.tscn, *.scn)".
void add_option<>( String name=, name:String=, PackedStringArray values=, values:PackedStringArray=, int default_value_index=, default_value_index:int=, ):void
Adds an additional OptionButton to the file dialog. If values is empty, a CheckBox is added instead.

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).
void add_side_menu<>( Control menu=, menu:Control=, String title="", title:String="", ):void
This method is kept for compatibility and does nothing. As an alternative, you can display another dialog after showing the file dialog.

void clear_filename_filter<>():void
Clear the filter for file names.

void clear_filters<>():void
Removes all filters except for "All Files (*.*)".

String get_filename_filter<>():String
Returns the value of the filter for file names.

LineEdit get_line_edit<>():LineEdit
Returns the LineEdit for the selected file.

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 [member CanvasItem.visible] property.
int get_option_default<>( int option=, option:int=, ):int
Returns the default value index of the OptionButton or CheckBox with index option.

String get_option_name<>( int option=, option:int=, ):String
Returns the name of the OptionButton or CheckBox with index option.

PackedStringArray get_option_values<>( int option=, option:int=, ):PackedStringArray
Returns an array of values of the OptionButton with index option.

Dictionary get_selected_options<>():Dictionary
Returns a Dictionary with the selected values of the additional OptionButtons and/or CheckBoxes. Dictionary keys are names and values are selected value indices.

VBoxContainer get_vbox<>():VBoxContainer
Returns the VBoxContainer used to display the file system.

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 [member CanvasItem.visible] property.
void invalidate<>():void
Notify the EditorFileDialog that its view of the data is no longer accurate. Updates the view contents on next view update.

void popup_file_dialog<>():void
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.

void set_filename_filter<>( String filter=, filter:String=, ):void
Sets the value of the filter for file names.

void set_option_default<>( int option=, option:int=, int default_value_index=, default_value_index:int=, ):void
Sets the default value index of the OptionButton or CheckBox with index option.

void set_option_name<>( int option=, option:int=, String name=, name:String=, ):void
Sets the name of the OptionButton or CheckBox with index option.

void set_option_values<>( int option=, option:int=, PackedStringArray values=, values:PackedStringArray=, ):void
Sets the option values of the OptionButton with index option.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...