Skip to content

Commit 91396be

Browse files
committed
BlockCanvas: Introduce _drop_node
Extract dropping nodes codes as function _drop_node from _drop_data, if the type is "nodes". So, other types such as "obj_property" can be added later. https://phabricator.endlessm.com/T35649
1 parent 097d046 commit 91396be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

addons/block_code/ui/block_canvas/block_canvas.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool:
9292

9393

9494
func _drop_data(at_position: Vector2, data: Variant) -> void:
95+
if data["type"] == "nodes":
96+
_drop_node(at_position, data)
97+
98+
99+
func _drop_node(at_position: Vector2, data: Variant) -> void:
95100
var abs_path: NodePath = data.get("nodes", []).pop_back()
96101
if abs_path == null:
97102
return

0 commit comments

Comments
 (0)