Skip to content

Commit 9aae2bb

Browse files
committed
Block: Add setter to manage bottom_snap
Add a setter for bottom_snap_path so that bottom_snap can be set immediately without waiting for the node to become ready. This simplifies testing as the Block doesn't need to be added to a scene to work correctly. https://phabricator.endlessm.com/T35573
1 parent 6ea45f7 commit 9aae2bb

File tree

1 file changed

+7
-2
lines changed
  • addons/block_code/ui/blocks/block

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ signal modified
2424
@export var category: String
2525

2626
## The next block in the line of execution (can be null if end)
27-
@export var bottom_snap_path: NodePath
27+
@export var bottom_snap_path: NodePath:
28+
set = _set_bottom_snap_path
2829

2930
## The scope of the block (statement of matching entry block)
3031
@export var scope: String = ""
@@ -35,8 +36,12 @@ signal modified
3536
var bottom_snap: SnapPoint
3637

3738

38-
func _ready():
39+
func _set_bottom_snap_path(value: NodePath):
40+
bottom_snap_path = value
3941
bottom_snap = get_node_or_null(bottom_snap_path)
42+
43+
44+
func _ready():
4045
mouse_filter = Control.MOUSE_FILTER_IGNORE
4146

4247

0 commit comments

Comments
 (0)