show_fs: fashion/fashion_extended

This commit is contained in:
Sokomine 2024-02-09 20:43:27 +01:00
parent 063aa7e297
commit 61b5799247
3 changed files with 25 additions and 14 deletions

View File

@ -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
)

View File

@ -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
)

View File

@ -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