mirror of
https://gitea.your-land.de/Sokomine/yl_speak_up.git
synced 2025-06-17 06:08:06 +02:00
try to perserve d_<nr> dialog names in update_dialog
This commit is contained in:
parent
0d76f7492a
commit
000978ef50
@ -165,9 +165,15 @@ yl_speak_up.update_dialog = function(log, dialog, dialog_name, dialog_text)
|
|||||||
end
|
end
|
||||||
local is_new = false
|
local is_new = false
|
||||||
if(not(d_id)) then
|
if(not(d_id)) then
|
||||||
|
local next_id = nil
|
||||||
|
-- if dialog_name matches the d_<nr> pattern but d_<nr> does not exist,
|
||||||
|
-- then try to create *that* dialog
|
||||||
|
if(dialog_name and string.sub(dialog_name, 1, 2) == "d_") then
|
||||||
|
next_id = tonumber(string.sub(dialog_name, 3))
|
||||||
|
end
|
||||||
-- pname is nil - thus no logging and no adding of a back to start option
|
-- pname is nil - thus no logging and no adding of a back to start option
|
||||||
-- next_id is also nil - so just add a new dialog
|
-- next_id is also usually nil - so just add a new dialog
|
||||||
d_id = yl_speak_up.add_new_dialog(dialog, nil, nil, dialog_text)
|
d_id = yl_speak_up.add_new_dialog(dialog, nil, next_id, dialog_text)
|
||||||
if(not(d_id)) then
|
if(not(d_id)) then
|
||||||
-- the creation may have failed (i.e. dialog not beeing a dialog,
|
-- the creation may have failed (i.e. dialog not beeing a dialog,
|
||||||
-- or too many dialogs in dialog already)
|
-- or too many dialogs in dialog already)
|
||||||
|
Loading…
Reference in New Issue
Block a user