mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 12:33:43 +01:00
Polish displaying of big recipes
This commit is contained in:
parent
1884c92775
commit
ee4cfc119a
9
init.lua
9
init.lua
@ -103,14 +103,9 @@ function craftguide:get_recipe(player_name, tooltip_l, item, recipe_num, recipes
|
|||||||
local Y = ceil(i / width + ((iY + 2) - min(2, rows)))
|
local Y = ceil(i / width + ((iY + 2) - min(2, rows)))
|
||||||
|
|
||||||
if recipe_type == "normal" and width > 3 or rows > 3 then
|
if recipe_type == "normal" and width > 3 or rows > 3 then
|
||||||
btn_size = 3 / width
|
btn_size = width > 3 and 3 / width or 3 / rows
|
||||||
if width > 3 then
|
|
||||||
X = (btn_size * (i % width)) + offset_X
|
X = (btn_size * (i % width)) + offset_X
|
||||||
end
|
Y = (btn_size * floor((i-1) / width)) + (iY + 3) - min(2, rows)
|
||||||
if rows > 3 then
|
|
||||||
Y = (btn_size * floor((i-1) / rows)) + (iY + 3) -
|
|
||||||
min(2, rows)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local groups = extract_groups(v)
|
local groups = extract_groups(v)
|
||||||
|
Loading…
Reference in New Issue
Block a user