From 4d3b219e7d33fc6fda2d1981d0973b6d4b5dafa4 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sun, 12 Feb 2017 23:30:28 +0100 Subject: [PATCH] add smart_inventory support --- 3d_armor/armor.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/3d_armor/armor.lua b/3d_armor/armor.lua index 5d620d9..ea35cbd 100644 --- a/3d_armor/armor.lua +++ b/3d_armor/armor.lua @@ -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")