diff options
author | Leonard Meagher <leonardmeagher2@gmail.com> | 2019-04-09 22:07:40 -0700 |
---|---|---|
committer | Leonard Meagher <leonardmeagher2@gmail.com> | 2019-05-03 15:06:05 -0700 |
commit | f7eb426e2ebafc5598b0e43baf37d9a50cea1648 (patch) | |
tree | 5dfda6e83e3b59b1a52923d7fead0aea4ff15ff2 /modules/gdnative/nativescript/nativescript.h | |
parent | 5772f60f960ee8c396574f0c6f94def18bb210c7 (diff) |
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()`
Diffstat (limited to 'modules/gdnative/nativescript/nativescript.h')
-rw-r--r-- | modules/gdnative/nativescript/nativescript.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index a6865c6243..be1c499714 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -208,6 +208,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); virtual Ref<Script> get_script() const; virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const; virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const; |