Support script global resource name in EditorFileSystem
* Works for binary and text files. * Makes EditorQuickOpen work with custom resources again. * Information is cached and easily accessible. Properly fixes #66179. Supersedes #66215 and supersedes #62417 **WARNING**: This required breaking backwards binary compatibility (.res and .scn files). Files saved after this PR is merged will no longer open in any earlier versions of Godot.
This commit is contained in:
parent
14fdd28de9
commit
dddd8d43f6
17 changed files with 250 additions and 18 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue