Browse Source

Make `Object::to_string` virtual

Allows to override printing via C++, not only via script.

(cherry picked from commit cfead57d1dcec669b9c4354d0b48c71281e0e26f)
Andrii Doroshenko (Xrayez) 4 years ago
parent
commit
2bfb83c702
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/object.h

+ 1 - 1
core/object.h

@@ -683,7 +683,7 @@ public:
 	void call_multilevel(const StringName &p_name, VARIANT_ARG_LIST); // C++ helper
 	void call_multilevel(const StringName &p_name, VARIANT_ARG_LIST); // C++ helper
 
 
 	void notification(int p_notification, bool p_reversed = false);
 	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
 	//used mainly by script, get and set all INCLUDING string
 	virtual Variant getvar(const Variant &p_key, bool *r_valid = NULL) const;
 	virtual Variant getvar(const Variant &p_key, bool *r_valid = NULL) const;