Add default argument processing for `NodePath`

pull/1488/head
A Thousand Ships 2024-06-13 17:17:33 +02:00
parent 6c4064125b
commit 37e7a6da05
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
1 changed files with 3 additions and 0 deletions

View File

@ -2562,6 +2562,7 @@ def correct_default_value(value, type_name):
"null": "nullptr", "null": "nullptr",
'""': "String()", '""': "String()",
'&""': "StringName()", '&""': "StringName()",
'^""': "NodePath()",
"[]": "Array()", "[]": "Array()",
"{}": "Dictionary()", "{}": "Dictionary()",
"Transform2D(1, 0, 0, 1, 0, 0)": "Transform2D()", # Default transform. "Transform2D(1, 0, 0, 1, 0, 0)": "Transform2D()", # Default transform.
@ -2575,6 +2576,8 @@ def correct_default_value(value, type_name):
return f"{{}}" return f"{{}}"
if value.startswith("&"): if value.startswith("&"):
return value[1::] return value[1::]
if value.startswith("^"):
return value[1::]
return value return value