From b2cddab50a0e6028a770f885f6feff33c04e7b09 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 8 Oct 2022 22:16:32 +0200 Subject: [PATCH] allow to enter a dialog_text when adding a new dialog via function add_new_dialog --- functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.lua b/functions.lua index f5b21b8..f634d7b 100644 --- a/functions.lua +++ b/functions.lua @@ -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