inventory auto detection
parent
a780d10400
commit
bc52d11594
|
@ -23,11 +23,23 @@ xpro.show_inventory_formspec = function(player)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Metodos de acesso pelo inventario
|
-- Metodos de acesso pelo inventario
|
||||||
xpro.var.inv_mode = minetest.settings:get("xpro_inventory") or "sfinv"
|
xpro.var.inv_mode = minetest.settings:get("xpro_inventory")
|
||||||
|
|
||||||
|
-- Tenta identificar mod
|
||||||
|
if xpro.var.inv_mode == nil then
|
||||||
|
if minetest.get_modpath("unified_inventory") then
|
||||||
|
xpro.var.inv_mode = "unified_inventory"
|
||||||
|
|
||||||
|
-- Se não indetificar nada, usa sfinv por padrão
|
||||||
|
else
|
||||||
|
xpro.var.inv_mode = "sfinv"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if xpro.var.inv_mode == "unified_inventory" then
|
if xpro.var.inv_mode == "unified_inventory" then
|
||||||
dofile(modpath.."/unified_inventory.lua")
|
dofile(modpath.."/unified_inventory.lua")
|
||||||
else
|
|
||||||
xpro.var.inv_mode = "sfinv"
|
elseif xpro.var.inv_mode == "sfinv" then
|
||||||
dofile(modpath.."/sfinv.lua")
|
dofile(modpath.."/sfinv.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,3 +54,5 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue