1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #90860 from vnen/gdscript-get-dependencies

GDScript: Implement `get_dependencies()`
This commit is contained in:
Rémi Verschelde
2024-04-29 12:30:12 +02:00
4 changed files with 29 additions and 7 deletions

View File

@@ -2892,7 +2892,7 @@ String ResourceFormatLoaderGDScript::get_resource_type(const String &p_path) con
return "";
}
void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) {
void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *r_dependencies, bool p_add_types) {
Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::READ);
ERR_FAIL_COND_MSG(file.is_null(), "Cannot open file '" + p_path + "'.");
@@ -2906,8 +2906,13 @@ void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<S
return;
}
GDScriptAnalyzer analyzer(&parser);
if (OK != analyzer.analyze()) {
return;
}
for (const String &E : parser.get_dependencies()) {
p_dependencies->push_back(E);
r_dependencies->push_back(E);
}
}