moved frashion to yl_speak_up.show_fs

This commit is contained in:
Sokomine 2021-05-31 21:35:50 +02:00
parent 4095be4e43
commit 4c9c66e7c1
2 changed files with 18 additions and 13 deletions

View File

@ -1799,9 +1799,17 @@ yl_speak_up.show_fs = function(player, fs_name, param)
end end
local pname = player:get_player_name() local pname = player:get_player_name()
if(fs_name == "trade_list") then if(fs_name == "TODO") then
minetest.show_formspec(pname, elseif(fs_name == "fashion") then
"yl_speak_up:trade_list", minetest.show_formspec(pname, "yl_speak_up:fashion",
yl_speak_up.get_fs_fashion(pname))
elseif(fs_name == "inventory") then
minetest.show_formspec(pname, "yl_speak_up:inventory",
yl_speak_up.get_fs_inventory(player))
elseif(fs_name == "trade_list") then
minetest.show_formspec(pname, "yl_speak_up:trade_list",
yl_speak_up.get_fs_trade_list(player)) yl_speak_up.get_fs_trade_list(player))
elseif(fs_name == "trade_simple") then elseif(fs_name == "trade_simple") then
@ -1809,8 +1817,7 @@ yl_speak_up.show_fs = function(player, fs_name, param)
if(not(param) and yl_speak_up.speak_to[pname]) then if(not(param) and yl_speak_up.speak_to[pname]) then
param = yl_speak_up.speak_to[pname].trade_id param = yl_speak_up.speak_to[pname].trade_id
end end
minetest.show_formspec(pname, minetest.show_formspec(pname, "yl_speak_up:do_trade_simple",
"yl_speak_up:do_trade_simple",
yl_speak_up.get_fs_trade_simple(player, param)) yl_speak_up.get_fs_trade_simple(player, param))
elseif(fs_name == "add_trade_simple") then elseif(fs_name == "add_trade_simple") then
@ -1818,8 +1825,7 @@ yl_speak_up.show_fs = function(player, fs_name, param)
if(not(param) and yl_speak_up.speak_to[pname]) then if(not(param) and yl_speak_up.speak_to[pname]) then
param = yl_speak_up.speak_to[pname].trade_id param = yl_speak_up.speak_to[pname].trade_id
end end
minetest.show_formspec(pname, minetest.show_formspec(pname, "yl_speak_up:add_trade_simple",
"yl_speak_up:add_trade_simple",
yl_speak_up.get_fs_add_trade_simple(player, param)) yl_speak_up.get_fs_add_trade_simple(player, param))
-- fallback in case of wrong call -- fallback in case of wrong call
else else
@ -2939,7 +2945,7 @@ yl_speak_up.input_talk = function(player, formname, fields)
-- the player wants to access the inventory of the NPC -- the player wants to access the inventory of the NPC
if(edit_mode and fields.show_inventory) then if(edit_mode and fields.show_inventory) then
-- the inventory is just an inventory with a back button; come back to this dialog here -- the inventory is just an inventory with a back button; come back to this dialog here
minetest.show_formspec(pname, "yl_speak_up:inventory", yl_speak_up.get_fs_inventory(player)) yl_speak_up.show_fs(player, "inventory")
return return
end end
@ -2948,7 +2954,7 @@ yl_speak_up.input_talk = function(player, formname, fields)
local dialog = yl_speak_up.speak_to[pname].dialog local dialog = yl_speak_up.speak_to[pname].dialog
-- necessary so that the fashin formspec can be created -- necessary so that the fashin formspec can be created
yl_speak_up.speak_to[pname].n_npc = dialog.n_npc yl_speak_up.speak_to[pname].n_npc = dialog.n_npc
minetest.show_formspec(pname, "yl_speak_up:fashion", yl_speak_up.get_fs_fashion(pname)) yl_speak_up.show_fs(player, "fashion")
return return
end end
@ -3748,7 +3754,7 @@ yl_speak_up.input_fashion = function(player, formname, fields)
--yl_speak_up.speak_to[pname].textures = textures --yl_speak_up.speak_to[pname].textures = textures
end end
minetest.show_formspec(pname, "yl_speak_up:fashion", yl_speak_up.get_fs_fashion(pname)) yl_speak_up.show_fs(player, "fashion")
end end
function yl_speak_up.fashion(player, obj) function yl_speak_up.fashion(player, obj)
@ -3772,7 +3778,7 @@ function yl_speak_up.fashion(player, obj)
yl_speak_up.speak_to[pname].n_npc = "Unknown" yl_speak_up.speak_to[pname].n_npc = "Unknown"
end end
minetest.show_formspec(pname, "yl_speak_up:fashion", yl_speak_up.get_fs_fashion(pname)) yl_speak_up.show_fs(player, "fashion")
end end

View File

@ -36,8 +36,7 @@ yl_speak_up.input_trade_list = function(player, formname, fields)
-- show the inventory of the NPC -- show the inventory of the NPC
if(fields.show_inventory) then if(fields.show_inventory) then
minetest.show_formspec(pname, "yl_speak_up:inventory", yl_speak_up.show_fs(player, "inventory")
yl_speak_up.get_fs_inventory(player))
return return
end end
-- TODO: and otherwise? -- TODO: and otherwise?