2024-08-16 00:24:27 +02:00
|
|
|
class_name QuestSystem
|
|
|
|
extends Node
|
|
|
|
|
|
|
|
var _quest_states:Array = []
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
_quest_states = get_tree().get_nodes_in_group("quest_state")
|
|
|
|
|
|
|
|
DialogueManager.connect("dialogue_ended", _on_dialogue_ended)
|
|
|
|
|
|
|
|
func _on_dialogue_ended(_dialog_resource: DialogueResource):
|
|
|
|
for quest_state in _quest_states:
|
2024-12-09 21:05:09 +01:00
|
|
|
if quest_state == null:
|
|
|
|
push_warning("quest_state is null")
|
|
|
|
continue
|
|
|
|
|
2024-08-16 00:24:27 +02:00
|
|
|
if quest_state.has_method("on_dialogue_ended"):
|
|
|
|
quest_state.on_dialogue_ended(_dialog_resource)
|