Skip to content

Commit a6f9366

Browse files
committed
Hint if a block will be deleted when it is dragged
1 parent 3a8630a commit a6f9366

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

addons/block_code/drag_manager/drag_manager.gd

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class Drag:
2222
get:
2323
return action
2424
set(value):
25-
action = value
25+
if action != value:
26+
action = value
27+
_update_action_hint()
2628

2729
var target_snap_point: SnapPoint:
2830
get:
@@ -122,6 +124,13 @@ class Drag:
122124
var from_global: Vector2 = _block.global_position
123125
return from_global.distance_to(snap_point.global_position)
124126

127+
func _update_action_hint():
128+
match action:
129+
DragAction.REMOVE:
130+
_block.modulate = Color(1.0, 1.0, 1.0, 0.5)
131+
_:
132+
_block.modulate = Color.WHITE
133+
125134
func _update_preview():
126135
if _preview_block:
127136
_preview_block.queue_free()

0 commit comments

Comments
 (0)