2017-02-05 13:51:48 +01:00
|
|
|
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
|
|
|
|
|
|
|
smart_inventory = {}
|
2017-02-13 12:17:00 +01:00
|
|
|
smart_inventory.skins_mod = minetest.get_modpath("skins")
|
|
|
|
smart_inventory.armor_mod = minetest.get_modpath("3d_armor")
|
2017-02-16 23:23:45 +01:00
|
|
|
smart_inventory.doc_items_mod = minetest.get_modpath("doc_items")
|
2017-02-05 13:51:48 +01:00
|
|
|
smart_inventory.registered_pages = {}
|
2017-04-09 18:25:10 +02:00
|
|
|
smart_inventory.smartfs = dofile(modpath.."/libs/smartfs.lua")
|
|
|
|
smart_inventory.smartfs_elements = dofile(modpath.."/libs/smartfs-elements.lua")
|
2017-04-09 18:16:23 +02:00
|
|
|
|
2017-02-08 21:55:29 +01:00
|
|
|
|
2017-04-09 18:29:52 +02:00
|
|
|
dofile(modpath.."/inventory_framework.lua")
|
2017-02-20 17:04:06 +01:00
|
|
|
|
2017-03-15 22:40:22 +01:00
|
|
|
-- get language for texts
|
|
|
|
local LANG = minetest.setting_get("language")
|
|
|
|
if not (LANG and (LANG ~= "")) then LANG = os.getenv("LANG") end
|
|
|
|
if not (LANG and (LANG ~= "")) then LANG = "en" end
|
|
|
|
local txtfile = modpath.."/classify_description_"..LANG:sub(1,2)..".lua"
|
2017-02-08 21:55:29 +01:00
|
|
|
-- build up caches
|
2017-03-15 22:40:22 +01:00
|
|
|
local f=io.open(txtfile,"r")
|
|
|
|
if f~=nil then
|
|
|
|
io.close(f)
|
|
|
|
smart_inventory.txt = dofile(txtfile)
|
|
|
|
else
|
|
|
|
smart_inventory.txt = dofile(modpath.."/classify_description_en.lua")
|
|
|
|
end
|
|
|
|
|
2017-04-09 18:25:10 +02:00
|
|
|
smart_inventory.filter = dofile(modpath.."/libs/filter.lua")
|
2017-02-28 16:07:47 +01:00
|
|
|
smart_inventory.doc_addon = dofile(modpath.."/doc_addon.lua")
|
2017-04-09 18:25:10 +02:00
|
|
|
smart_inventory.cache = dofile(modpath.."/libs/cache.lua")
|
2017-02-21 23:17:53 +01:00
|
|
|
smart_inventory.ui_tools = dofile(modpath.."/ui_tools.lua")
|
2017-02-11 23:30:24 +01:00
|
|
|
|
2017-02-08 21:55:29 +01:00
|
|
|
-- register pages
|
2017-04-09 18:09:17 +02:00
|
|
|
dofile(modpath.."/pages/crafting.lua")
|
2017-04-09 18:16:23 +02:00
|
|
|
dofile(modpath.."/pages/creative.lua")
|
|
|
|
dofile(modpath.."/pages/player.lua")
|