2024-10-20 22:27:27 +02:00
|
|
|
class_name ConversationActionable
|
2024-07-10 22:52:28 +02:00
|
|
|
extends Area3D
|
|
|
|
|
2024-11-01 18:07:23 +01:00
|
|
|
@export var dialogue_start: String = "start"
|
|
|
|
@export var related_quest_path: NodePath
|
|
|
|
|
2024-08-16 01:05:43 +02:00
|
|
|
@export var quest_dialogue_resource: DialogueResource
|
|
|
|
@export var default_dialogue_resource: DialogueResource
|
2024-11-01 18:07:23 +01:00
|
|
|
|
|
|
|
var related_quest:QuestBase = null
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
if not related_quest_path.is_empty():
|
|
|
|
related_quest = get_node(related_quest_path)
|
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
|
|
|
|
2024-11-01 18:07:23 +01:00
|
|
|
if related_quest != null and not related_quest.is_completed:
|
2024-08-16 01:05:43 +02:00
|
|
|
balloon.start(quest_dialogue_resource, dialogue_start, quest_states)
|
|
|
|
else:
|
|
|
|
balloon.start(default_dialogue_resource, dialogue_start, quest_states)
|