show npcs, locations and items in manage_quests

This commit is contained in:
Sokomine 2023-09-25 01:37:16 +02:00
parent 234a18efff
commit b621fe7b12

View File

@ -137,11 +137,6 @@ yl_speak_up.get_fs_manage_quests = function(player, param)
-- -> determined from quests.npcs and quests.locations
quest.is_subquest_of = {} -- list of quest_ids this quest contributes to
-- -> determined from quests.npcs and quests.locations
quest.npcs = {} -- list of NPC that contribute to this quest
-- -> derived from quest.var_name
quest.locations = {} -- list of locations that contribute to this quest
-- -> derived from quest.var_name
quest.items = {} -- data of quest items created and accepted
quest.rewards = {} -- list of rewards (item stacks) for this ques
quest.testers = {} -- list of player names that can test the quest
-- -> during the created/testing phase: any player for which
@ -170,12 +165,46 @@ yl_speak_up.get_fs_manage_quests = function(player, param)
nil)
yl_speak_up.get_fs_show_list_in_box(formspec,
"Quest ends with steps:", "select_from_end_steps", lists.end_steps,
"0.1", "8.0", "5.6", "3.5", "0.1", nil, "#AAFFAA",
"0.1", "8.0", "5.6", "3.5", 0, nil, "#AAFFAA",
"This quest ends with these steps. They are not required\n"..
"by any other steps and have no successor.\n"..
"Your quest needs at least one end step.",
nil)
-- right side:
-- All these values could in theory either be derived from quest.var_name
-- and/or from quest.step_data.where.
-- These lists here are needed regardless of that because they may be used
-- to add NPC/locations/quest items that are *not yet* used but are planned
-- 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
yl_speak_up.get_fs_show_list_in_box(formspec,
"NPC that (may) participate:", "select_from_npcs", quest.npcs or {},
"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"..
"Now you can set quest steps from this quest in the NPC's options.",
"button[4.6,0.0;0.94,0.7;edit_npcs;Edit]")
-- quest.locations = {}
-- list of locations that *may* contribute to this quest
yl_speak_up.get_fs_show_list_in_box(formspec,
"Locations:", "select_from_locations", quest.locations or {},
"24", "4.5", "5.6", "3.5", 0, nil, "#AAAAFF",
"This is a list of locations that may be relevant for this quest.\n"..
"It works the same way as for the NPC above.",
"button[4.6,0.0;0.94,0.7;edit_locations;Edit]")
-- quest.items = {}
-- data of quest items that *may* be created and/or accepted in this quest
yl_speak_up.get_fs_show_list_in_box(formspec,
"Quest items:", "select_from_quest_items", quest.items or {},
"24", "8.0", "5.6", "3.5", 0, nil, "#FFFFFF",
"This is a list of quest items.\n"..
"Add quest items here in order to use them more easily in your NPC.",
"button[4.6,0.0;0.94,0.7;edit_items;Edit]")
-- store the quest ID so that we know what we're working at
yl_speak_up.speak_to[pname].q_id = quest.id
return table.concat(formspec, "")