extends Node
#
## Signals
signal DialogueTriggered(dialogue_name: String)
#
## Exports
#@export var dialogue_box: DialogueBox
#
## Private Variables
#var _dialogue_triggers_in_area: Array[DialogueTrigger] = []
#
## Private Methods
#func _on_map_changed(map_id: Enums.MapIds) -> void:
	#var player := GroupUtils.GetPlayerBody() as PlayerBody
	#if !player:
		#return
	#
	#dialogue_box.DialogueStarted.connect(player.QueueCutsceneState)
	#dialogue_box.DialogueEnded.connect(player.QueueEndCutsceneState)
	#
	#var dialogue_triggers := GroupUtils.GetAllDialogueTriggers()
	#
	#for trigger in dialogue_triggers:
		#trigger.DialogueTriggered.connect(_on_dialogue_triggered)
#
#
#func _on_dialogue_triggered(dialogue_name: String) -> void:
	## Wait one frame so we don't immediately close dialogue box
	## TODO This is stupid
	#await get_tree().process_frame
	#DialogueTriggered.emit(dialogue_name)
#
#
#func _on_interact_scanned(area: Area2D) -> void:
	#if area is not DialogueTrigger or _dialogue_triggers_in_area.has(area):
		#return
	#_dialogue_triggers_in_area.append(area)
#
#
#func _on_interact_unscanned(area: Area2D) -> void:
	#if area is not DialogueTrigger or !_dialogue_triggers_in_area.has(area):
		#return
	#_dialogue_triggers_in_area.erase(area)
#
#
#func _on_interact_triggered() -> void:
	#if _dialogue_triggers_in_area.is_empty():
		#return
	#
	#var trigger := _dialogue_triggers_in_area[0]
	#trigger.Trigger()
