diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2024-09-26 20:34:29 +0300 |
---|---|---|
committer | Mack <86566939+Macksaur@users.noreply.github.com> | 2024-09-27 22:24:15 +0100 |
commit | 85dfd896536ff04dba4afd7d461a28e0ac4b9aee (patch) | |
tree | 26583e929ae35235c783fcd9b6de43805ce5434d /modules/gdscript/tests/scripts/parser/features/export_variable.gd | |
parent | 76a135926aef1f02f27e4e09093787f2c670956d (diff) | |
download | redot-engine-85dfd896536ff04dba4afd7d461a28e0ac4b9aee.tar.gz |
Add `@export_tool_button` annotation for easily creating inspector buttons
Co-authored-by: jordi <creptthrust@gmail.com>
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Co-authored-by: Mack <86566939+Macksaur@users.noreply.github.com>
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/features/export_variable.gd')
-rw-r--r-- | modules/gdscript/tests/scripts/parser/features/export_variable.gd | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.gd index 1e134d0e0e..8aa449f602 100644 --- a/modules/gdscript/tests/scripts/parser/features/export_variable.gd +++ b/modules/gdscript/tests/scripts/parser/features/export_variable.gd @@ -1,3 +1,4 @@ +@tool class_name ExportVariableTest extends Node @@ -47,6 +48,10 @@ const PreloadedUnnamedClass = preload("./export_variable_unnamed.notest.gd") @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 +# `@export_tool_button`. +@export_tool_button("Click me!") var test_tool_button_1: Callable +@export_tool_button("Click me!", "ColorRect") var test_tool_button_2: Callable + func test(): for property in get_property_list(): if str(property.name).begins_with("test_"): |