Player can take quests, Adventurers in progress.

This commit is contained in:
2025-08-06 22:31:36 -04:00
parent d705ed0496
commit 6bfbd4b70c
15 changed files with 175 additions and 16 deletions

View File

@@ -9,7 +9,7 @@ var enabled: bool:
enable(value)
var quest : Quest
@onready var status_label = %StatusLabel
func enable(en: bool) -> void:
_enabled = en
@@ -20,6 +20,7 @@ func enable(en: bool) -> void:
func setup(qst : Quest) -> void:
quest = qst
quest.status_changed.connect(_on_quest_status_changed)
%NameLabel.text = quest.name
#TODO: Add star rating
#%LevelLabel.text = str(data.level)
@@ -30,3 +31,10 @@ func _on_gui_input(event: InputEvent) -> void:
var evt = event as InputEventMouseButton
if evt and evt.button_index == MOUSE_BUTTON_LEFT and evt.pressed:
print("Quest clicked!")
func _on_quest_status_changed(status: Quest.Status) -> void:
match(status):
Quest.Status.OPEN: status_label.text = "OPEN"
Quest.Status.COMPLETED: queue_free()
Quest.Status.IN_PROGRESS: status_label.text = "IN PROGRESS"
_: status_label.text = "Taken"