diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-04 16:38:15 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-04 16:38:15 +0100 |
commit | 38a1e17b9393a7e59c92d16c3ea0347e73af96d3 (patch) | |
tree | 82383f8af68fe6a00282a9878745c701defe6711 | |
parent | dbd139c91c79747a5138cca50961dfeb3f6cd116 (diff) | |
parent | 5afc311783609cdc0d09f191b43372692c86df0d (diff) | |
download | redot-engine-38a1e17b9393a7e59c92d16c3ea0347e73af96d3.tar.gz |
Merge pull request #72572 from Daylily-Zeleen/daylily-zeleen/override_export_end_in_Cpp
Provide ability to override `EditorExportPlugin::_export_end()` in C++
-rw-r--r-- | editor/export/editor_export_platform.cpp | 4 | ||||
-rw-r--r-- | editor/export/editor_export_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/export/editor_export_plugin.h | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 677a77cd80..9a0d84d751 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -547,8 +547,10 @@ EditorExportPlatform::ExportNotifier::~ExportNotifier() { for (int i = 0; i < export_plugins.size(); i++) { if (GDVIRTUAL_IS_OVERRIDDEN_PTR(export_plugins[i], _export_end)) { export_plugins.write[i]->_export_end_script(); + } else { + export_plugins.write[i]->_export_end(); } - export_plugins.write[i]->_export_end(); + export_plugins.write[i]->_export_end_clear(); export_plugins.write[i]->set_export_preset(Ref<EditorExportPlugin>()); } } diff --git a/editor/export/editor_export_plugin.cpp b/editor/export/editor_export_plugin.cpp index 6576960b9a..ec8c8c7b69 100644 --- a/editor/export/editor_export_plugin.cpp +++ b/editor/export/editor_export_plugin.cpp @@ -291,6 +291,8 @@ void EditorExportPlugin::_export_file(const String &p_path, const String &p_type void EditorExportPlugin::_export_begin(const HashSet<String> &p_features, bool p_debug, const String &p_path, int p_flags) { } +void EditorExportPlugin::_export_end() {} + void EditorExportPlugin::skip() { skipped = true; } diff --git a/editor/export/editor_export_plugin.h b/editor/export/editor_export_plugin.h index 7d866ce37e..fe97d2e04f 100644 --- a/editor/export/editor_export_plugin.h +++ b/editor/export/editor_export_plugin.h @@ -71,7 +71,7 @@ class EditorExportPlugin : public RefCounted { skipped = false; } - _FORCE_INLINE_ void _export_end() { + _FORCE_INLINE_ void _export_end_clear() { ios_frameworks.clear(); ios_embedded_frameworks.clear(); ios_bundle_files.clear(); @@ -108,6 +108,7 @@ protected: virtual void _export_file(const String &p_path, const String &p_type, const HashSet<String> &p_features); virtual void _export_begin(const HashSet<String> &p_features, bool p_debug, const String &p_path, int p_flags); + virtual void _export_end(); static void _bind_methods(); |