diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-16 15:49:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-16 15:49:52 +0100 |
commit | cd7b51b9434cddb5f6104ee1ec9e88d1092d57af (patch) | |
tree | e3e39cab61882d7ea6e9714e4e3984698a718088 /modules/gdscript/gdscript.h | |
parent | 9986f3804caf32dc092ac7f094381745dc3ae8f8 (diff) | |
parent | 86aa12e806515e68514d4e8f97342a144fd8610f (diff) | |
download | redot-engine-cd7b51b9434cddb5f6104ee1ec9e88d1092d57af.tar.gz |
Merge pull request #35102 from ChibiDenDen/reuse_orphaned_subclass
#34161: Keep a weak reference to orphan subclasses to reuse on class reload
Diffstat (limited to 'modules/gdscript/gdscript.h')
-rw-r--r-- | modules/gdscript/gdscript.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 0e2b812a22..4ae52238ce 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -132,6 +132,8 @@ class GDScript : public Script { bool _update_exports(); + void _save_orphaned_subclasses(); + protected: bool _get(const StringName &p_name, Variant &r_ret) const; bool _set(const StringName &p_name, const Variant &p_value); @@ -355,6 +357,8 @@ class GDScriptLanguage : public ScriptLanguage { bool profiling; uint64_t script_frame_time; + Map<String, ObjectID> orphan_subclasses; + public: int calls; @@ -506,6 +510,9 @@ public: virtual bool handles_global_class_type(const String &p_type) const; virtual String get_global_class_name(const String &p_path, String *r_base_type = NULL, String *r_icon_path = NULL) const; + void add_orphan_subclass(const String &p_qualified_name, const ObjectID &p_subclass); + Ref<GDScript> get_orphan_subclass(const String &p_qualified_name); + GDScriptLanguage(); ~GDScriptLanguage(); }; |