Skip to content

EditorFileList ​

Inherits: VBoxContainer

Universal file list that works with any resource type via ResourceManager Supports both "browse all files" and "open specific files" patterns

Variables ​

ResourceManagerresource_manager
boolauto_populate_enabledfalse
Stringresource_type""
Dictionaryopen_files{} # {path: {resource: Resource, display_name: String}}
Stringcurrent_file_path""
Texture2Dfile_icon

Methods ​

voidsetup_managers( p_resource_manager: ResourceManager )
voidconfigure_auto_population( p_resource_type: String, p_auto_populate: bool )
voidenable_group_filter( all_text: String, none_text: String, groups: Array, matches: Callable )
intget_group_filter_id()
voidset_file_icon( icon: Texture2D )
voidpopulate_all_files()
voidrefresh_from_manager()
voidadd_file( file_path: String, resource: Resource )
voidremove_file( file_path: String )
voidupdate_file_display_name( file_path: String, resource: Resource )
voidselect_file( file_path: String )
Array[String]get_open_files()
boolhas_file( file_path: String )
Stringget_selected_file()
Resourceget_selected_resource()
intget_file_count()
voidclear_all_files()
voidfocus_filter()
Resourceget_resource( file_path: String )
voidset_filter_placeholder( text: String )
boolis_auto_populate_enabled()
Stringget_resource_type()

Signals ​

file_selected( file_path: String, resource: Resource ) ​

file_double_clicked( file_path: String, resource: Resource ) ​

file_popup_menu_requested( at_position: Vector2, file_path: String, resource: Resource ) ​

Constants ​

  • int ALL_GROUPS_ID = -2 - The id of the "all" entry of the group menu (an OptionButton takes -1 to mean "the index", so -1 itself cannot be an id)

Variable descriptions ​

ResourceManager resource_manager ​

No description yet.

bool auto_populate_enabled = false ​

No description yet.

String resource_type = "" ​

No description yet.

Dictionary open_files = # path: resource: Resource, display_name: String ​

No description yet.

String current_file_path = "" ​

No description yet.

Texture2D file_icon ​

No description yet.

Method descriptions ​

void setup_managers( p_resource_manager: ResourceManager ) ​

No description yet.

void configure_auto_population( p_resource_type: String, p_auto_populate: bool ) ​

No description yet.

void enable_group_filter( all_text: String, none_text: String, groups: Array, matches: Callable ) ​

Adds a menu above the list that switches between groups. groups: [{"id": int, "name": String}], matches: (resource, group_id) -> bool, where group id 0 means "in no group". The menu starts on "All", keeps the group that was chosen when it is rebuilt, and shows only the entries of the chosen group

int get_group_filter_id() ​

The group the menu is on (-1 = all, 0 = no group)

void set_file_icon( icon: Texture2D ) ​

No description yet.

void populate_all_files() ​

Populate the list with all files of the configured resource type

void refresh_from_manager() ​

Refresh from resource manager (useful when files are added/removed externally)

void add_file( file_path: String, resource: Resource ) ​

Add a file to the open files list

void remove_file( file_path: String ) ​

Remove a file from the open files list

void update_file_display_name( file_path: String, resource: Resource ) ​

Update display name for a file (when resource properties change)

void select_file( file_path: String ) ​

Select a specific file

Array[String] get_open_files() ​

Get all open file paths

bool has_file( file_path: String ) ​

Check if a file is open

String get_selected_file() ​

Get the currently selected file path

Resource get_selected_resource() ​

Get the currently selected resource

int get_file_count() ​

Get file count

void clear_all_files() ​

Clear all files

void focus_filter() ​

Focus the filter input

Resource get_resource( file_path: String ) ​

Get resource for file path

void set_filter_placeholder( text: String ) ​

Set placeholder text for filter

bool is_auto_populate_enabled() ​

Check if auto-population is enabled

String get_resource_type() ​

Get configured resource type