do not count d_dynamic when counting amount of dialogs for initial setup or dialog deletion
This commit is contained in:
parent
20735916c1
commit
2329724ef2
@ -79,11 +79,14 @@ yl_speak_up.generate_next_dynamic_dialog = function(player, n_id, d_id, alternat
|
|||||||
if(not(yl_speak_up.speak_to[pname])) then
|
if(not(yl_speak_up.speak_to[pname])) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local dialog = yl_speak_up.speak_to[pname].dialog
|
||||||
|
if(not(dialog.n_dialogs["d_dynamic"])) then
|
||||||
|
dialog.n_dialogs["d_dynamic"] = {}
|
||||||
|
end
|
||||||
-- which dialog did the player come from?
|
-- which dialog did the player come from?
|
||||||
local prev_d_id = yl_speak_up.speak_to[pname].d_id
|
local prev_d_id = yl_speak_up.speak_to[pname].d_id
|
||||||
local selected_o_id = yl_speak_up.speak_to[pname].selected_o_id
|
local selected_o_id = yl_speak_up.speak_to[pname].selected_o_id
|
||||||
-- the text the NPC shall say:
|
-- the text the NPC shall say:
|
||||||
local dialog = yl_speak_up.speak_to[pname].dialog
|
|
||||||
local prev_answer = "- unknown -"
|
local prev_answer = "- unknown -"
|
||||||
local tmp_topic = "- none -"
|
local tmp_topic = "- none -"
|
||||||
if(dialog.n_dialogs[prev_d_id]
|
if(dialog.n_dialogs[prev_d_id]
|
||||||
|
@ -338,7 +338,8 @@ yl_speak_up.edit_mode_apply_changes = function(pname, fields)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- there needs to be one dialog left after deleting this one,
|
-- there needs to be one dialog left after deleting this one,
|
||||||
if(#sorted_list > 1
|
-- (as there is always d_dynamic we need to leave *two* dialogs)
|
||||||
|
if(#sorted_list > 2
|
||||||
-- this dialog isn't allowed to hold any more options/answers
|
-- this dialog isn't allowed to hold any more options/answers
|
||||||
and anz_options == 0
|
and anz_options == 0
|
||||||
-- we really found a new dialog to show
|
-- we really found a new dialog to show
|
||||||
|
@ -85,7 +85,9 @@ yl_speak_up.input_fs_initial_config = function(player, formname, fields)
|
|||||||
local count = 0
|
local count = 0
|
||||||
if(dialog and dialog.n_dialogs) then
|
if(dialog and dialog.n_dialogs) then
|
||||||
for k,v in pairs(dialog.n_dialogs) do
|
for k,v in pairs(dialog.n_dialogs) do
|
||||||
count = count + 1
|
if(k and k ~= "d_dynamic") then
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41,7 +41,9 @@ yl_speak_up.initialize_npc_dialog_once = function(pname, dialog, n_id, npc_name,
|
|||||||
local count = 0
|
local count = 0
|
||||||
if(dialog and dialog.n_dialogs) then
|
if(dialog and dialog.n_dialogs) then
|
||||||
for k,v in pairs(dialog.n_dialogs) do
|
for k,v in pairs(dialog.n_dialogs) do
|
||||||
count = count + 1
|
if(k and k ~= "d_dynamic") then
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user