From 41a9b2fecec483a86e947ee6ec6858d2667040e8 Mon Sep 17 00:00:00 2001 From: BrunoMine Date: Thu, 21 Feb 2019 23:15:30 -0300 Subject: [PATCH] Add auto inventory detect --- inventory.lua | 4 ++-- settingtypes.txt | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/inventory.lua b/inventory.lua index 873dba8..632399f 100644 --- a/inventory.lua +++ b/inventory.lua @@ -23,10 +23,10 @@ xpro.show_inventory_formspec = function(player) end -- Metodos de acesso pelo inventario -xpro.var.inv_mode = minetest.settings:get("xpro_inventory") +xpro.var.inv_mode = minetest.settings:get("xpro_inventory") or "auto" -- Tenta identificar mod -if xpro.var.inv_mode == nil then +if xpro.var.inv_mode == "auto" then if minetest.get_modpath("unified_inventory") then xpro.var.inv_mode = "unified_inventory" diff --git a/settingtypes.txt b/settingtypes.txt index 87da5c9..aba7bec 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -7,9 +7,13 @@ # # Diponiveis|Available: # +# * auto +# - Tenta identificar automaticamente +# - Try to auto-identify +# # * sfinv # - Depends: sfinv # # * unified_inventory # - Depends: unified_inventory -xpro_inventory (Inventario | Inventory) enum sfinv sfinv,unified_inventory +xpro_inventory (Inventario | Inventory) enum auto auto,sfinv,unified_inventory