forked from your-land-mirror/yl_speak_up
added update_start_dialog for ink import
This commit is contained in:
parent
7ce56ca733
commit
543c767dd5
@ -264,6 +264,27 @@ yl_speak_up.update_dialog_options_completed = function(log, dialog, d_id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- make sure only one dialog has d_sort set to 0 (and is thus the start dialog)
|
||||||
|
yl_speak_up.update_start_dialog = function(log, dialog, start_dialog_name)
|
||||||
|
local start_d_id = yl_speak_up.d_name_to_d_id(dialog, start_dialog_name)
|
||||||
|
if(not(start_d_id)) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for d_id, d in pairs(dialog.n_dialogs) do
|
||||||
|
if(d_id == start_d_id) then
|
||||||
|
if(not(d.d_sort) or d.d_sort ~= 0) then
|
||||||
|
table.insert(log, "Setting start dialog to "..tostring(start_dialog_name)..".")
|
||||||
|
end
|
||||||
|
d.d_sort = 0
|
||||||
|
-- the start dialog certainly is *a* start dialog (with the buttons)
|
||||||
|
d.is_a_start_dialog = true
|
||||||
|
elseif(not(d.d_sort) or d.d_sort == 0) then
|
||||||
|
-- all other dialogs are not *the* start dialog
|
||||||
|
d.d_sort = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- add a new option/answer to dialog d_id with option_text (or default "")
|
-- add a new option/answer to dialog d_id with option_text (or default "")
|
||||||
-- option_text (optional) the text that shall be shown as option/answer
|
-- option_text (optional) the text that shall be shown as option/answer
|
||||||
|
Loading…
Reference in New Issue
Block a user