Skip to content

Commit 5cee63c

Browse files
authored
Merge branch 'endlessm:main' into zoom-in-and-out-buttons
2 parents 03721f5 + 1a0cd11 commit 5cee63c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

addons/block_code/blocks/communication/call_method_node.tres

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description = "Calls the method/function of the given node"
1010
category = "Communication | Methods"
1111
type = 2
1212
variant_type = 0
13-
display_template = "call method {method_name: STRING} in node {node: OBJECT}"
13+
display_template = "call method {method_name: STRING} on node {node: OBJECT}"
1414
code_template = "{node}.call({method_name})"
1515
defaults = {}
1616
signal_name = ""

addons/block_code/ui/main_panel.gd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func _on_block_canvas_add_block_code():
216216
undo_redo.create_action("Add block code for %s" % edited_node.name, UndoRedo.MERGE_DISABLE, edited_node)
217217

218218
undo_redo.add_do_method(edited_node, "add_child", block_code, true)
219+
undo_redo.add_do_method(self, "_select_node", block_code)
219220
undo_redo.add_do_property(block_code, "owner", scene_root)
220221
undo_redo.add_do_property(_context, "block_code_node", block_code)
221222
undo_redo.add_do_reference(block_code)
@@ -225,6 +226,11 @@ func _on_block_canvas_add_block_code():
225226
undo_redo.commit_action()
226227

227228

229+
func _select_node(node: Node):
230+
EditorInterface.get_selection().clear()
231+
EditorInterface.get_selection().add_node(node)
232+
233+
228234
func _on_block_canvas_open_scene():
229235
var edited_node: Node = EditorInterface.get_inspector().get_edited_object() as Node
230236

0 commit comments

Comments
 (0)