@@ -215,14 +215,14 @@ func _gui_input(event) -> void:
215
215
KEY_ALT :
216
216
if (Input .is_mouse_button_pressed (MOUSE_BUTTON_LEFT )
217
217
and has_graph_node_selection ()):
218
- hint_node_drop_blocked (false , true )
218
+ hint_node_drop_allowed (false )
219
219
highlight_connection (target_drop_connection )
220
220
elif not event .pressed :
221
221
var scancode_with_modifiers = event .get_keycode_with_modifiers ()
222
222
match scancode_with_modifiers :
223
223
KEY_ALT :
224
224
if has_graph_node_selection ():
225
- hint_node_drop_blocked ( true , true )
225
+ hint_node_drop_allowed ( true )
226
226
match event .get_keycode ():
227
227
KEY_SHIFT , KEY_CTRL , KEY_ALT :
228
228
var found_tip : bool = false
@@ -260,7 +260,7 @@ func _gui_input(event) -> void:
260
260
if (get_selected_nodes ().size () == 1
261
261
and event .button_mask & MOUSE_BUTTON_MASK_LEFT != 0
262
262
and event .relative .length () > 0.0 ):
263
- hint_node_drop_blocked (not event .alt_pressed , true )
263
+ hint_node_drop_allowed (not event .alt_pressed )
264
264
var node : GraphElement = get_selected_nodes ()[0 ]
265
265
if node is not GraphNode :
266
266
return
@@ -277,19 +277,16 @@ func _gui_input(event) -> void:
277
277
if conns .size () > 1 :
278
278
conns .sort_custom (compare_connection_by_port_position_y )
279
279
active_conn = conns .front ()
280
+ highlight_connection (active_conn )
280
281
if not event .alt_pressed :
281
282
target_drop_connection = active_conn
282
283
target_drop_node = node
283
- set_connection_activity (active_conn .from_node , active_conn .from_port ,
284
- active_conn .to_node , active_conn .to_port ,
285
- 0.5 if has_theme_color_override ("activity" ) else 1.0 )
286
284
else :
287
285
target_drop_connection .clear ()
288
286
target_drop_node = null
289
287
for c in get_connection_list ():
290
288
if c != active_conn :
291
- set_connection_activity (c .from_node , c .from_port ,
292
- c .to_node , c .to_port , 0.0 )
289
+ highlight_connection (c , 0.0 )
293
290
else :
294
291
remove_theme_color_override ("activity" )
295
292
remove_theme_color_override ("connection_hover_tint_color" )
@@ -325,12 +322,12 @@ func drop_node_on_connection(node : GraphNode, connection : Dictionary) -> void:
325
322
break
326
323
undoredo .end_group ()
327
324
328
- func hint_node_drop_blocked (should_block : bool , force_connection_redraw : bool = false ) -> void :
329
- if should_block :
325
+ func hint_node_drop_allowed (should_allow : bool , force_connection_redraw : bool = true ) -> void :
326
+ add_theme_color_override ("connection_hover_tint_color" , Color .TRANSPARENT )
327
+ if should_allow :
330
328
remove_theme_color_override ("activity" )
331
329
else :
332
330
add_theme_color_override ("activity" , Color .BLACK )
333
- add_theme_color_override ("connection_hover_tint_color" , Color .TRANSPARENT )
334
331
if force_connection_redraw :
335
332
get_node ("_connection_layer" ).queue_redraw ()
336
333
0 commit comments