Prevent dialogue from prompting closes after a dialogue is completed

This commit is contained in:
Mario Martínez 2024-10-09 12:37:17 +02:00
parent 0bfcbbf5f1
commit 26089afdbb

View file

@ -57,15 +57,15 @@ func _process(delta):
indicator.visible = i == _direction && !_displaying && !animation_player.is_playing()
func _input(event):
if event.is_action_pressed("ui_accept"):
if event.is_action_pressed("ui_accept") and _dialogue.size() > 0:
if _displaying:
_display_text = _text
_displaying = false
get_viewport().set_input_as_handled()
elif _display_text == _text:
dialogue_continued.emit()
_dialogue_continue()
get_viewport().set_input_as_handled()
dialogue_continued.emit()
func _dialogue_start(_who: Util.CastCharacter, dialogue: Array[String], direction: TextboxDirection):
_next = 0
@ -89,6 +89,7 @@ func _end_dialogue():
_text = ""
_display_text = ""
_displaying = false # just in case
_dialogue = []
animation_player.play("hide_" + _directions[_direction])
func _on_animation_finished(anim_name: StringName):