diff --git a/editor/fs/fs_fashion.lua b/editor/fs/fs_fashion.lua index 28cd68b..bed667b 100644 --- a/editor/fs/fs_fashion.lua +++ b/editor/fs/fs_fashion.lua @@ -251,3 +251,16 @@ yl_speak_up.get_fs_fashion = function(pname) nil, h) end + +yl_speak_up.get_fs_fashion_wrapper = function(player, param) + local pname = player:get_player_name() + return yl_speak_up.get_fs_fashion(pname) +end + + +yl_speak_up.register_fs("fashion", + yl_speak_up.input_fashion, + yl_speak_up.get_fs_fashion_wrapper, + -- no special formspec required: + nil +) diff --git a/editor/fs/fs_fashion_extended.lua b/editor/fs/fs_fashion_extended.lua index 2eac0fd..d36a37b 100644 --- a/editor/fs/fs_fashion_extended.lua +++ b/editor/fs/fs_fashion_extended.lua @@ -191,3 +191,15 @@ yl_speak_up.get_fs_fashion_extended = function(pname) return table.concat(formspec, "") end + +yl_speak_up.get_fs_fashion_extended_wrapper = function(player, param) + local pname = player:get_player_name() + return yl_speak_up.get_fs_fashion_extended(pname) +end + +yl_speak_up.register_fs("fashion_extended", + yl_speak_up.input_fashion_extended, + yl_speak_up.get_fs_fashion__extended_wrapper, + -- no special formspec required: + nil +) diff --git a/show_fs.lua b/show_fs.lua index 6494334..5f4bb02 100644 --- a/show_fs.lua +++ b/show_fs.lua @@ -48,12 +48,6 @@ yl_speak_up.input_handler = function(player, formname, fields) elseif formname == "yl_speak_up:talk" then yl_speak_up.input_talk(player, formname, fields) return true - elseif formname == "yl_speak_up:fashion" then - yl_speak_up.input_fashion(player, formname, fields) - return true - elseif formname == "yl_speak_up:fashion_extended" then - yl_speak_up.input_fashion_extended(player, formname, fields) - return true -- handled in inventory.lua elseif formname == "yl_speak_up:inventory" then yl_speak_up.input_inventory(player, formname, fields) @@ -268,14 +262,6 @@ yl_speak_up.show_fs = function(player, fs_name, param) -- recursion depth from autoanswer: 0 (the player selected manually) yl_speak_up.get_fs_talkdialog(player, param.n_id, param.d_id, param.alternate_text,0)) - elseif(fs_name == "fashion") then - yl_speak_up.show_fs_ver(pname, "yl_speak_up:fashion", - yl_speak_up.get_fs_fashion(pname)) - - elseif(fs_name == "fashion_extended") then - yl_speak_up.show_fs_ver(pname, "yl_speak_up:fashion_extended", - yl_speak_up.get_fs_fashion_extended(pname)) - elseif(fs_name == "inventory") then -- this is a very classical formspec; it works far better with OLD fs; -- force formspec version 1