Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowan-Spooner committed Apr 18, 2024
2 parents bd0eb69 + 46764c8 commit 7c07f22
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func _ready():
syntax_highlighter = code_completion_helper.syntax_highlighter
timeline_editor.editors_manager.sidebar.content_item_activated.connect(_on_content_item_clicked)


func _on_text_editor_text_changed():
timeline_editor.current_resource_state = DialogicEditor.ResourceStates.UNSAVED
request_code_completion(true)
Expand Down Expand Up @@ -40,7 +41,7 @@ func save_timeline():
if !timeline_editor.current_resource:
return

var text_array:Array = text_timeline_to_array(text)
var text_array: Array = text_timeline_to_array(text)

timeline_editor.current_resource.events = text_array
timeline_editor.current_resource.events_processed = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ func add_events_indexed(indexed_events:Dictionary) -> void:
selected_items = events
visual_update_selection()
indent_events()
something_changed()


## Deletes events based on an indexed dictionary
Expand All @@ -507,8 +508,8 @@ func delete_events_indexed(indexed_events:Dictionary) -> void:
%Timeline.get_child(idx-idx_shift).get_parent().remove_child(%Timeline.get_child(idx-idx_shift))
idx_shift += 1

something_changed()
indent_events()
something_changed()


func delete_selected_events() -> void:
Expand All @@ -533,7 +534,6 @@ func cut_events_indexed(indexed_events:Dictionary) -> void:
select_events_indexed(indexed_events)
copy_selected_events()
delete_events_indexed(indexed_events)
indent_events()


func copy_selected_events() -> void:
Expand Down Expand Up @@ -934,7 +934,6 @@ func _on_event_popup_menu_index_pressed(index:int) -> void:
TimelineUndoRedo.add_undo_method(add_events_indexed.bind(events_indexed))
TimelineUndoRedo.commit_action()
indent_events()
something_changed()


func _on_right_sidebar_resized() -> void:
Expand Down Expand Up @@ -992,9 +991,7 @@ func duplicate_selected() -> void:
var at_index: int = selected_items[-1].get_index()+1
TimelineUndoRedo.create_action("[D] Duplicate "+str(len(events))+" event(s).")
TimelineUndoRedo.add_do_method(add_events_at_index.bind(events, at_index))
TimelineUndoRedo.add_do_method(something_changed)
TimelineUndoRedo.add_undo_method(delete_events_at_index.bind(at_index, len(events)))
TimelineUndoRedo.add_undo_method(something_changed)
TimelineUndoRedo.commit_action()


Expand Down Expand Up @@ -1119,6 +1116,7 @@ func _input(event:InputEvent) -> void:
TimelineUndoRedo.commit_action()
get_viewport().set_input_as_handled()


"Ctrl+X":
var events_indexed := get_events_indexed(selected_items)
TimelineUndoRedo.create_action("[D] Cut "+str(len(selected_items))+" event(s).")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func _ready() -> void:
_error = text_system.connect(&'animation_textbox_hide', get_pointer().hide)
_error = text_system.connect(&'meta_hover_started', _on_dialogic_display_dialog_text_meta_hover_started)
_error = text_system.connect(&'meta_hover_ended', _on_dialogic_display_dialog_text_meta_hover_ended)
_error = text_system.connect(&'meta_clicked', _on_dialogic_display_dialog_text_meta_clicked)


func _try_translate(tr_base: String, property: StringName, fallback_entry: Dictionary) -> String:
Expand Down Expand Up @@ -159,8 +158,6 @@ func _on_dialogic_display_dialog_text_meta_hover_started(meta: String) -> void:
get_panel().self_modulate = title_color
get_panel_point().self_modulate = title_color

DialogicUtil.autoload().Inputs.action_was_consumed = true


## Method that keeps the bubble at mouse position when visible
func _process(_delta: float) -> void:
Expand All @@ -175,11 +172,7 @@ func _process(_delta: float) -> void:
## Method that hides the bubble
func _on_dialogic_display_dialog_text_meta_hover_ended(_meta:String) -> void:
get_pointer().hide()
DialogicUtil.autoload().Inputs.action_was_consumed = false


func _on_dialogic_display_dialog_text_meta_clicked(_meta:String) -> void:
DialogicUtil.autoload().Inputs.action_was_consumed = true


func _apply_export_overrides() -> void:
Expand Down
6 changes: 6 additions & 0 deletions addons/dialogic/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ func _save_external_data() -> void:
editor_view.editors_manager.save_current_resource()


func _get_unsaved_status(for_scene:String) -> String:
if for_scene.is_empty():
_save_external_data()
return ""


func _handles(object) -> bool:
if _editor_view_and_manager_exist() and object is Resource:
return editor_view.editors_manager.can_edit_resource(object)
Expand Down

0 comments on commit 7c07f22

Please sign in to comment.