From 06f325cb0c7c03c3acf826109d931d10cd9600e9 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 14 Oct 2024 11:03:22 +0200 Subject: [PATCH 1/5] SimpleSpawner: Add unit suffixes to exported properties I learned about this annotation in a workshop hosted by Nathan from GDQuest. --- addons/block_code/simple_spawner/simple_spawner.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/block_code/simple_spawner/simple_spawner.gd b/addons/block_code/simple_spawner/simple_spawner.gd index fac71698..16b20fb7 100644 --- a/addons/block_code/simple_spawner/simple_spawner.gd +++ b/addons/block_code/simple_spawner/simple_spawner.gd @@ -23,11 +23,11 @@ enum LimitBehavior { REPLACE, NO_SPAWN } ## The period of time in seconds to spawn another component. If zero, they won't spawn ## automatically. Use the "Spawn" block. -@export_range(0.0, 10.0, 0.1, "or_greater") var spawn_frequency: float = 0.0: +@export_range(0.0, 10.0, 0.1, "or_greater", "suffix:s") var spawn_frequency: float = 0.0: set = _set_spawn_fraquency ## How many spawned scenes are allowed. If zero, there is no limit. -@export_range(0, 50, 0.1, "or_greater") var spawn_limit: int = 50 +@export_range(0, 50, 0.1, "or_greater", "suffix:scenes") var spawn_limit: int = 50 ## What happens when the limit is reached and a new spawn is attempted: ## - Replace: Remove the oldest spawned scene and spawn a new one. From 5e3a10c5990c122968954b283daf464abdd78826 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Wed, 23 Oct 2024 10:21:19 +0100 Subject: [PATCH 2/5] Support aliases for block definitions This will allow us to add backwards-compatibility aliases to preserve existing programs when we rename a block for some reason. --- .../code_generation/block_definition.gd | 1 + .../code_generation/blocks_catalog.gd | 21 +++++++++++++------ .../block_script_serialization.gd | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/addons/block_code/code_generation/block_definition.gd b/addons/block_code/code_generation/block_definition.gd index 26ac9e70..3418493a 100644 --- a/addons/block_code/code_generation/block_definition.gd +++ b/addons/block_code/code_generation/block_definition.gd @@ -6,6 +6,7 @@ const Types = preload("res://addons/block_code/types/types.gd") const FORMAT_STRING_PATTERN = "\\[(?[^\\]]+)\\]|\\{(?[^}]+)\\}|(?