add smart_inventory support

This commit is contained in:
Alexander Weber 2017-02-12 23:30:28 +01:00 committed by stujones11
parent 81ffdaa6a7
commit 4d3b219e7d

@ -105,6 +105,8 @@ elseif minetest.get_modpath("unified_inventory") then
})
elseif minetest.get_modpath("inventory_enhanced") then
inv_mod = "inventory_enhanced"
elseif minetest.get_modpath("smart_inventory") then
inv_mod = "smart_inventory"
end
if minetest.get_modpath("skins") then
@ -277,6 +279,16 @@ armor.update_inventory = function(self, player)
if not name or inv_mod == "inventory_enhanced" then
return
end
if inv_mod == "smart_inventory" then
local state = smart_inventory.smartfs.inv[name]
if state then
local button = state:get("player_button")
if button then
button:submit()
end
end
return
end
if inv_mod == "unified_inventory" then
if unified_inventory.current_page[name] == "armor" then
unified_inventory.set_inventory_formspec(player, "armor")