Skip to content

Commit

Permalink
Merge pull request #263 from endlessm/fix-add-block-code-picker
Browse files Browse the repository at this point in the history
block_canvas: Select the new block code node in add block code
  • Loading branch information
dbnicholson authored Oct 11, 2024
2 parents 36eaba5 + a704cb8 commit 1a0cd11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/block_code/ui/main_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func _on_block_canvas_add_block_code():
undo_redo.create_action("Add block code for %s" % edited_node.name, UndoRedo.MERGE_DISABLE, edited_node)

undo_redo.add_do_method(edited_node, "add_child", block_code, true)
undo_redo.add_do_method(self, "_select_node", block_code)
undo_redo.add_do_property(block_code, "owner", scene_root)
undo_redo.add_do_property(_context, "block_code_node", block_code)
undo_redo.add_do_reference(block_code)
Expand All @@ -225,6 +226,11 @@ func _on_block_canvas_add_block_code():
undo_redo.commit_action()


func _select_node(node: Node):
EditorInterface.get_selection().clear()
EditorInterface.get_selection().add_node(node)


func _on_block_canvas_open_scene():
var edited_node: Node = EditorInterface.get_inspector().get_edited_object() as Node

Expand Down

0 comments on commit 1a0cd11

Please sign in to comment.