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 ​
ResourceManager | resource_manager | |
bool | auto_populate_enabled | false |
String | resource_type | "" |
Dictionary | open_files | {} # {path: {resource: Resource, display_name: String}} |
String | current_file_path | "" |
Texture2D | file_icon |
Methods ​
void | setup_managers( p_resource_manager: ResourceManager ) |
void | configure_auto_population( p_resource_type: String, p_auto_populate: bool ) |
void | enable_group_filter( all_text: String, none_text: String, groups: Array, matches: Callable ) |
int | get_group_filter_id() |
void | set_file_icon( icon: Texture2D ) |
void | populate_all_files() |
void | refresh_from_manager() |
void | add_file( file_path: String, resource: Resource ) |
void | remove_file( file_path: String ) |
void | update_file_display_name( file_path: String, resource: Resource ) |
void | select_file( file_path: String ) |
Array[String] | get_open_files() |
bool | has_file( file_path: String ) |
String | get_selected_file() |
Resource | get_selected_resource() |
int | get_file_count() |
void | clear_all_files() |
void | focus_filter() |
Resource | get_resource( file_path: String ) |
void | set_filter_placeholder( text: String ) |
bool | is_auto_populate_enabled() |
String | get_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 ​
intALL_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