mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-29 20:20:23 +01:00
use string.format() to create the standard_inv variables
do it just once, after the lite mode settings are applied (if applicable)
This commit is contained in:
parent
603b5d1d4e
commit
82bc2d3f95
4
init.lua
4
init.lua
@ -61,10 +61,6 @@ unified_inventory = {
|
||||
standard_background = "background9[0,0;1,1;ui_formbg_9_sliced.png;true;16]",
|
||||
}
|
||||
|
||||
unified_inventory.standard_inv = "list[current_player;main;"..(unified_inventory.std_inv_x+0.15)..","..(unified_inventory.std_inv_y+0.15)..";8,4;]"
|
||||
unified_inventory.standard_inv_bg = "image["..unified_inventory.std_inv_x..","..unified_inventory.std_inv_y..";"..(unified_inventory.imgscale*8)..
|
||||
","..(unified_inventory.imgscale*4)..";ui_main_inventory.png]"
|
||||
|
||||
-- Disable default creative inventory
|
||||
local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory")
|
||||
if creative then
|
||||
|
10
internal.lua
10
internal.lua
@ -69,12 +69,16 @@ function unified_inventory.get_per_player_formspec(player_name)
|
||||
ui.btn_size = 0.7
|
||||
ui.std_inv_x = 0.1
|
||||
ui.std_inv_y = 4.6
|
||||
ui.standard_inv = "list[current_player;main;"..(ui.std_inv_x+0.15)..","..(ui.std_inv_y+0.15)..";8,4;]"
|
||||
ui.standard_inv_bg = "image["..ui.std_inv_x..","..ui.std_inv_y..";"..(unified_inventory.imgscale*8)..
|
||||
","..(unified_inventory.imgscale*4)..";ui_main_inventory.png]"
|
||||
|
||||
end
|
||||
|
||||
ui.items_per_page = ui.pagecols * ui.pagerows
|
||||
ui.standard_inv = string.format("list[current_player;main;%f,%f;8,4;]",
|
||||
ui.std_inv_x+0.15, ui.std_inv_y+0.15)
|
||||
|
||||
ui.standard_inv_bg = string.format("image[%f,%f;%f,%f;ui_main_inventory.png]",
|
||||
ui.std_inv_x, ui.std_inv_y,
|
||||
unified_inventory.imgscale*8, unified_inventory.imgscale*4)
|
||||
return ui, lite
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user