diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-28 01:54:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 01:54:00 +0100 |
commit | f8442b97bf7f2b445b0aca9c02629277c11064d6 (patch) | |
tree | bc43783ed10836b5f7520ef9a42b174e9a671ca8 /modules/gdnative/pluginscript | |
parent | a82765a46477209dad1eeb466d593d592167060a (diff) | |
parent | 9761bab75372b5af25a64767985d047624437925 (diff) |
Merge pull request #47420 from touilleMan/pluginscript-support-to_string
Add support for _to_string virtual function overwrite in Pluginscript
Diffstat (limited to 'modules/gdnative/pluginscript')
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_instance.cpp | 7 | ||||
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_instance.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp index 432aa80325..7f8dba0906 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.cpp +++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp @@ -93,6 +93,13 @@ void PluginScriptInstance::notification(int p_notification) { _desc->notification(_data, p_notification); } +String PluginScriptInstance::to_string(bool *r_valid) { + godot_string ret = _desc->to_string(_data, r_valid); + String str_ret = *(String *)&ret; + godot_string_destroy(&ret); + return str_ret; +} + Vector<ScriptNetData> PluginScriptInstance::get_rpc_methods() const { return _script->get_rpc_methods(); } diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h index 536eb550e0..b263c0e62c 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.h +++ b/modules/gdnative/pluginscript/pluginscript_instance.h @@ -63,6 +63,7 @@ public: virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void notification(int p_notification); + virtual String to_string(bool *r_valid); virtual Ref<Script> get_script() const; |