Added a few translation helpers

This commit is contained in:
2025-05-25 14:25:07 -05:00
parent 6a39e1f2df
commit 48f3e57a44
9 changed files with 35 additions and 16 deletions

View File

@@ -61,8 +61,11 @@ func setQuestObjective(objective = null):
var quest = QUEST.quests[currentQuestKey];
var questObjective = quest.objectives[objective]
questObjectiveList.select(objective)
questObjectiveInfo.text = questObjective.title + "\n"
# Setup Description
var data = quest.getLocaleData()
data.merge(questObjective.getLocaleData())
questObjectiveInfo.text = tr(questObjective.description).format(data)
func open(questKey = null) -> void:
@@ -77,19 +80,13 @@ func close() -> void:
func isOpen() -> bool:
return self.visible
# Private methods
func _updateQuestList():
questList.clear()
questList.deselect_all()
for questKey in QUEST.quests:
var q = QUEST.quests[questKey]
var n = q.title;
if q.isCompleted():
n += " (Complete)"
elif q.isStarted():
n += " (Started)"
questList.add_item(n)
questList.add_item(q.title)
# Event handlers