class_name LeverDialogues
extends CanvasLayer

@export var dialogues : Array[Dialogue]

var finished_animation = false

@onready var dialogue_box: DialogueBox = $DialogueBox

func start_dialogue():
	_cutscene_start()
	dialogue_box.dialogues = dialogues[Globals.current_active_levers].dialogue.duplicate()
	dialogue_box.start()

func _on_dialogue_box_dialogue_finished() -> void:
	_cutscene_end()

func _cutscene_start():
	show()
	GUI.in_game_gui.hide()
	Globals.pause()
	SceneChanger.mid_animation = true

func _cutscene_end():
	Globals.unpause()
	GUI.in_game_gui.show()
	SceneChanger.mid_animation = false
	hide()
