allow to add sort_oder to update_dialog_option

This commit is contained in:
Sokomine 2025-01-02 18:14:22 +01:00
parent dc223d99f5
commit d9d10112cf

View File

@ -336,7 +336,7 @@ end
-- Note: Preconditions, actions and effects are not handled here (apart from the "dialog"
-- effect/result for the redirection to the target dialog)
yl_speak_up.update_dialog_option = function(log, dialog, dialog_name, option_name, option_text, target_dialog,
alternate_text, visit_only_once)
alternate_text, visit_only_once, sort_order)
-- does the dialog we want to add to exist?
local d_id = yl_speak_up.d_name_to_d_id(dialog, dialog_name)
if(not(d_id)) then
@ -515,6 +515,10 @@ yl_speak_up.update_dialog_option = function(log, dialog, dialog_name, option_nam
and o_data.o_visit_only_once and o_data.o_visit_only_once == 1) then
o_data.o_visit_only_once = nil
end
-- set sort order of options (no logging because that might get too spammy)
if(sort_oder) then
o_data.o_sort = sort_order
end
return o_id
end