Update select_item handling
This commit is contained in:
parent
fa14d27191
commit
9aca0379b7
@ -24,7 +24,8 @@ end
|
|||||||
if minetest.get_modpath("select_item") then
|
if minetest.get_modpath("select_item") then
|
||||||
-- When player selects item via "select item" dialog, switch the
|
-- When player selects item via "select item" dialog, switch the
|
||||||
-- machine's selected item and update the formspec.
|
-- 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)
|
local player = minetest.get_player_by_name(playername)
|
||||||
if not player then
|
if not player then
|
||||||
return
|
return
|
||||||
@ -50,6 +51,7 @@ if minetest.get_modpath("select_item") then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
active_item_selection[playername] = nil
|
active_item_selection[playername] = nil
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1001,7 +1003,7 @@ easyvend.on_receive_fields = function(pos, formname, fields, sender)
|
|||||||
if minetest.get_modpath("select_item") then
|
if minetest.get_modpath("select_item") then
|
||||||
if sendername == owner then
|
if sendername == owner then
|
||||||
active_item_selection[sendername] = pos
|
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
|
else
|
||||||
meta:set_string("message", "Only the owner may change the configuration.")
|
meta:set_string("message", "Only the owner may change the configuration.")
|
||||||
easyvend.sound_error(sendername)
|
easyvend.sound_error(sendername)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user