26 lines
821 B
GDScript
26 lines
821 B
GDScript
class_name ConversationActionable
|
|
extends Area3D
|
|
|
|
@export var dialogue_start: String = "start"
|
|
@export var related_quest_path: NodePath
|
|
|
|
@export var quest_dialogue_resource: DialogueResource
|
|
@export var default_dialogue_resource: DialogueResource
|
|
|
|
var related_quest:QuestBase = null
|
|
|
|
func _ready():
|
|
if not related_quest_path.is_empty():
|
|
related_quest = get_node(related_quest_path)
|
|
|
|
func action() -> void:
|
|
var balloon = load("res://ui/dialogue/balloon.tscn").instantiate() as DialogueBaloon
|
|
|
|
get_tree().current_scene.add_child(balloon)
|
|
var quest_states = get_tree().get_nodes_in_group("quest_state")
|
|
|
|
if related_quest != null and not related_quest.is_completed:
|
|
balloon.start(quest_dialogue_resource, dialogue_start, quest_states)
|
|
else:
|
|
balloon.start(default_dialogue_resource, dialogue_start, quest_states)
|