diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-29 12:30:12 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-29 12:30:12 +0200 |
commit | c4733e80030f01182c91f69245a0e5ad247b4e07 (patch) | |
tree | 72b3f6af748739dcd87f880dcbb546a96d5bdd24 /modules/gdscript/gdscript.cpp | |
parent | 296758a8f8b7424652e440f57dc1875331372795 (diff) | |
parent | dc73440f899e6f32de748787e946ad762771fda0 (diff) | |
download | redot-engine-c4733e80030f01182c91f69245a0e5ad247b4e07.tar.gz |
Merge pull request #90860 from vnen/gdscript-get-dependencies
GDScript: Implement `get_dependencies()`
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 921ed0b416..f238958f25 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -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); } } |