store quest.var_name as quest id in npc
This commit is contained in:
parent
78f26d42a1
commit
ce067bf18e
@ -75,7 +75,9 @@ yl_speak_up.input_fs_assign_quest_step = function(player, formname, fields)
|
||||
"button[1.5,1.5;2,0.9;back_from_error_msg;Back]"})
|
||||
return
|
||||
end
|
||||
dialog.n_dialogs[d_id].d_options[o_id].quest_id = fields.quest_id
|
||||
-- we identify quests by their var_name - not by their q_id
|
||||
-- (makes it easier to transfer quests from one server to another later)
|
||||
dialog.n_dialogs[d_id].d_options[o_id].quest_id = yl_speak_up.add_pname_to_var(fields.quest_id, pname)
|
||||
dialog.n_dialogs[d_id].d_options[o_id].quest_step = fields.quest_step
|
||||
if(not(yl_speak_up.npc_was_changed[ n_id ])) then
|
||||
yl_speak_up.npc_was_changed[ n_id ] = {}
|
||||
|
@ -228,6 +228,16 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id, calle
|
||||
local quest_step_text = "button[15.4,0.1;6.0,0.9;assign_quest_step;Turn this into a quest step]"
|
||||
if( d_option.quest_id and d_option.quest_id ~= ""
|
||||
and d_option.quest_step and d_option.quest_step ~= "") then
|
||||
local q_id = ""
|
||||
local quest_name = "["..tostring(d_option.quest_id).."] - unknown quest -"
|
||||
for q_id, data in pairs(yl_speak_up.quests) do
|
||||
if(data and data.var_name == d_option.quest_id) then
|
||||
quest_name = "["..tostring(q_id)..": "..
|
||||
tostring(yl_speak_up.strip_pname_from_var(data.var_name, pname))..
|
||||
"] "..
|
||||
tostring(data.name)
|
||||
end
|
||||
end
|
||||
quest_step_text = "box[4.9,0.0;14.0,1.1;#BB77BB]"..
|
||||
"label[0.2,0.3;This is quest step:]"..
|
||||
"label[5.0,0.3;"..
|
||||
@ -236,7 +246,7 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id, calle
|
||||
"label[0.2,0.8;of the quest:]"..
|
||||
"label[5.0,0.8;"..
|
||||
minetest.colorize("#CCCCFF",
|
||||
minetest.formspec_escape(d_option.quest_id)).."]"..
|
||||
minetest.formspec_escape(quest_name)).."]"..
|
||||
"button[19.4,0.1;2.0,0.9;assign_quest_step;Change]"
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user