1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

GDScript: Add @export_storage annotation

This commit is contained in:
Danil Alexeev
2023-12-19 20:56:30 +03:00
parent 1f5d4a62e9
commit 3a3a2011f4
16 changed files with 178 additions and 109 deletions

View File

@@ -1,15 +1,16 @@
@export_enum("Red", "Green", "Blue") var untyped
const Utils = preload("../../utils.notest.gd")
@export_enum("Red", "Green", "Blue") var weak_int = 0
@export_enum("Red", "Green", "Blue") var weak_string = ""
@export_enum("Red", "Green", "Blue") var test_untyped
@export_enum("Red", "Green", "Blue") var hard_int: int
@export_enum("Red", "Green", "Blue") var hard_string: String
@export_enum("Red", "Green", "Blue") var test_weak_int = 0
@export_enum("Red", "Green", "Blue") var test_weak_string = ""
@export_enum("Red:10", "Green:20", "Blue:30") var with_values
@export_enum("Red", "Green", "Blue") var test_hard_int: int
@export_enum("Red", "Green", "Blue") var test_hard_string: String
@export_enum("Red:10", "Green:20", "Blue:30") var test_with_values
func test():
for property in get_property_list():
if property.name in ["untyped", "weak_int", "weak_string", "hard_int",
"hard_string", "with_values"]:
prints(property.name, property.type, property.hint_string)
if str(property.name).begins_with("test_"):
Utils.print_property_extended_info(property, self)