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:
Vanessa Ezekowitz
2015-06-28 03:47:03 -04:00
parent 20eba2bf9b
commit 0a70d8edef
4 changed files with 231 additions and 151 deletions

View File

@ -68,11 +68,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- Inventory page controls
local start = math.floor(
unified_inventory.current_index[player_name] / 80 + 1)
unified_inventory.current_index[player_name] / unified_inventory.items_per_page + 1)
local start_i = start
local pagemax = math.floor(
(#unified_inventory.filtered_items_list[player_name] - 1)
/ (80) + 1)
/ (unified_inventory.items_per_page) + 1)
if fields.start_list then
start_i = 1
@ -101,7 +101,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if not (start_i == start) then
minetest.sound_play("paperflip1",
{to_player=player_name, gain = 1.0})
unified_inventory.current_index[player_name] = (start_i - 1) * 80 + 1
unified_inventory.current_index[player_name] = (start_i - 1) * unified_inventory.items_per_page + 1
unified_inventory.set_inventory_formspec(player,
unified_inventory.current_page[player_name])
end