forked from your-land-mirror/yl_speak_up
moved setdialog to yl_speak_up.show_fs
This commit is contained in:
parent
60d17124b6
commit
a6a2b3f566
@ -1800,6 +1800,15 @@ yl_speak_up.show_fs = function(player, fs_name, param)
|
||||
local pname = player:get_player_name()
|
||||
|
||||
if(fs_name == "TODO") then
|
||||
elseif(fs_name == "setdialog") then
|
||||
if(not(param)) then
|
||||
param = {}
|
||||
end
|
||||
minetest.show_formspec(pname, "yl_speak_up:setdialog",
|
||||
get_fs_setdialog(player, param.n_id, param.d_id))
|
||||
|
||||
-- "confirm_save" does not have its own option here; doesn't have a get_fs_-function either
|
||||
|
||||
elseif(fs_name == "edit_option_dialog") then
|
||||
if(not(param)) then
|
||||
param = {}
|
||||
@ -1892,7 +1901,7 @@ yl_speak_up.input_optiondialog = function(player, formname, fields)
|
||||
yl_speak_up.speak_to[pname].n_id = n_id
|
||||
yl_speak_up.speak_to[pname].d_id = d_id
|
||||
|
||||
minetest.show_formspec(pname, "yl_speak_up:setdialog", get_fs_setdialog(player, n_id, d_id))
|
||||
yl_speak_up.show_fs(player, "setdialog", {n_id = n_id, d_id = d_id})
|
||||
return
|
||||
end
|
||||
|
||||
@ -2099,7 +2108,7 @@ yl_speak_up.input_setdialog = function(player, formname, fields)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.show_formspec(pname, "yl_speak_up:setdialog", get_fs_setdialog(player, n_id, d_id))
|
||||
yl_speak_up.show_fs(player, "setdialog", {n_id = n_id, d_id = d_id})
|
||||
return
|
||||
end
|
||||
|
||||
@ -2107,11 +2116,7 @@ yl_speak_up.input_setdialog = function(player, formname, fields)
|
||||
if fields.button_delete and fields.d_id then
|
||||
delete_dialog(n_id, fields.d_id)
|
||||
yl_speak_up.speak_to[pname].d_id = yl_speak_up.text_new_dialog_id
|
||||
minetest.show_formspec(
|
||||
pname,
|
||||
"yl_speak_up:setdialog",
|
||||
get_fs_setdialog(player, n_id, yl_speak_up.text_new_dialog_id)
|
||||
)
|
||||
yl_speak_up.show_fs(player, "setdialog", {n_id = n_id, d_id = yl_speak_up.text_new_dialog_id})
|
||||
yl_speak_up.log_change(pname, n_id,
|
||||
"(staff) Deleted dialog "..tostring(fields.d_id)..".")
|
||||
end
|
||||
@ -2119,7 +2124,7 @@ yl_speak_up.input_setdialog = function(player, formname, fields)
|
||||
-- Change in Dropdown List: Show dialog formspec again with different dialog selected
|
||||
if fields.d_id then
|
||||
yl_speak_up.speak_to[pname].d_id = fields.d_id
|
||||
minetest.show_formspec(pname, "yl_speak_up:setdialog", get_fs_setdialog(player, n_id, fields.d_id))
|
||||
yl_speak_up.show_fs(player, "setdialog", {n_id = n_id, d_id = fields.d_id})
|
||||
end
|
||||
end
|
||||
|
||||
@ -3292,11 +3297,7 @@ function yl_speak_up.config(clicker, npc)
|
||||
-- find out who owns the npc while we still have easy access to the luaentity
|
||||
yl_speak_up.npc_owner[ n_id ] = npc:get_luaentity().owner
|
||||
|
||||
minetest.show_formspec(
|
||||
pname,
|
||||
"yl_speak_up:setdialog",
|
||||
get_fs_setdialog(clicker, n_id, yl_speak_up.text_new_dialog_id)
|
||||
)
|
||||
yl_speak_up.show_fs(clicker, "setdialog", {n_id = n_id, d_id = yl_speak_up.text_new_dialog_id})
|
||||
end
|
||||
|
||||
--###
|
||||
|
Loading…
Reference in New Issue
Block a user