From 2bfb83c702838f892781c1079d602eb017efdaee Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Tue, 15 Sep 2020 18:14:45 +0300 Subject: [PATCH] Make `Object::to_string` virtual Allows to override printing via C++, not only via script. (cherry picked from commit cfead57d1dcec669b9c4354d0b48c71281e0e26f) --- core/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/object.h b/core/object.h index 6a867392d3b..0cb8fa50bf7 100644 --- a/core/object.h +++ b/core/object.h @@ -683,7 +683,7 @@ public: void call_multilevel(const StringName &p_name, VARIANT_ARG_LIST); // C++ helper void notification(int p_notification, bool p_reversed = false); - String to_string(); + virtual String to_string(); //used mainly by script, get and set all INCLUDING string virtual Variant getvar(const Variant &p_key, bool *r_valid = NULL) const;