diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 179f780a..1ca97690 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -16,7 +16,7 @@ jobs: name: Linting and Formatting runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/setup-python@v5 with: python-version: '3.11' @@ -38,9 +38,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Godot - uses: chickensoft-games/setup-godot@v2.2.0 + uses: chickensoft-games/setup-godot@v2.3.0 with: version: ${{ matrix.godot-version }} use-dotnet: false diff --git a/.github/workflows/godot-asset-library.yaml b/.github/workflows/godot-asset-library.yaml index e57363a1..e5941831 100644 --- a/.github/workflows/godot-asset-library.yaml +++ b/.github/workflows/godot-asset-library.yaml @@ -11,7 +11,7 @@ jobs: name: Push new release steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Push to Godot Asset Library uses: deep-entertainment/godot-asset-lib-action@v0.6.0 with: diff --git a/addons/block_code/blocks/log/to_string.tres b/addons/block_code/blocks/log/to_string.tres new file mode 100644 index 00000000..73931305 --- /dev/null +++ b/addons/block_code/blocks/log/to_string.tres @@ -0,0 +1,25 @@ +[gd_resource type="Resource" load_steps=4 format=3 uid="uid://bfugvntm6mdjm"] + +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_i1nej"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="2_xs7a8"] + +[sub_resource type="Resource" id="Resource_ie4sg"] +script = ExtResource("1_i1nej") +selected = 0 +items = ["0", "true", "Vector2(0, 0)", "Vector3(0, 0, 0)", "Color(0, 0, 0, 1)", "Object(Object, \"script\": null)"] + +[resource] +script = ExtResource("2_xs7a8") +name = &"to_string" +target_node_class = "" +description = "Converts [i]parameter[/i] to a [b]String[/b]" +category = "Log" +type = 3 +variant_type = 4 +display_template = "{parameter: NIL} to string" +code_template = "str({{parameter}})" +defaults = { +"parameter": SubResource("Resource_ie4sg") +} +signal_name = "" +is_advanced = true diff --git a/addons/block_code/code_generation/block_definition.gd b/addons/block_code/code_generation/block_definition.gd index 6ee55468..75273a73 100644 --- a/addons/block_code/code_generation/block_definition.gd +++ b/addons/block_code/code_generation/block_definition.gd @@ -289,6 +289,6 @@ static func new_variable_getter(variable: VariableDefinition) -> Resource: Types.BlockType.VALUE, variable.var_type, "%s" % variable.var_name, - "%s", + "%s" % variable.var_name, ) return block_definition diff --git a/addons/block_code/ui/blocks/block/block.gd b/addons/block_code/ui/blocks/block/block.gd index 9972cdfb..6a006174 100644 --- a/addons/block_code/ui/blocks/block/block.gd +++ b/addons/block_code/ui/blocks/block/block.gd @@ -129,7 +129,7 @@ func _get_format_string() -> String: if not definition: return "" - if definition.property_name: + if definition.property_name and TranslationServer.has_method(&"get_or_add_domain"): var domain: TranslationDomain = TranslationServer.get_or_add_domain("godot.properties") var translated_property: String = domain.translate(definition.property_name.capitalize()) # TODO: Ideally we should be also passing the context. See: diff --git a/addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.gd b/addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.gd index c9551bdf..6e03f275 100644 --- a/addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.gd +++ b/addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.gd @@ -6,6 +6,7 @@ signal drag_started(offset: Vector2) const Constants = preload("res://addons/block_code/ui/constants.gd") const OptionData = preload("res://addons/block_code/code_generation/option_data.gd") const Types = preload("res://addons/block_code/types/types.gd") +const Option_Theme = preload("res://addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.tscn::StyleBoxFlat_7m75r") signal modified @@ -286,6 +287,24 @@ func _switch_input(node: Node): c.visible = c == node _background.visible = node not in [_option_input, null] _background.is_pointy_value = node == _bool_input + if option_data: + _option_input.add_theme_stylebox_override("focus", Option_Theme) + _option_input.add_theme_stylebox_override("hover", Option_Theme) + _option_input.add_theme_stylebox_override("pressed", Option_Theme) + _option_input.add_theme_stylebox_override("normal", Option_Theme) + var raw_input = get_raw_input() + var data = str_to_var("" if raw_input == null or raw_input is Block else raw_input) + if typeof(data): + var empty_theme = StyleBoxEmpty.new() + _option_input.add_theme_stylebox_override("focus", empty_theme) + _option_input.add_theme_stylebox_override("hover", empty_theme) + _option_input.add_theme_stylebox_override("pressed", empty_theme) + _option_input.add_theme_stylebox_override("normal", empty_theme) + variant_type = typeof(data) + _background.visible = true + _background.is_pointy_value = variant_type == TYPE_BOOL + snap_point.visible = true + snap_point.variant_type = variant_type func _update_option_input(current_value: Variant = null): @@ -350,6 +369,7 @@ func _update_background_color(new_color): func _on_option_input_item_selected(index): if not editable: return + _update_visible_input() modified.emit() diff --git a/addons/block_code/ui/main_panel.gd b/addons/block_code/ui/main_panel.gd index cdc8e8f7..83d47618 100644 --- a/addons/block_code/ui/main_panel.gd +++ b/addons/block_code/ui/main_panel.gd @@ -50,6 +50,7 @@ func _ready(): _picker.block_picked.connect(_drag_manager.copy_picked_block_and_drag) _picker.variable_created.connect(_create_variable) + _picker.variables_deleted.connect(_delete_variables) _block_canvas.reconnect_block.connect(_drag_manager.connect_block_canvas_signals) _drag_manager.block_dropped.connect(save_script) _drag_manager.block_modified.connect(save_script) @@ -284,3 +285,25 @@ func _create_variable(variable: VariableDefinition): undo_redo.commit_action() _picker.reload_blocks() + + +func _delete_variables(variables_to_delete: Array): + if _context.block_code_node == null: + print("No script loaded to delete variables from.") + return + + var block_script: BlockScriptSerialization = _context.block_script + + undo_redo.create_action("Delete variables %s in %s's block code script" % [variables_to_delete, _context.parent_node.name]) + undo_redo.add_undo_property(_context.block_script, "variables", _context.block_script.variables) + + var new_variables = block_script.variables.duplicate() + for index in range(new_variables.size() - 1, -1, -1): + var variable = new_variables[index] + if variable.var_name in variables_to_delete: + new_variables.erase(variable) + + undo_redo.add_do_property(_context.block_script, "variables", new_variables) + undo_redo.commit_action() + + _picker.reload_blocks() diff --git a/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd b/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd new file mode 100644 index 00000000..1306b932 --- /dev/null +++ b/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd @@ -0,0 +1,20 @@ +@tool +extends MarginContainer + +signal delete_variables(variables: Array[String]) + +@onready var _delete_variables_dialog := %DeleteVariablesDialog +@onready var _delete_button := %DeleteButton +@onready var _delete_variables_icon = _delete_button.get_theme_icon("Remove", "EditorIcons") + + +func _ready() -> void: + _delete_button.icon = _delete_variables_icon + + +func _on_delete_button_pressed(): + _delete_variables_dialog.popup() + + +func _on_delete_variables_dialog_delete_variables(variables): + delete_variables.emit(variables) diff --git a/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd.uid b/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd.uid new file mode 100644 index 00000000..105c60b0 --- /dev/null +++ b/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd.uid @@ -0,0 +1 @@ +uid://8b8f5cd61gic diff --git a/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.tscn b/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.tscn new file mode 100644 index 00000000..7f360703 --- /dev/null +++ b/addons/block_code/ui/picker/categories/variable_category/delete_variables_button.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=5 format=3 uid="uid://ba2ckluuotftw"] + +[ext_resource type="PackedScene" uid="uid://bxkdgyj0kpexu" path="res://addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.tscn" id="1_5id0e"] +[ext_resource type="Script" uid="uid://8b8f5cd61gic" path="res://addons/block_code/ui/picker/categories/variable_category/delete_variables_button.gd" id="1_fr423"] + +[sub_resource type="Image" id="Image_fr423"] +data = { +"data": PackedByteArray(255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 231, 255, 90, 90, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 90, 90, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 42, 255, 90, 90, 0, 255, 94, 94, 0, 255, 91, 91, 42, 255, 93, 93, 233, 255, 92, 92, 232, 255, 93, 93, 41, 255, 90, 90, 0, 255, 94, 94, 0, 255, 91, 91, 42, 255, 93, 93, 233, 255, 92, 92, 232, 255, 92, 92, 0, 255, 92, 92, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 93, 93, 44, 255, 91, 91, 0, 255, 91, 91, 42, 255, 91, 91, 42, 255, 93, 93, 0, 255, 91, 91, 45, 255, 93, 93, 44, 255, 91, 91, 0, 255, 91, 91, 42, 255, 91, 91, 42, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 92, 92, 235, 255, 92, 92, 234, 255, 89, 89, 43, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 92, 92, 235, 255, 92, 92, 234, 255, 89, 89, 43, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 91, 91, 59, 255, 92, 92, 61, 255, 92, 92, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 91, 91, 59, 255, 92, 92, 61, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id="ImageTexture_sdiwn"] +image = SubResource("Image_fr423") + +[node name="DeleteVariablesButton" type="MarginContainer"] +offset_right = 186.0 +offset_bottom = 43.0 +size_flags_horizontal = 0 +theme_override_constants/margin_bottom = 12 +script = ExtResource("1_fr423") + +[node name="DeleteButton" type="Button" parent="."] +unique_name_in_owner = true +layout_mode = 2 +theme_type_variation = &"InspectorActionButton" +text = "Delete Variables" +icon = SubResource("ImageTexture_sdiwn") + +[node name="DeleteVariablesDialog" parent="." instance=ExtResource("1_5id0e")] +unique_name_in_owner = true +visible = false + +[connection signal="pressed" from="DeleteButton" to="." method="_on_delete_button_pressed"] +[connection signal="delete_variables" from="DeleteVariablesDialog" to="." method="_on_delete_variables_dialog_delete_variables"] diff --git a/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd b/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd new file mode 100644 index 00000000..47644204 --- /dev/null +++ b/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd @@ -0,0 +1,38 @@ +@tool +extends ConfirmationDialog + +const BlockCategoryDisplay = preload("res://addons/block_code/ui/picker/categories/block_category_display.gd") + +signal delete_variables(variables: Array[String]) + +@onready var _variables_container := %VariablesContainer +var _checkbox_template := CheckBox.new() +var _main_panel: Node + + +func _ready(): + _main_panel = get_parent() + + +func _on_confirmed(): + var variables := [] + for checkbox in _variables_container.get_children(): + if checkbox.button_pressed: + variables.append(checkbox.text) + + delete_variables.emit(variables) + + hide() + + +func _on_about_to_popup() -> void: + for checkbox in _variables_container.get_children(): + _variables_container.remove_child(checkbox) + checkbox.queue_free() + + while _main_panel.name != "MainPanel": + _main_panel = _main_panel.get_parent() + + for variable in _main_panel._context.block_script.variables: + _checkbox_template.text = variable.var_name + _variables_container.add_child(_checkbox_template.duplicate()) diff --git a/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd.uid b/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd.uid new file mode 100644 index 00000000..3fb38ae6 --- /dev/null +++ b/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd.uid @@ -0,0 +1 @@ +uid://duu6fvcrvhxrh diff --git a/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.tscn b/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.tscn new file mode 100644 index 00000000..8fa29e15 --- /dev/null +++ b/addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=3 uid="uid://bxkdgyj0kpexu"] + +[ext_resource type="Script" uid="uid://duu6fvcrvhxrh" path="res://addons/block_code/ui/picker/categories/variable_category/delete_variables_dialog.gd" id="1_l45s3"] + +[node name="DeleteVariablesDialog" type="ConfirmationDialog"] +title = "Delete Variables" +initial_position = 1 +size = Vector2i(300, 183) +visible = true +ok_button_text = "Delete" +dialog_hide_on_ok = false +script = ExtResource("1_l45s3") + +[node name="VariablesContainer" type="VBoxContainer" parent="."] +unique_name_in_owner = true +offset_left = 8.0 +offset_top = 8.0 +offset_right = 292.0 +offset_bottom = 134.0 + +[connection signal="about_to_popup" from="." to="." method="_on_about_to_popup"] +[connection signal="confirmed" from="." to="." method="_on_confirmed"] diff --git a/addons/block_code/ui/picker/categories/variable_category/variable_category_display.gd b/addons/block_code/ui/picker/categories/variable_category/variable_category_display.gd index 23a0bd51..f497cea1 100644 --- a/addons/block_code/ui/picker/categories/variable_category/variable_category_display.gd +++ b/addons/block_code/ui/picker/categories/variable_category/variable_category_display.gd @@ -7,6 +7,7 @@ const VariableDefinition = preload("res://addons/block_code/code_generation/vari @onready var h_separator := %HSeparator signal variable_created(variable: VariableDefinition) +signal variables_deleted(variables: Array[String]) func _ready(): @@ -22,3 +23,7 @@ func _update_blocks(): func _on_create_variable(var_name, var_type): variable_created.emit(VariableDefinition.new(var_name, Types.STRING_TO_VARIANT_TYPE[var_type])) + + +func _on_delete_variables(variables): + variables_deleted.emit(variables) diff --git a/addons/block_code/ui/picker/categories/variable_category/variable_category_display.tscn b/addons/block_code/ui/picker/categories/variable_category/variable_category_display.tscn index 955747b4..92d687df 100644 --- a/addons/block_code/ui/picker/categories/variable_category/variable_category_display.tscn +++ b/addons/block_code/ui/picker/categories/variable_category/variable_category_display.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=5 format=3 uid="uid://byne4g2yvdf3"] +[gd_scene load_steps=6 format=3 uid="uid://byne4g2yvdf3"] [ext_resource type="PackedScene" uid="uid://duhpwtfo3k0sk" path="res://addons/block_code/ui/picker/categories/block_category_display.tscn" id="1_vermd"] -[ext_resource type="Script" path="res://addons/block_code/ui/picker/categories/variable_category/variable_category_display.gd" id="2_ggvi7"] +[ext_resource type="Script" uid="uid://d1owr45rep8tx" path="res://addons/block_code/ui/picker/categories/variable_category/variable_category_display.gd" id="2_ggvi7"] [ext_resource type="PackedScene" uid="uid://t0eoc4ekvjr1" path="res://addons/block_code/ui/picker/categories/variable_category/create_variable_button.tscn" id="3_gjvnq"] +[ext_resource type="PackedScene" uid="uid://ba2ckluuotftw" path="res://addons/block_code/ui/picker/categories/variable_category/delete_variables_button.tscn" id="4_ppkk1"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0m6vh"] @@ -22,4 +23,8 @@ theme_override_styles/separator = SubResource("StyleBoxEmpty_0m6vh") [node name="CreateVariableButton" parent="VBoxContainer" index="3" instance=ExtResource("3_gjvnq")] layout_mode = 2 +[node name="DeleteVariablesButton" parent="VBoxContainer" index="4" instance=ExtResource("4_ppkk1")] +layout_mode = 2 + [connection signal="create_variable" from="VBoxContainer/CreateVariableButton" to="." method="_on_create_variable"] +[connection signal="delete_variables" from="VBoxContainer/DeleteVariablesButton" to="." method="_on_delete_variables"] diff --git a/addons/block_code/ui/picker/picker.gd b/addons/block_code/ui/picker/picker.gd index 92ffafdf..b09a4b56 100644 --- a/addons/block_code/ui/picker/picker.gd +++ b/addons/block_code/ui/picker/picker.gd @@ -26,6 +26,7 @@ const CATEGORY_ORDER_OVERRIDE = { signal block_picked(block: Block, offset: Vector2) signal variable_created(variable: VariableDefinition) +signal variables_deleted(variables: Array[String]) @onready var _context := BlockEditorContext.get_default() @@ -120,6 +121,7 @@ func _get_or_create_block_category_display(category: BlockCategory) -> BlockCate else: block_category_display = VariableCategoryDisplayScene.instantiate() block_category_display.variable_created.connect(func(variable): variable_created.emit(variable)) + block_category_display.variables_deleted.connect(func(variables): variables_deleted.emit(variables)) block_category_display.title = category.name if category else "" block_category_display.block_picked.connect(func(block: Block, offset: Vector2): block_picked.emit(block, offset))