forked from minetest-mods/unified_inventory
Add "lite" mode
Set unified_inventory_lite = true in minetest.conf to enable. This mode reduces the feature-set of the mod as follows: * no bags * no waypoints, * no home/go-home buttons, * no set-day/-night buttons, * smaller creative/craft guide inventory pages (4x6 instead of 8x10) * fewer paging buttons * smaller search field * move "Result: foo" to below the crafting guide grid. * Move main "tab" buttons to the right, below the search and paging buttons. * Made "tab" buttons able to use to 2 rows if necessary (max 8 buttons)
This commit is contained in:
37
init.lua
37
init.lua
@ -3,7 +3,6 @@
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local worldpath = minetest.get_worldpath()
|
||||
|
||||
|
||||
-- Data tables definitions
|
||||
unified_inventory = {
|
||||
activefilter = {},
|
||||
@ -33,8 +32,35 @@ unified_inventory = {
|
||||
|
||||
-- intllib
|
||||
gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return 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.6,
|
||||
form_header_y = 0
|
||||
}
|
||||
|
||||
if unified_inventory.lite_mode then
|
||||
unified_inventory.pagecols = 4
|
||||
unified_inventory.pagerows = 6
|
||||
unified_inventory.page_y = 0.25
|
||||
unified_inventory.formspec_y = 0.47
|
||||
unified_inventory.main_button_x = 8.2
|
||||
unified_inventory.main_button_y = 6.5
|
||||
unified_inventory.craft_result_x = 2.3
|
||||
unified_inventory.craft_result_y = 3.4
|
||||
unified_inventory.form_header_y = -0.1
|
||||
end
|
||||
|
||||
unified_inventory.items_per_page = unified_inventory.pagecols * unified_inventory.pagerows
|
||||
|
||||
-- Disable default creative inventory
|
||||
if rawget(_G, "creative_inventory") then
|
||||
function creative_inventory.set_creative_formspec(player, start_i, pagenum)
|
||||
@ -47,9 +73,14 @@ dofile(modpath.."/api.lua")
|
||||
dofile(modpath.."/internal.lua")
|
||||
dofile(modpath.."/callbacks.lua")
|
||||
dofile(modpath.."/register.lua")
|
||||
dofile(modpath.."/bags.lua")
|
||||
|
||||
if not unified_inventory.lite_mode then
|
||||
dofile(modpath.."/bags.lua")
|
||||
end
|
||||
|
||||
dofile(modpath.."/item_names.lua")
|
||||
if minetest.get_modpath("datastorage") then
|
||||
|
||||
if minetest.get_modpath("datastorage") and not unified_inventory.lite_mode then
|
||||
dofile(modpath.."/waypoints.lua")
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user