Skip to content

Commit ba034b6

Browse files
authored
Merge pull request #346 from endlessm/drop-godot-4.2-support
Set Godot 4.3 as minimum supported version
2 parents fe5b8f1 + 0525fbe commit ba034b6

File tree

8 files changed

+9
-24
lines changed

8 files changed

+9
-24
lines changed

.github/workflows/checks.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
name: Tests
3333
strategy:
3434
matrix:
35-
godot-version: [4.2.2, 4.3.0]
35+
godot-version:
36+
- 4.3.0
3637
runs-on: ubuntu-latest
3738
steps:
3839
- name: Checkout

addons/block_code/simple_spawner/simple_spawner.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func spawn_once():
8989
if scenes.size() == 0:
9090
return
9191

92-
_spawned_scenes = _spawned_scenes.filter(func(instance): return is_instance_valid(instance))
92+
_spawned_scenes = _spawned_scenes.filter(is_instance_valid)
9393

9494
if spawn_limit != 0 and _spawned_scenes.size() >= spawn_limit:
9595
if limit_behavior == LimitBehavior.NO_SPAWN:

addons/block_code/ui/block_canvas/block_canvas.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ signal replace_block_code
6767
func _ready():
6868
_context.changed.connect(_on_context_changed)
6969

70-
if not _open_scene_button.icon and not Util.node_is_part_of_edited_scene(self):
70+
if not _open_scene_button.icon and not self.is_part_of_edited_scene():
7171
_open_scene_button.icon = _open_scene_icon
7272
if not _zoom_out_button.icon:
7373
_zoom_out_button.icon = _icon_zoom_out
@@ -99,7 +99,7 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool:
9999
# Don't allow dropping BlockCode nodes or nodes that aren't part of the
100100
# edited scene.
101101
var node := get_tree().root.get_node(abs_path)
102-
if node is BlockCode or not Util.node_is_part_of_edited_scene(node):
102+
if node is BlockCode or not node.is_part_of_edited_scene():
103103
return false
104104

105105
# Don't allow dropping the BlockCode node's parent as that's already self.

addons/block_code/ui/blocks/block/block.gd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ func _get_parameter_defaults() -> Dictionary:
132132
if not block_extension:
133133
return definition.defaults
134134

135-
# Use Dictionary.merge instead of Dictionary.merged for Godot 4.2 compatibility
136-
var new_defaults := block_extension.get_defaults()
137-
new_defaults.merge(definition.defaults)
138-
return new_defaults
135+
return block_extension.get_defaults().merged(definition.defaults)
139136

140137

141138
func _get_or_create_block_extension() -> BlockExtension:

addons/block_code/ui/picker/categories/block_category_button.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func _ready():
1616
if not category:
1717
category = BlockCategory.new("Example", Color.RED)
1818

19-
if not Util.node_is_part_of_edited_scene(self):
19+
if not self.is_part_of_edited_scene():
2020
var new_stylebox: StyleBoxFlat = _panel.get_theme_stylebox("panel").duplicate()
2121
new_stylebox.bg_color = category.color
2222
_panel.add_theme_stylebox_override("panel", new_stylebox)

addons/block_code/ui/tooltip/tooltip.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ func override_fonts():
2727

2828

2929
func _ready():
30-
if not Util.node_is_part_of_edited_scene(self):
30+
if not self.is_part_of_edited_scene():
3131
override_fonts()

addons/block_code/ui/util.gd

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
extends Object
22

33

4-
## Polyfill of Node.is_part_of_edited_scene(), available to GDScript in Godot 4.3+.
5-
static func node_is_part_of_edited_scene(node: Node) -> bool:
6-
if not Engine.is_editor_hint():
7-
return false
8-
9-
var tree := node.get_tree()
10-
if not tree or not tree.edited_scene_root:
11-
return false
12-
13-
var edited_scene_parent := tree.edited_scene_root.get_parent()
14-
return edited_scene_parent and edited_scene_parent.is_ancestor_of(node)
15-
16-
174
## Get the path from [param reference] to [param node] within a scene.
185
##
196
## Returns the path from [param reference] to [param node] without referencing

asset-template.json.hb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"title": "Block Coding",
33
"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.",
44
"category_id": "5",
5-
"godot_version": "4.2",
5+
"godot_version": "4.3",
66
"version_string": "{{ context.release.name }}",
77
"cost": "MIT",
88
"support_level": "community",

0 commit comments

Comments
 (0)