From f7eb426e2ebafc5598b0e43baf37d9a50cea1648 Mon Sep 17 00:00:00 2001 From: Leonard Meagher <leonardmeagher2@gmail.com> Date: Tue, 9 Apr 2019 22:07:40 -0700 Subject: Allow overriding how scripted objects are converted to strings solves #26796 - ADD `String to_string()` method to Object which can be overriden by `String _to_string()` in scripts - ADD `String to_string(r_valid)` method to ScriptInstance to allow langauges to control how scripted objects are converted to strings - IMPLEMENT to_string for GDScriptInstance, VisualScriptInstance, and NativeScriptInstance - ADD Documentation about `Object.to_string` and `Object._to_string` - Changed `Variant::operator String` to use `obj->to_string()` --- modules/visual_script/visual_script.h | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/visual_script/visual_script.h') diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 0171b8e6f1..91748d077b 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -405,6 +405,7 @@ public: virtual bool has_method(const StringName &p_method) const; virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); virtual void notification(int p_notification); + String to_string(bool *r_valid); bool set_variable(const StringName &p_variable, const Variant &p_value) { -- cgit v1.2.3