forked from Sokomine/yl_speak_up
show_fs: trade_via_buy_button
This commit is contained in:
parent
9f44bb1961
commit
77e6906f0e
@ -357,3 +357,21 @@ yl_speak_up.get_fs_trade_via_buy_button = function(player, trade_id)
|
||||
"tooltip[next_trade;Show next trade offer]")
|
||||
return table.concat(formspec, '')
|
||||
end
|
||||
|
||||
|
||||
yl_speak_up.get_fs_trade_via_buy_button_wrapper = function(player, param)
|
||||
local pname = player:get_player_name()
|
||||
-- the optional parameter param is the trade_id
|
||||
if(not(param) and yl_speak_up.speak_to[pname]) then
|
||||
param = yl_speak_up.speak_to[pname].trade_id
|
||||
end
|
||||
return yl_speak_up.get_trade_via_buy_button(player, param)
|
||||
end
|
||||
|
||||
|
||||
yl_speak_up.register_fs("trade_via_buy_button",
|
||||
yl_speak_up.input_trade_via_buy_button,
|
||||
yl_speak_up.get_fs_trade_via_buy_button_wrapper,
|
||||
-- force formspec version 1:
|
||||
1
|
||||
)
|
||||
|
12
show_fs.lua
12
show_fs.lua
@ -48,10 +48,6 @@ yl_speak_up.input_handler = function(player, formname, fields)
|
||||
elseif formname == "yl_speak_up:player_offers_item" then
|
||||
yl_speak_up.input_player_offers_item(player, formname, fields)
|
||||
return true
|
||||
-- handled in fs_trade_via_buy_button.lua
|
||||
elseif formname == "yl_speak_up:trade_via_buy_button" then
|
||||
yl_speak_up.input_trade_via_buy_button(player, formname, fields)
|
||||
return true
|
||||
-- handled in fs_initial_config.lua
|
||||
elseif formname == "yl_speak_up:initial_config" then
|
||||
yl_speak_up.input_fs_initial_config(player, formname, fields)
|
||||
@ -224,14 +220,6 @@ yl_speak_up.show_fs = function(player, fs_name, param)
|
||||
yl_speak_up.show_fs_ver(pname, "yl_speak_up:player_offers_item",
|
||||
yl_speak_up.get_fs_player_offers_item(player, param), 1)
|
||||
|
||||
elseif(fs_name == "trade_via_buy_button") then
|
||||
-- the optional parameter param is the trade_id
|
||||
if(not(param) and yl_speak_up.speak_to[pname]) then
|
||||
param = yl_speak_up.speak_to[pname].trade_id
|
||||
end
|
||||
yl_speak_up.show_fs_ver(pname, "yl_speak_up:trade_via_buy_button",
|
||||
yl_speak_up.get_fs_trade_via_buy_button(player, param), 1)
|
||||
|
||||
elseif(fs_name == "initial_config") then
|
||||
if(not(param)) then
|
||||
param = {}
|
||||
|
Loading…
Reference in New Issue
Block a user