mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2025-06-29 23:10:45 +02:00
Version MFF.
This commit is contained in:
74
init.lua
Normal file → Executable file
74
init.lua
Normal file → Executable file
@ -2,38 +2,58 @@
|
||||
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local worldpath = minetest.get_worldpath()
|
||||
local mygettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
|
||||
|
||||
-- Data tables definitions
|
||||
unified_inventory = {}
|
||||
unified_inventory.activefilter = {}
|
||||
unified_inventory.active_search_direction = {}
|
||||
unified_inventory.alternate = {}
|
||||
unified_inventory.current_page = {}
|
||||
unified_inventory.current_searchbox = {}
|
||||
unified_inventory.current_index = {}
|
||||
unified_inventory.current_item = {}
|
||||
unified_inventory.current_craft_direction = {}
|
||||
unified_inventory.registered_craft_types = {}
|
||||
unified_inventory.crafts_for = { usage = {}, recipe = {} }
|
||||
unified_inventory.players = {}
|
||||
unified_inventory.items_list_size = 0
|
||||
unified_inventory.items_list = {}
|
||||
unified_inventory.filtered_items_list_size = {}
|
||||
unified_inventory.filtered_items_list = {}
|
||||
unified_inventory.pages = {}
|
||||
unified_inventory.buttons = {}
|
||||
unified_inventory = {
|
||||
activefilter = {},
|
||||
active_search_direction = {},
|
||||
alternate = {},
|
||||
current_page = {},
|
||||
current_searchbox = {},
|
||||
current_index = {},
|
||||
current_item = {},
|
||||
current_craft_direction = {},
|
||||
registered_craft_types = {},
|
||||
crafts_for = {usage = {}, recipe = {} },
|
||||
players = {},
|
||||
items_list_size = 0,
|
||||
items_list = {},
|
||||
filtered_items_list_size = {},
|
||||
filtered_items_list = {},
|
||||
pages = {},
|
||||
buttons = {},
|
||||
hidden_guide = {}, --MFF crabman(29/11/2015) hide guide, textfield bug
|
||||
|
||||
-- Homepos stuff
|
||||
unified_inventory.home_pos = {}
|
||||
unified_inventory.home_filename =
|
||||
worldpath.."/unified_inventory_home.home"
|
||||
-- Homepos stuff
|
||||
home_pos = {},
|
||||
home_filename = worldpath.."/unified_inventory_home.home",
|
||||
|
||||
-- Default inventory page
|
||||
unified_inventory.default = "craft"
|
||||
-- Default inventory page
|
||||
default = "craft",
|
||||
|
||||
-- intllib
|
||||
gettext = mygettext,
|
||||
fgettext = function(s) return minetest.formspec_escape(mygettext(s)) end,
|
||||
|
||||
-- "Lite" mode
|
||||
lite_mode = minetest.setting_getbool("unified_inventory_lite"),
|
||||
|
||||
pagecols = 8,
|
||||
pagerows = 10,
|
||||
page_y = 0,
|
||||
formspec_y = 1,
|
||||
main_button_x = 0,
|
||||
main_button_y = 9,
|
||||
craft_result_x = 0.3,
|
||||
craft_result_y = 0.5,
|
||||
form_header_y = 0
|
||||
}
|
||||
|
||||
-- Disable default creative inventory
|
||||
if creative_inventory then
|
||||
function creative_inventory.set_creative_formspec(player, start_i, pagenum)
|
||||
local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory")
|
||||
if creative then
|
||||
function creative.set_creative_formspec(player, start_i, pagenum)
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -44,7 +64,9 @@ dofile(modpath.."/internal.lua")
|
||||
dofile(modpath.."/callbacks.lua")
|
||||
dofile(modpath.."/register.lua")
|
||||
dofile(modpath.."/bags.lua")
|
||||
|
||||
dofile(modpath.."/item_names.lua")
|
||||
|
||||
if minetest.get_modpath("datastorage") then
|
||||
dofile(modpath.."/waypoints.lua")
|
||||
end
|
||||
|
Reference in New Issue
Block a user