mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2025-06-28 22:46:10 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
4bf5f22696 | |||
4f666f93d0 | |||
264833ed41 |
2
init.lua
2
init.lua
@ -82,3 +82,5 @@ dofile(modpath.."/item_names.lua")
|
||||
if minetest.get_modpath("datastorage") then
|
||||
dofile(modpath.."/waypoints.lua")
|
||||
end
|
||||
|
||||
minetest.log("action", "[unified_inventory] loaded.")
|
||||
|
@ -99,17 +99,21 @@ function unified_inventory.get_formspec(player, page)
|
||||
end
|
||||
end
|
||||
|
||||
local j = 1 --Modif NALC (sys4 20/11/2018) 12 buttons max by row
|
||||
for i, def in pairs(filtered_inv_buttons) do
|
||||
|
||||
if draw_lite_mode and i > 4 then
|
||||
button_row = 1
|
||||
button_col = 1
|
||||
elseif not draw_lite_mode and j > 12 then
|
||||
button_row = 1
|
||||
j = 1
|
||||
end
|
||||
|
||||
if def.type == "image" then
|
||||
if (def.condition == nil or def.condition(player) == true) then
|
||||
formspec[n] = "image_button["
|
||||
formspec[n+1] = ( ui_peruser.main_button_x + 0.65 * (i - 1) - button_col * 0.65 * 4)
|
||||
formspec[n+1] = ( ui_peruser.main_button_x + 0.65 * (j - 1) - button_col * 0.65 * 4) -- Modif NALC
|
||||
formspec[n+2] = ","..(ui_peruser.main_button_y + button_row * 0.7)..";0.8,0.8;"
|
||||
formspec[n+3] = F(def.image)..";"
|
||||
formspec[n+4] = F(def.name)..";]"
|
||||
@ -118,13 +122,14 @@ function unified_inventory.get_formspec(player, page)
|
||||
n = n+7
|
||||
else
|
||||
formspec[n] = "image["
|
||||
formspec[n+1] = ( ui_peruser.main_button_x + 0.65 * (i - 1) - button_col * 0.65 * 4)
|
||||
formspec[n+1] = ( ui_peruser.main_button_x + 0.65 * (j - 1) - button_col * 0.65 * 4) -- Modif NALC
|
||||
formspec[n+2] = ","..(ui_peruser.main_button_y + button_row * 0.7)..";0.8,0.8;"
|
||||
formspec[n+3] = F(def.image).."^[colorize:#808080:alpha]"
|
||||
n = n+4
|
||||
|
||||
end
|
||||
end
|
||||
j = j + 1 -- Modif NALC
|
||||
end
|
||||
|
||||
if fsdata.draw_inventory ~= false then
|
||||
|
Reference in New Issue
Block a user