From 7a9ab3867dfdfc9b63944959737c62ec903d7c31 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 30 Sep 2023 10:51:11 +0200 Subject: [PATCH] show names of npc in quest overview --- fs_manage_quests.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs_manage_quests.lua b/fs_manage_quests.lua index 38a53d7..c8a0cfe 100644 --- a/fs_manage_quests.lua +++ b/fs_manage_quests.lua @@ -195,9 +195,15 @@ yl_speak_up.get_fs_manage_quests = function(player, param) -- to be used for this quest eventually. table.insert(formspec, "style[edit_npcs,edit_locations,edit_items;bgcolor=blue;textcolor=yellow]") -- quest.npcs = {} - -- list of NPC that *may* contribute to this quest + -- list of NPC that *may* contribute to this quest (only IDs without leading n_) + -- turn that list into a more readable list of names + local npc_names = {} + for i, id in ipairs(quest.npcs or {}) do + local d = yl_speak_up.npc_list[id] or {} + table.insert(npc_names, "n_"..tostring(id).." "..(d.name or "- unknown -")) + end yl_speak_up.get_fs_show_list_in_box(formspec, - "NPC that (may) participate:", "select_from_npcs", quest.npcs or {}, + "NPC that (may) participate:", "select_from_npcs", npc_names, "24", "1.0", "5.6", "3.5", 0, nil, "#AAAAFF", "This is a list of NPC that may be relevant for this quest.\n".. "Add an NPC to this list and then edit the NPC.\n"..