2024-10-20 22:27:27 +02:00
|
|
|
class_name ConversationActionable
|
2024-07-10 22:52:28 +02:00
|
|
|
extends Area3D
|
|
|
|
|
2024-10-20 22:27:27 +02:00
|
|
|
signal conversation_started
|
|
|
|
|
2024-08-16 01:05:43 +02:00
|
|
|
@export var quest_dialogue_resource: DialogueResource
|
|
|
|
@export var default_dialogue_resource: DialogueResource
|
2024-07-10 22:52:28 +02:00
|
|
|
@export var dialogue_start: String = "start"
|
2024-08-16 01:05:43 +02:00
|
|
|
@onready var builder_missing_tool:QuestBuilderMissingTool = %BuilderMissingTool
|
2024-07-10 22:52:28 +02:00
|
|
|
|
2024-08-16 00:24:27 +02:00
|
|
|
func action() -> void:
|
|
|
|
var balloon = load("res://ui/dialogue/balloon.tscn").instantiate() as DialogueBaloon
|
|
|
|
|
2024-07-12 14:32:33 +02:00
|
|
|
get_tree().current_scene.add_child(balloon)
|
2024-08-16 00:24:27 +02:00
|
|
|
var quest_states = get_tree().get_nodes_in_group("quest_state")
|
2024-08-16 01:05:43 +02:00
|
|
|
|
|
|
|
if not builder_missing_tool.is_completed:
|
|
|
|
balloon.start(quest_dialogue_resource, dialogue_start, quest_states)
|
|
|
|
else:
|
|
|
|
balloon.start(default_dialogue_resource, dialogue_start, quest_states)
|
2024-10-20 22:27:27 +02:00
|
|
|
|
|
|
|
conversation_started.emit()
|