From 4040727f7f91255c64fbe2a67e8dcefa8096fa94 Mon Sep 17 00:00:00 2001 From: Dylan McCall Date: Wed, 9 Oct 2024 18:53:00 +0200 Subject: [PATCH 1/2] blocks_catalog: Add emitting property for CPUParticles2D --- addons/block_code/code_generation/blocks_catalog.gd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/block_code/code_generation/blocks_catalog.gd b/addons/block_code/code_generation/blocks_catalog.gd index 61a288ed..227b568f 100644 --- a/addons/block_code/code_generation/blocks_catalog.gd +++ b/addons/block_code/code_generation/blocks_catalog.gd @@ -76,6 +76,14 @@ const _SETTINGS_FOR_CLASS_PROPERTY = { { "velocity": {"category": "Physics | Velocity"}, }, + "CPUParticles2D": + { + "emitting": + { + "category": "Lifecycle | Spawn", + "has_change": false, + }, + }, } static var _catalog: Dictionary From 31d35d90aa767b8624309206157ff5a756db5266 Mon Sep 17 00:00:00 2001 From: Dylan McCall Date: Thu, 10 Oct 2024 09:43:28 +0200 Subject: [PATCH 2/2] blocks: Add cpuparticles2d_finished This block is useful to do an action when a one-shot particle emitter is finished emitting. --- .../blocks/spawn/cpuparticles2d_finished.tres | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 addons/block_code/blocks/spawn/cpuparticles2d_finished.tres diff --git a/addons/block_code/blocks/spawn/cpuparticles2d_finished.tres b/addons/block_code/blocks/spawn/cpuparticles2d_finished.tres new file mode 100644 index 00000000..a70d9812 --- /dev/null +++ b/addons/block_code/blocks/spawn/cpuparticles2d_finished.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c188gpgf4rpns"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pmpup"] + +[resource] +script = ExtResource("1_pmpup") +name = &"cpuparticles2d_finished" +target_node_class = "CPUParticles2D" +description = "Emitted when all active particles have finished processing." +category = "Lifecycle | Spawn" +type = 1 +variant_type = 0 +display_template = "when particles are finished" +code_template = "" +defaults = {} +signal_name = "finished" +scope = ""