diff --git a/Scripts/UI/textbox.gd b/Scripts/UI/textbox.gd index 22aeda2..3886d45 100644 --- a/Scripts/UI/textbox.gd +++ b/Scripts/UI/textbox.gd @@ -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):