Skip to content

Commit 8ddbecb

Browse files
committed
WIP: BlockCategoryDisplay: Re-instantiate preview blocks that have changed
1 parent c7ae4e4 commit 8ddbecb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var _blocks: Dictionary # String, Block
2222

2323
func _ready():
2424
_label.text = title # category.name if category != null else ""
25+
_context.changed.connect(_on_context_changed)
2526
_update_label()
2627
_update_blocks()
2728

@@ -73,3 +74,12 @@ func _get_or_create_block(block_definition: BlockDefinition) -> Block:
7374

7475
return block
7576

77+
78+
func _on_context_changed():
79+
if _context.block_script == null:
80+
return
81+
82+
# TODO: Re-instantiate blocks that we know might have changed.
83+
# Only do this if necessary?
84+
85+
_update_blocks()

0 commit comments

Comments
 (0)