1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

GDScript: Fix some export annotation issues

This commit is contained in:
Danil Alexeev
2024-04-15 22:10:47 +03:00
parent bdc0316217
commit 76b2d85c9f
13 changed files with 249 additions and 150 deletions

View File

@@ -55,18 +55,18 @@ static func get_human_readable_hint_string(property: Dictionary) -> String:
if elem_type_hint.is_valid_int():
elem_type = elem_type_hint.to_int()
type_hint_prefixes += type_string(elem_type) + ":"
type_hint_prefixes += "<%s>:" % type_string(elem_type)
else:
if elem_type_hint.count("/") != 1:
push_error("Invalid PROPERTY_HINT_TYPE_STRING format.")
elem_type = elem_type_hint.get_slice("/", 0).to_int()
elem_hint = elem_type_hint.get_slice("/", 1).to_int()
type_hint_prefixes += "%s/%s:" % [
type_string(elem_type),
get_property_hint_name(elem_hint).trim_prefix("PROPERTY_HINT_"),
type_hint_prefixes += "<%s>/<%s>:" % [
type_string(elem_type),
get_property_hint_name(elem_hint).trim_prefix("PROPERTY_HINT_"),
]
if elem_type < TYPE_ARRAY:
if elem_type < TYPE_ARRAY or hint_string.is_empty():
break
return type_hint_prefixes + hint_string
@@ -76,10 +76,11 @@ static func get_human_readable_hint_string(property: Dictionary) -> String:
static func print_property_extended_info(property: Dictionary, base: Object = null, is_static: bool = false) -> void:
print(get_property_signature(property, base, is_static))
print(' hint=%s hint_string="%s" usage=%s' % [
print(' hint=%s hint_string="%s" usage=%s class_name=&"%s"' % [
get_property_hint_name(property.hint).trim_prefix("PROPERTY_HINT_"),
get_human_readable_hint_string(property),
get_human_readable_hint_string(property).c_escape(),
get_property_usage_string(property.usage).replace("PROPERTY_USAGE_", ""),
property.class_name.c_escape(),
])