diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 12cd71c5..1d4e315c 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -32,7 +32,8 @@ jobs: name: Tests strategy: matrix: - godot-version: [4.2.2, 4.3.0] + godot-version: + - 4.3.0 runs-on: ubuntu-latest steps: - name: Checkout diff --git a/addons/block_code/simple_spawner/simple_spawner.gd b/addons/block_code/simple_spawner/simple_spawner.gd index acae8032..89e3f3d3 100644 --- a/addons/block_code/simple_spawner/simple_spawner.gd +++ b/addons/block_code/simple_spawner/simple_spawner.gd @@ -89,7 +89,7 @@ func spawn_once(): if scenes.size() == 0: return - _spawned_scenes = _spawned_scenes.filter(func(instance): return is_instance_valid(instance)) + _spawned_scenes = _spawned_scenes.filter(is_instance_valid) if spawn_limit != 0 and _spawned_scenes.size() >= spawn_limit: if limit_behavior == LimitBehavior.NO_SPAWN: diff --git a/addons/block_code/ui/block_canvas/block_canvas.gd b/addons/block_code/ui/block_canvas/block_canvas.gd index ef07844b..a9b385f4 100644 --- a/addons/block_code/ui/block_canvas/block_canvas.gd +++ b/addons/block_code/ui/block_canvas/block_canvas.gd @@ -67,7 +67,7 @@ signal replace_block_code func _ready(): _context.changed.connect(_on_context_changed) - if not _open_scene_button.icon and not Util.node_is_part_of_edited_scene(self): + if not _open_scene_button.icon and not self.is_part_of_edited_scene(): _open_scene_button.icon = _open_scene_icon if not _zoom_out_button.icon: _zoom_out_button.icon = _icon_zoom_out @@ -99,7 +99,7 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool: # Don't allow dropping BlockCode nodes or nodes that aren't part of the # edited scene. var node := get_tree().root.get_node(abs_path) - if node is BlockCode or not Util.node_is_part_of_edited_scene(node): + if node is BlockCode or not node.is_part_of_edited_scene(): return false # Don't allow dropping the BlockCode node's parent as that's already self. diff --git a/addons/block_code/ui/blocks/block/block.gd b/addons/block_code/ui/blocks/block/block.gd index fea24b3c..6a6f851e 100644 --- a/addons/block_code/ui/blocks/block/block.gd +++ b/addons/block_code/ui/blocks/block/block.gd @@ -132,10 +132,7 @@ func _get_parameter_defaults() -> Dictionary: if not block_extension: return definition.defaults - # Use Dictionary.merge instead of Dictionary.merged for Godot 4.2 compatibility - var new_defaults := block_extension.get_defaults() - new_defaults.merge(definition.defaults) - return new_defaults + return block_extension.get_defaults().merged(definition.defaults) func _get_or_create_block_extension() -> BlockExtension: diff --git a/addons/block_code/ui/picker/categories/block_category_button.gd b/addons/block_code/ui/picker/categories/block_category_button.gd index 4edb3123..06fa7fb0 100644 --- a/addons/block_code/ui/picker/categories/block_category_button.gd +++ b/addons/block_code/ui/picker/categories/block_category_button.gd @@ -16,7 +16,7 @@ func _ready(): if not category: category = BlockCategory.new("Example", Color.RED) - if not Util.node_is_part_of_edited_scene(self): + if not self.is_part_of_edited_scene(): var new_stylebox: StyleBoxFlat = _panel.get_theme_stylebox("panel").duplicate() new_stylebox.bg_color = category.color _panel.add_theme_stylebox_override("panel", new_stylebox) diff --git a/addons/block_code/ui/tooltip/tooltip.gd b/addons/block_code/ui/tooltip/tooltip.gd index 5f165021..76306b11 100644 --- a/addons/block_code/ui/tooltip/tooltip.gd +++ b/addons/block_code/ui/tooltip/tooltip.gd @@ -27,5 +27,5 @@ func override_fonts(): func _ready(): - if not Util.node_is_part_of_edited_scene(self): + if not self.is_part_of_edited_scene(): override_fonts() diff --git a/addons/block_code/ui/util.gd b/addons/block_code/ui/util.gd index 70c84781..2a856de1 100644 --- a/addons/block_code/ui/util.gd +++ b/addons/block_code/ui/util.gd @@ -1,19 +1,6 @@ extends Object -## Polyfill of Node.is_part_of_edited_scene(), available to GDScript in Godot 4.3+. -static func node_is_part_of_edited_scene(node: Node) -> bool: - if not Engine.is_editor_hint(): - return false - - var tree := node.get_tree() - if not tree or not tree.edited_scene_root: - return false - - var edited_scene_parent := tree.edited_scene_root.get_parent() - return edited_scene_parent and edited_scene_parent.is_ancestor_of(node) - - ## Get the path from [param reference] to [param node] within a scene. ## ## Returns the path from [param reference] to [param node] without referencing diff --git a/asset-template.json.hb b/asset-template.json.hb index d9539075..a0093ae6 100644 --- a/asset-template.json.hb +++ b/asset-template.json.hb @@ -2,7 +2,7 @@ "title": "Block Coding", "description": "Create games using a high-level, block-based visual programming language.\r\n\r\nIntended as an educational tool for learners in the earlier stages of their journey towards becoming game developers. This plugin lets you create your first games with high-level blocks, avoiding the immediate need to learn to code in GDScript. Building games in this way provides a gentle introduction to programming concepts and allows you to focus your efforts on becoming familiar with the rest of the Godot Editor UI.", "category_id": "5", - "godot_version": "4.2", + "godot_version": "4.3", "version_string": "{{ context.release.name }}", "cost": "MIT", "support_level": "community",