Skip to content

Commit

Permalink
Autocrafting: Hide menu after dropping an item
Browse files Browse the repository at this point in the history
  • Loading branch information
random-geek committed Mar 22, 2019
1 parent 5396c45 commit a4febd7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions autocrafting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,15 @@ cg.auto_craft = function(player, craft, num)
end
end
end

minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info)
-- Hide the autocrafting menu when the player drops an item.
if cg.autocrafting and inventory_info.listname == "main" then
local context = sfinv.get_or_create_context(player)

if context.cg_auto_menu then
context.cg_auto_menu = false
sfinv.set_player_inventory_formspec(player)
end
end
end)

0 comments on commit a4febd7

Please sign in to comment.