diff options
Diffstat (limited to 'editor/editor_file_system.h')
-rw-r--r-- | editor/editor_file_system.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 2985134093..2490bd31b3 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -54,6 +54,7 @@ class EditorFileSystemDirectory : public Object { struct FileInfo { String file; StringName type; + StringName resource_script_class; // If any resource has script with a global class name, its found here. ResourceUID::ID uid = ResourceUID::INVALID_ID; uint64_t modified_time = 0; uint64_t import_modified_time = 0; @@ -61,6 +62,7 @@ class EditorFileSystemDirectory : public Object { String import_group_file; Vector<String> deps; bool verified = false; //used for checking changes + // These are for script resources only. String script_class_name; String script_class_extends; String script_class_icon_path; @@ -90,6 +92,7 @@ public: String get_file(int p_idx) const; String get_file_path(int p_idx) const; StringName get_file_type(int p_idx) const; + StringName get_file_resource_script_class(int p_idx) const; Vector<String> get_file_deps(int p_idx) const; bool get_file_import_is_valid(int p_idx) const; uint64_t get_file_modified_time(int p_idx) const; @@ -189,6 +192,7 @@ class EditorFileSystem : public Node { /* Used for reading the filesystem cache file */ struct FileCache { String type; + String resource_script_class; ResourceUID::ID uid = ResourceUID::INVALID_ID; uint64_t modification_time = 0; uint64_t import_modification_time = 0; @@ -257,9 +261,11 @@ class EditorFileSystem : public Node { } }; - void _scan_script_classes(EditorFileSystemDirectory *p_dir); - SafeFlag update_script_classes_queued; - void _queue_update_script_classes(); + Mutex update_script_mutex; + HashSet<String> update_script_paths; + void _queue_update_script_class(const String &p_path); + void _update_script_classes(); + void _update_pending_script_classes(); String _get_global_script_class(const String &p_type, const String &p_path, String *r_extends, String *r_icon_path) const; @@ -312,8 +318,6 @@ public: void reimport_file_with_custom_parameters(const String &p_file, const String &p_importer, const HashMap<StringName, Variant> &p_custom_params); - void update_script_classes(); - bool is_group_file(const String &p_path) const; void move_group_file(const String &p_path, const String &p_new_path); |