adding and deleting quest step assignments to poptions is now logged

This commit is contained in:
Sokomine 2023-11-03 15:33:01 +01:00
parent 696a36a145
commit 58976ec35b
2 changed files with 14 additions and 10 deletions

View File

@ -326,6 +326,13 @@ yl_speak_up.input_fs_add_quest_steps = function(player, formname, fields)
end
-- show the newly created or selected step
yl_speak_up.speak_to[pname].quest_step = work_step
-- log the change
yl_speak_up.log_change(pname, n_id,
"Dialog "..tostring(d_id)..": Option "..tostring(o_id)..
" will now set quest step \""..
tostring(dialog.n_dialogs[d_id].d_options[o_id].quest_step)..
"\" of quest \""..
tostring(dialog.n_dialogs[d_id].d_options[o_id].quest_id).."\".")
return yl_speak_up.show_fs(player, "manage_quest_steps", work_step)
elseif(not(current_step) or not(step_data[current_step])) then
return yl_speak_up.show_fs(player, "manage_quests")

View File

@ -134,6 +134,13 @@ yl_speak_up.input_fs_assign_quest_step = function(player, formname, fields)
if(not(n_id)) then
return show_error_fs(player, "NPC or location not found.")
end
-- log the change
yl_speak_up.log_change(pname, n_id,
"Dialog "..tostring(d_id)..": Option "..tostring(o_id)..
" no longer sets quest step \""..
tostring(dialog.n_dialogs[d_id].d_options[o_id].quest_step)..
"\" of quest \""..
tostring(dialog.n_dialogs[d_id].d_options[o_id].quest_id).."\".")
-- we have updated the quest step data - we need to update the NPC as well
local dialog = yl_speak_up.load_dialog(n_id, false)
if(yl_speak_up.check_if_dialog_has_option(dialog, d_id, o_id)) then
@ -153,16 +160,6 @@ yl_speak_up.input_fs_assign_quest_step = function(player, formname, fields)
yl_speak_up.show_fs(player, "edit_option_dialog",
{n_id = n_id, d_id = d_id, o_id = o_id})
return
-- TODO: log the change
-- if(not(yl_speak_up.npc_was_changed[ n_id ])) then
-- yl_speak_up.npc_was_changed[ n_id ] = {}
-- end
-- table.insert(yl_speak_up.npc_was_changed[ n_id ],
-- "Dialog "..d_id..": Option "..tostring(o_id)..
-- " no longer provides quest step \""..
-- tostring(fields.quest_step).."\" for quest \""..tostring(fields.quest_id).."\".")
-- yl_speak_up.show_fs(player, "edit_option_dialog",
-- {n_id = n_id, d_id = d_id, o_id = o_id})
elseif(not(fields) or not(fields.save)) then
return
end