Update select_item handling

master
Wuzzy 2018-05-17 15:18:19 +02:00
parent fa14d27191
commit 9aca0379b7
1 changed files with 24 additions and 22 deletions

View File

@ -24,7 +24,8 @@ end
if minetest.get_modpath("select_item") then
-- When player selects item via "select item" dialog, switch the
-- machine's selected item and update the formspec.
select_item.register_on_select_item(function(playername, itemstring)
select_item.register_on_select_item(function(playername, dialogname, itemstring)
if dialogname == "easyvend:trade_item" then
local player = minetest.get_player_by_name(playername)
if not player then
return
@ -50,6 +51,7 @@ if minetest.get_modpath("select_item") then
end
end
active_item_selection[playername] = nil
end
end)
end
@ -1001,7 +1003,7 @@ easyvend.on_receive_fields = function(pos, formname, fields, sender)
if minetest.get_modpath("select_item") then
if sendername == owner then
active_item_selection[sendername] = pos
select_item.show_dialog(sendername, select_item.filters.creative)
select_item.show_dialog(sendername, "easyvend:trade_item", select_item.filters.creative)
else
meta:set_string("message", "Only the owner may change the configuration.")
easyvend.sound_error(sendername)