extends CanvasLayer func is_in_dialog(): return in_dialog var in_dialog = false func set_dialog(message, speaker=""): $Dialog.show() in_dialog = true $Dialog/Textbox/Speaker.text = speaker $Dialog/Textbox/Body.text = message func finish_dialog(): in_dialog = false $Dialog.hide() func clear_choices(): $Dialog/Choices.hide() for i in range($Dialog/Choices.get_child_count()): $Dialog/Choices.get_child(i).queue_free() func add_choice(speaker : Node, choice_id : int, choice_text : String): var button = Button.new() button.text = choice_text button.connect("button_down", speaker, "_on_choice", [choice_id]) $Dialog/Choices.add_child(button) func show_choices(): $Dialog/Choices.show()