From 58fe04cd49c4a29ba7cb60b1dce275147b71b6bd Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 22 Sep 2023 00:29:31 +0200 Subject: [PATCH] show in add_quest_steps how many locations *set* a quest step --- fs_add_quest_steps.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/fs_add_quest_steps.lua b/fs_add_quest_steps.lua index b20fab9..eb9361d 100644 --- a/fs_add_quest_steps.lua +++ b/fs_add_quest_steps.lua @@ -250,10 +250,11 @@ yl_speak_up.quest_step_list_show_table = function(formspec, table_specs, liste, "color;text,align=right;".. -- #d.one_step_required "color;text,align=right;".. -- #d.all_steps_required "color;text,align=right;".. -- #required_for_steps (quest steps that need this one) + "color;text,align=right;".. -- #where (locations/NPC that *set* this quest step) "color;text,align=left".. -- name of quest step "]table[") table.insert(formspec, table_specs) - table.insert(formspec,"#FFFFFF,(O),#FFFFFF,(A),#FFFFFF,(U),#FFFFFF,Name of step:,") + table.insert(formspec,"#FFFFFF,(O),#FFFFFF,(A),#FFFFFF,(U),#FFFFFF,(L),#FFFFFF,Name of step:,") local tmp = {} for i, s in ipairs(liste or {}) do local d = data[s] @@ -269,6 +270,16 @@ yl_speak_up.quest_step_list_show_table = function(formspec, table_specs, liste, required_for_steps[s] = {} end grey_if_zero(tmp, #required_for_steps[s]) + + if(not(d.where) or type(d.where) ~= "table") then + d.where = {} + end + local anz_where = 0 + for k, v in pairs(d.where) do + anz_where = anz_where + 1 + end + grey_if_zero(tmp, anz_where) + table.insert(tmp, "#AAFFAA") table.insert(tmp, minetest.formspec_escape(s)) end @@ -424,7 +435,9 @@ yl_speak_up.get_fs_add_quest_steps = function(player, param) table.insert(formspec, ";Legend: The numbers show the amount of quest steps...\n".. "\t(O) from which (o)ne needs to be achieved for this quest step\n".. "\t(A) that (a)ll need to be achieved for this quest step\n".. - "\t(U) that require/(u)se this quest step in some form]") + "\t(U) that require/(u)se this quest step in some form\n".. + "\t(L) Number of locations (npc/places) that ".. + minetest.colorize("#9999FF", "set").." this quest step]") return table.concat(formspec, "") end