From 5f7166d9aed52a7b3e939d7bb72edeb457e577b8 Mon Sep 17 00:00:00 2001 From: Salia Nifo Date: Mon, 28 Oct 2024 22:14:59 -0400 Subject: [PATCH 1/5] Fix multiple copied items order --- .../TimelineEditor/VisualEditor/timeline_editor_visual.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index 8319d047a..f71517322 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -1104,10 +1104,10 @@ func _input(event:InputEvent) -> void: "Ctrl+V": var events_list := get_clipboard_data() - var paste_position := -1 + var paste_position := 0 if selected_items: paste_position = selected_items[-1].get_index()+1 - else: + elif %Timeline.get_child_count() > 0: paste_position = %Timeline.get_child_count()-1 if events_list: TimelineUndoRedo.create_action("[D] Pasting "+str(len(events_list))+" event(s).") From a0c98f609cae309c545832b861b45c13407f8dd7 Mon Sep 17 00:00:00 2001 From: Salia Nifo Date: Mon, 28 Oct 2024 22:34:06 -0400 Subject: [PATCH 2/5] Fix box containers not copied when performing copy/paste --- .../Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index f71517322..c88c45efb 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -1099,6 +1099,7 @@ func _input(event:InputEvent) -> void: get_viewport().set_input_as_handled() "Ctrl+C": + select_events_indexed(get_events_indexed(selected_items)) copy_selected_events() get_viewport().set_input_as_handled() From d87086381210b8a44aa6e382b6c1124c863dd455 Mon Sep 17 00:00:00 2001 From: Salia Nifo Date: Tue, 29 Oct 2024 14:49:47 -0400 Subject: [PATCH 3/5] Minor changes --- .../TimelineEditor/VisualEditor/timeline_editor_visual.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index c88c45efb..dce50fa55 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -1108,8 +1108,8 @@ func _input(event:InputEvent) -> void: var paste_position := 0 if selected_items: paste_position = selected_items[-1].get_index()+1 - elif %Timeline.get_child_count() > 0: - paste_position = %Timeline.get_child_count()-1 + else: + paste_position = %Timeline.get_child_count() if events_list: TimelineUndoRedo.create_action("[D] Pasting "+str(len(events_list))+" event(s).") TimelineUndoRedo.add_do_method(add_events_at_index.bind(events_list, paste_position)) From 060daea8263f95dab471c59fbeb629dac47aa761 Mon Sep 17 00:00:00 2001 From: Salia Nifo Date: Mon, 11 Nov 2024 10:10:47 -0500 Subject: [PATCH 4/5] Fix pasting events not loading custom defaults --- .../TimelineEditor/VisualEditor/timeline_editor_visual.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index dce50fa55..7a576eb4c 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -471,7 +471,7 @@ func add_events_indexed(indexed_events:Dictionary) -> void: event_resource = i.duplicate() break - event_resource.from_text(indexed_events[event_idx]) + event_resource._load_from_string(indexed_events[event_idx]) # now create the visual block. deselect_all_items() From 9dc7a4ea66d1e48078e3f2cb217e3343dedd2205 Mon Sep 17 00:00:00 2001 From: Salia Nifo Date: Mon, 11 Nov 2024 12:49:25 -0500 Subject: [PATCH 5/5] Change to_text to _store_as_string to keep translation ids --- .../TimelineEditor/VisualEditor/timeline_editor_visual.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index 7a576eb4c..e74ad0804 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -425,12 +425,12 @@ func get_events_indexed(events:Array) -> Dictionary: if event.resource is DialogicEndBranchEvent: continue - indexed_dict[event.get_index()] = event.resource.to_text() + indexed_dict[event.get_index()] = event.resource._store_as_string() # store an end branch if it is selected or connected to a selected event if 'end_node' in event and event.end_node: event = event.end_node - indexed_dict[event.get_index()] = event.resource.to_text() + indexed_dict[event.get_index()] = event.resource._store_as_string() elif event.resource is DialogicEndBranchEvent: if event.parent_node in events: # add local index indexed_dict[event.get_index()] += str(events.find(event.parent_node)) @@ -542,7 +542,7 @@ func copy_selected_events() -> void: var event_copy_array := [] for item in selected_items: - event_copy_array.append(item.resource.to_text()) + event_copy_array.append(item.resource._store_as_string()) if item.resource is DialogicEndBranchEvent: if item.parent_node in selected_items: # add local index event_copy_array[-1] += str(selected_items.find(item.parent_node))