From 4383c5026a118b9536a24760b246a1ac7d0a3b7e Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 9 Jan 2021 23:03:48 +0100 Subject: [PATCH] Add all AutoLoad resources when exporting the project --- editor/editor_export.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index fd4423646fa..dd3e81c8c0a 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -732,6 +732,26 @@ Error EditorExportPlatform::export_project_files(const Ref & _export_find_dependencies(files[i], paths); } + + // Add autoload resources and their dependencies + List props; + ProjectSettings::get_singleton()->get_property_list(&props); + + for (List::Element *E = props.front(); E; E = E->next()) { + const PropertyInfo &pi = E->get(); + + if (!pi.name.begins_with("autoload/")) { + continue; + } + + String autoload_path = ProjectSettings::get_singleton()->get(pi.name); + + if (autoload_path.begins_with("*")) { + autoload_path = autoload_path.substr(1); + } + + _export_find_dependencies(autoload_path, paths); + } } //add native icons to non-resource include list