From 7e0f7c8567d5bedf994477782dd243b2b8239af0 Mon Sep 17 00:00:00 2001 From: Salia Nifo Date: Mon, 11 Nov 2024 12:11:40 -0500 Subject: [PATCH] Visual Timeline Editor: Allow selecting single block from selection (#2462) Allows selecting a single event from the currently selected events (deselecting the rest). --- .../TimelineEditor/VisualEditor/timeline_editor_visual.gd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index 8319d047a..9036188cd 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -312,6 +312,11 @@ func _on_event_block_gui_input(event: InputEvent, item: Node) -> void: drag_allowed = true + if event.is_released() and not %TimelineArea.dragging and not Input.is_key_pressed(KEY_SHIFT): + if len(selected_items) > 1 and item in selected_items and not Input.is_key_pressed(KEY_CTRL): + deselect_all_items() + select_item(item) + if len(selected_items) > 0 and event is InputEventMouseMotion: if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT): if !%TimelineArea.dragging and !get_viewport().gui_is_dragging() and drag_allowed: