allow to enter a dialog_text when adding a new dialog via function add_new_dialog

This commit is contained in:
Sokomine 2022-10-08 22:16:32 +02:00
parent 4cb12c2d2d
commit b2cddab50a

View File

@ -215,7 +215,7 @@ end
-- the option to override next_id and provide a value is needed when a new dialog was
-- added, then edited, and then discarded; it's still needed after that, but has to
-- be reset to empty state (wasn't stored before)
yl_speak_up.add_new_dialog = function(dialog, pname, next_id)
yl_speak_up.add_new_dialog = function(dialog, pname, next_id, dialog_text)
if(not(next_id)) then
next_id = yl_speak_up.find_next_id(dialog.n_dialogs)
end
@ -224,7 +224,7 @@ yl_speak_up.add_new_dialog = function(dialog, pname, next_id)
dialog.n_dialogs[future_d_id] = {
d_id = future_d_id,
d_type = "text",
d_text = "",
d_text = (dialog_text or ""),
d_sort = next_id
}
-- store that there have been changes to this npc