diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-19 11:21:00 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-19 11:21:00 +0200 |
commit | 6761923f4f90c9f564e94e6845471d504d5f63f1 (patch) | |
tree | 4f045525c02757278c1c3ff4e595598fffd488e0 /modules/gdscript/tests/scripts/parser/features/export_variable.gd | |
parent | f58a96cfa20530268a9b35efc8cd7ddad1900a8b (diff) | |
parent | 76b2d85c9fb10426fad78a8d2dbafd8ca08a4b89 (diff) | |
download | redot-engine-6761923f4f90c9f564e94e6845471d504d5f63f1.tar.gz |
Merge pull request #90716 from dalexeev/gds-fix-export-annotation-issues
GDScript: Fix some export annotation issues
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/features/export_variable.gd')
-rw-r--r-- | modules/gdscript/tests/scripts/parser/features/export_variable.gd | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.gd index 2a218774de..8b343de5ef 100644 --- a/modules/gdscript/tests/scripts/parser/features/export_variable.gd +++ b/modules/gdscript/tests/scripts/parser/features/export_variable.gd @@ -2,19 +2,43 @@ extends Node const Utils = preload("../../utils.notest.gd") +# Built-in types. @export var test_weak_int = 1 @export var test_hard_int: int = 2 -@export_storage var test_storage_untyped -@export_storage var test_storage_weak_int = 3 # Property info still `Variant`, unlike `@export`. -@export_storage var test_storage_hard_int: int = 4 @export_range(0, 100) var test_range = 100 @export_range(0, 100, 1) var test_range_step = 101 @export_range(0, 100, 1, "or_greater") var test_range_step_or_greater = 102 @export var test_color: Color @export_color_no_alpha var test_color_no_alpha: Color @export_node_path("Sprite2D", "Sprite3D", "Control", "Node") var test_node_path := ^"hello" -@export var test_node: Node -@export var test_node_array: Array[Node] + +# Enums. +@export var test_side: Side +@export var test_atm: AutoTranslateMode + +# Resources and nodes. +@export var test_image: Image +@export var test_timer: Timer + +# Arrays. +@export var test_array: Array +@export var test_array_bool: Array[bool] +@export var test_array_array: Array[Array] +@export var test_array_side: Array[Side] +@export var test_array_atm: Array[AutoTranslateMode] +@export var test_array_image: Array[Image] +@export var test_array_timer: Array[Timer] + +# `@export_storage`. +@export_storage var test_storage_untyped +@export_storage var test_storage_weak_int = 3 # Property info still `Variant`, unlike `@export`. +@export_storage var test_storage_hard_int: int = 4 + +# `@export_custom`. +# NOTE: `PROPERTY_USAGE_NIL_IS_VARIANT` flag will be removed. +@export_custom(PROPERTY_HINT_ENUM, "A,B,C") var test_export_custom_untyped +@export_custom(PROPERTY_HINT_ENUM, "A,B,C") var test_export_custom_weak_int = 5 +@export_custom(PROPERTY_HINT_ENUM, "A,B,C") var test_export_custom_hard_int: int = 6 func test(): for property in get_property_list(): |