diff options
| author | Pieter-Jan Briers | 2018-02-16 14:07:19 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-02-19 22:31:33 +0100 |
| commit | f49601a93485ca05cfb53b6b4e34b1943161278f (patch) | |
| tree | e40b6a9a01fefe489475a2e971f91aa3d236dabe /modules | |
| parent | 3e6ab9f3d59056b2ca168f42e1b522b032b412be (diff) | |
| download | godot-f49601a93485ca05cfb53b6b4e34b1943161278f.tar.gz godot-f49601a93485ca05cfb53b6b4e34b1943161278f.tar.zst godot-f49601a93485ca05cfb53b6b4e34b1943161278f.zip | |
Give C# NodePath a ToString().
It already had an implicit cast operator to string,
but this doesn't get used in say string formatting.
So now something like $"path: {GetPath()}" works.
(cherry picked from commit 3c1f8efd9e5066ded2d36e99ce40511fdea79488)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index f53470626..952e03356 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -2231,7 +2231,8 @@ void BindingsGenerator::_populate_builtin_type_interfaces() { "this." BINDINGS_PTR_FIELD " = NativeCalls.godot_icall_NodePath_Ctor(path);\n" CLOSE_BLOCK_L2 MEMBER_BEGIN "public static implicit operator NodePath(string from)\n" OPEN_BLOCK_L2 "return new NodePath(from);\n" CLOSE_BLOCK_L2 MEMBER_BEGIN "public static implicit operator string(NodePath from)\n" OPEN_BLOCK_L2 - "return NativeCalls." ICALL_PREFIX "NodePath_operator_String(NodePath." CS_SMETHOD_GETINSTANCE "(from));\n" CLOSE_BLOCK_L2); + "return NativeCalls." ICALL_PREFIX "NodePath_operator_String(NodePath." CS_SMETHOD_GETINSTANCE "(from));\n" CLOSE_BLOCK_L2 + MEMBER_BEGIN "public override string ToString()\n" OPEN_BLOCK_L2 "return (string)this;\n" CLOSE_BLOCK_L2); builtin_types.insert(itype.cname, itype); // RID |
