From 0a57f964a357976e023b638e872397ba94123776 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 28 Apr 2022 22:49:10 +0200 Subject: Implement missing Node & Resource placeholders Implemented by request of @neikeq to advance in the GDExtension version of Mono. * If a Resource type is missing upon load, it will be remembered together with its data (Unless manually overriden). * If a Node type is missing upon load, it will be also be remembered together with its data (unless deleted). This feature makes working with GDExtension much easier, as it ensures that missing types no longer cause data loss. --- core/io/resource_loader.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/io/resource_loader.h') diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 15ecfacf4a..ea18ac23fd 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -110,6 +110,7 @@ private: static void *dep_err_notify_ud; static DependencyErrorNotify dep_err_notify; static bool abort_on_missing_resource; + static bool create_missing_resources_if_class_unavailable; static HashMap> translation_remaps; static HashMap path_remaps; @@ -222,6 +223,9 @@ public: static void add_custom_loaders(); static void remove_custom_loaders(); + static void set_create_missing_resources_if_class_unavailable(bool p_enable); + _FORCE_INLINE_ static bool is_creating_missing_resources_if_class_unavailable_enabled() { return create_missing_resources_if_class_unavailable; } + static void initialize(); static void finalize(); }; -- cgit v1.2.3