automaticly add back-button to new dialogs: Let's go back to the start of our talk.

This commit is contained in:
Sokomine 2022-10-17 08:05:11 +02:00
parent c5587f55c7
commit 9e8cc183fa

View File

@ -236,6 +236,18 @@ yl_speak_up.add_new_dialog = function(dialog, pname, next_id, dialog_text)
-- (better ask only when the new dialog is changed)
-- table.insert(yl_speak_up.npc_was_changed[ yl_speak_up.edit_mode[pname] ],
-- "Dialog "..future_d_id..": New dialog added.")
-- add an option for going back to the start of the dialog;
-- this is an option which the player can delete and change according to needs,
-- not a fixed button which may not always fit
if(not(dialog_text)) then
-- we want to go back to the start from here
local target_dialog = yl_speak_up.get_start_dialog_id(dialog)
-- this text will be used for the button
local option_text = "Let's go back to the start of our talk."
-- we just created this dialog - this will be the first option
yl_speak_up.add_new_option(dialog, pname, "1", future_d_id, option_text, target_dialog)
end
return future_d_id
end