forked from MineClone5/MineClone5
Craftguide: Squeeze shapeless recipes in 2×2 grid
This commit is contained in:
parent
c054915521
commit
6caf054dc8
|
@ -108,7 +108,13 @@ function craftguide:get_recipe(iY, xoffset, tooltip, item, recipe_num, recipes)
|
||||||
|
|
||||||
local items = recipes[recipe_num].items
|
local items = recipes[recipe_num].items
|
||||||
local width = recipes[recipe_num].width
|
local width = recipes[recipe_num].width
|
||||||
if width == 0 then width = min(3, #items) end
|
if width == 0 then
|
||||||
|
if #items <= 4 then
|
||||||
|
width = 2
|
||||||
|
else
|
||||||
|
width = min(3, #items)
|
||||||
|
end
|
||||||
|
end
|
||||||
local rows = ceil(maxn(items) / width)
|
local rows = ceil(maxn(items) / width)
|
||||||
local btn_size, craftgrid_limit = 1, 5
|
local btn_size, craftgrid_limit = 1, 5
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue