diff --git a/init.lua b/init.lua index 72fcb39..a19de39 100644 --- a/init.lua +++ b/init.lua @@ -89,6 +89,16 @@ unified_inventory.style_lite = { std_inv_y = 4.6, } +for _, style in ipairs({unified_inventory.style_full, unified_inventory.style_lite}) do + style.items_per_page = style.pagecols * style.pagerows + style.standard_inv = string.format("list[current_player;main;%f,%f;8,4;]", + style.std_inv_x+0.15, style.std_inv_y+0.15) + + style.standard_inv_bg = string.format("image[%f,%f;%f,%f;ui_main_inventory.png]", + style.std_inv_x, style.std_inv_y, + unified_inventory.imgscale*8, unified_inventory.imgscale*4) +end + -- Disable default creative inventory local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory") if creative then diff --git a/internal.lua b/internal.lua index 4338822..f4e09ce 100644 --- a/internal.lua +++ b/internal.lua @@ -22,16 +22,7 @@ end function ui.get_per_player_formspec(player_name) local draw_lite_mode = ui.lite_mode and not minetest.check_player_privs(player_name, {ui_full=true}) - local style = table.copy(draw_lite_mode and ui.style_lite or ui.style_full) - - style.items_per_page = style.pagecols * style.pagerows - style.standard_inv = string.format("list[current_player;main;%f,%f;8,4;]", - style.std_inv_x+0.15, style.std_inv_y+0.15) - - style.standard_inv_bg = string.format("image[%f,%f;%f,%f;ui_main_inventory.png]", - style.std_inv_x, style.std_inv_y, - ui.imgscale*8, ui.imgscale*4) - return style, draw_lite_mode + return table.copy(draw_lite_mode and ui.style_lite or ui.style_full), draw_lite_mode end function ui.get_formspec(player, page)