From f3218c24c7735ce7497356dfa82f8a3d67981d0b Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Mon, 30 Oct 2017 22:17:20 +0100 Subject: Mono: support custom script templates. Also fixes a bug that prevented methods like `duplicate()` from copying the source code. (Copied from GDScript implementation) --- modules/mono/csharp_script.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules/mono/csharp_script.h') diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 65a6450da..255665b49 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -116,6 +116,9 @@ protected: Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); virtual void _resource_path_changed(); + bool _get(const StringName &p_name, Variant &r_ret) const; + bool _set(const StringName &p_name, const Variant &p_value); + void _get_property_list(List *p_properties) const; public: virtual bool can_instance() const; @@ -228,16 +231,17 @@ class CSharpLanguage : public ScriptLanguage { StringName _set; StringName _get; StringName _notification; + StringName _script_source; StringName dotctor; // .ctor StringNameCache(); }; - StringNameCache string_names; - int lang_idx; public: + StringNameCache string_names; + _FORCE_INLINE_ int get_language_index() { return lang_idx; } void set_language_index(int p_idx); @@ -266,6 +270,8 @@ public: virtual void get_comment_delimiters(List *p_delimiters) const; virtual void get_string_delimiters(List *p_delimiters) const; virtual Ref