Improve null and object printing to avoid confusion with arrays

- Use different syntax for object printing to avoid confusion with arrays.
- Print null as `<null>` to avoid confusion with a string `"null"`.
- Display `<empty>` in editor resource pickers to avoid confusion
  with array-based properties.
This commit is contained in:
Hugo Locurcio 2022-07-25 00:15:20 +02:00
parent de5f13e935
commit 291d3aaabe
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
8 changed files with 13 additions and 13 deletions

View file

@ -1,5 +1,5 @@
GDTEST_OK
null
<null>
0
1
2

View file

@ -1,2 +1,2 @@
GDTEST_OK
123456789101112131415161718192212223242526272829303132333435363738394041424344454647falsetruenull
123456789101112131415161718192212223242526272829303132333435363738394041424344454647falsetrue<null>

View file

@ -1,4 +1,4 @@
GDTEST_OK
null
<null>
true
false

View file

@ -1319,7 +1319,7 @@ void godotsharp_object_to_string(Object *p_ptr, godot_string *r_str) {
#endif
// Can't call 'Object::to_string()' here, as that can end up calling 'ToString' again resulting in an endless circular loop.
memnew_placement(r_str,
String("[" + p_ptr->get_class() + ":" + itos(p_ptr->get_instance_id()) + "]"));
String("<" + p_ptr->get_class() + "#" + itos(p_ptr->get_instance_id()) + ">"));
}
#ifdef __cplusplus