From a6f93669ac935233521de96e5f99dfc0fca461c6 Mon Sep 17 00:00:00 2001 From: Dylan McCall Date: Mon, 24 Jun 2024 17:51:06 -0700 Subject: [PATCH] Hint if a block will be deleted when it is dragged --- addons/block_code/drag_manager/drag_manager.gd | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/block_code/drag_manager/drag_manager.gd b/addons/block_code/drag_manager/drag_manager.gd index aa7697be..97c71a4f 100644 --- a/addons/block_code/drag_manager/drag_manager.gd +++ b/addons/block_code/drag_manager/drag_manager.gd @@ -22,7 +22,9 @@ class Drag: get: return action set(value): - action = value + if action != value: + action = value + _update_action_hint() var target_snap_point: SnapPoint: get: @@ -122,6 +124,13 @@ class Drag: var from_global: Vector2 = _block.global_position return from_global.distance_to(snap_point.global_position) + func _update_action_hint(): + match action: + DragAction.REMOVE: + _block.modulate = Color(1.0, 1.0, 1.0, 0.5) + _: + _block.modulate = Color.WHITE + func _update_preview(): if _preview_block: _preview_block.queue_free()