From 7d1795e5de94e11ffe3ce6764354366b664de248 Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Wed, 10 Nov 2021 08:42:59 +0100 Subject: [PATCH 1/2] Fix: Make float dialog follow character Can be tester in room10 using "Slide" button --- addons/escoria-dialog-simple/types/floating.gd | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/escoria-dialog-simple/types/floating.gd b/addons/escoria-dialog-simple/types/floating.gd index 69bc29e42..3784eeaf8 100644 --- a/addons/escoria-dialog-simple/types/floating.gd +++ b/addons/escoria-dialog-simple/types/floating.gd @@ -45,6 +45,13 @@ func _ready(): $Tween.connect("tween_completed", self, "_on_dialog_line_typed") +func _process(delta): + # Position the RichTextLabel on the character's dialog position, if any. + rect_position = _current_character.get_node("dialog_position") \ + .get_global_transform_with_canvas().origin + rect_position.x -= rect_size.x / 2 + + # Make a character say something # # #### Parameters @@ -57,9 +64,11 @@ func say(character: String, line: String) : # Position the RichTextLabel on the character's dialog position, if any. _current_character = escoria.object_manager.get_object(character).node - rect_position = _current_character.get_node("dialog_position").get_global_transform_with_canvas().origin + rect_position = _current_character.get_node("dialog_position") \ + .get_global_transform_with_canvas().origin rect_position.x -= rect_size.x / 2 + # Start talking animation _current_character.start_talking() # Set text color to color set in the actor @@ -76,9 +85,10 @@ func say(character: String, line: String) : 0.0, 1.0, time_show_full_text, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start() + set_process(true) -# Called by the dialog player when the +# Called by the dialog player when user wants to finish dialog fast. func speedup(): if not _is_speeding_up: _is_speeding_up = true @@ -102,4 +112,5 @@ func _on_dialog_finished(): # Make the speaking item animation stop talking, if it is still alive if is_instance_valid(_current_character) and _current_character != null: _current_character.stop_talking() + set_process(false) emit_signal("say_finished") From 20fdaa21c710f2bd6d3525fe74d84a881014882b Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Thu, 11 Nov 2021 21:24:10 +0100 Subject: [PATCH 2/2] Fix: remove unnecessary set_process(false) --- addons/escoria-dialog-simple/types/floating.gd | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/escoria-dialog-simple/types/floating.gd b/addons/escoria-dialog-simple/types/floating.gd index 3784eeaf8..a802f7b45 100644 --- a/addons/escoria-dialog-simple/types/floating.gd +++ b/addons/escoria-dialog-simple/types/floating.gd @@ -112,5 +112,4 @@ func _on_dialog_finished(): # Make the speaking item animation stop talking, if it is still alive if is_instance_valid(_current_character) and _current_character != null: _current_character.stop_talking() - set_process(false) emit_signal("say_finished")