forked from your-land-mirror/yl_speak_up
d_name support for edit_options dialog
This commit is contained in:
parent
70e1d4144c
commit
e306fe3466
@ -338,7 +338,11 @@ yl_speak_up.edit_mode_apply_changes = function(pname, fields)
|
||||
if(fields[ "d_id_"..k ]) then
|
||||
local new_target_dialog = yl_speak_up.prepare_new_dialog_for_option(
|
||||
dialog, pname, n_id, d_id, k, fields[ "d_id_"..k ], v.o_results)
|
||||
if(new_target_dialog ~= fields[ "d_id_"..k ]) then
|
||||
if(new_target_dialog ~= fields[ "d_id_"..k ]
|
||||
and not( dialog.n_dialogs[new_target_dialog]
|
||||
and dialog.n_dialogs[new_target_dialog].d_name
|
||||
and dialog.n_dialogs[new_target_dialog].d_name == fields["d_id_"..k])
|
||||
) then
|
||||
fields[ "d_id_"..k ] = new_target_dialog
|
||||
-- in options edit menu: show this update
|
||||
result["show_next_option"] = k
|
||||
|
@ -475,7 +475,9 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id, calle
|
||||
-- the first entry will be "New dialog"
|
||||
local n = 1
|
||||
for k, v in pairs(dialog.n_dialogs) do
|
||||
dialog_list = dialog_list .. "," .. minetest.formspec_escape(v.d_id or "?")
|
||||
local d_name = (v.d_name or v.d_id or "?")
|
||||
-- build the list of available dialogs for the dropdown list(s)
|
||||
dialog_list = dialog_list..","..minetest.formspec_escape(d_name)
|
||||
-- which one is the current dialog?
|
||||
n = n + 1
|
||||
if(v.d_id == target_dialog) then
|
||||
@ -710,7 +712,7 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id, calle
|
||||
else
|
||||
action_text = table.concat({action_text,
|
||||
-- allow to change the target dialog via a dropdown menu
|
||||
"dropdown[10.2,0.0;3.0,0.7;d_id_",
|
||||
"dropdown[11,0.0;9.8,0.7;d_id_",
|
||||
minetest.formspec_escape(o_id),
|
||||
";",
|
||||
dialog_list,
|
||||
@ -718,7 +720,7 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id, calle
|
||||
dialog_selected,
|
||||
",]",
|
||||
"tooltip[10.2,0.0;3.0,0.7;Select the target dialog with which the NPC shall react "..
|
||||
"to this answer. Currently, dialog \"",
|
||||
"to this answer.\nCurrently, dialog \"",
|
||||
minetest.formspec_escape(target_dialog),
|
||||
"\" is beeing displayed.;#FFFFFF;#000000]",
|
||||
-- ..and what the NPC will reply to that answer
|
||||
|
Loading…
Reference in New Issue
Block a user