From 0a70d8edefc23c2b692926982620ef8d827ab610 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 28 Jun 2015 03:47:03 -0400 Subject: 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) --- callbacks.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'callbacks.lua') diff --git a/callbacks.lua b/callbacks.lua index 605d8e5..3a41c32 100644 --- a/callbacks.lua +++ b/callbacks.lua @@ -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 -- cgit v1.2.3