Fix alternate button not shown for too large recipes

This commit is contained in:
Jean-Patrick Guerrero 2019-02-21 01:54:15 +01:00
parent 5e4a362a15
commit 7f44517701

@ -392,6 +392,17 @@ local function get_recipe_fs(data, iY)
local rows = ceil(maxn(recipe.items) / width)
local rightest, btn_size, s_btn_size = 0, 1.1
fs[#fs + 1] = fmt("button[%f,%f;%f,%f;%s;%s %u %s %u]",
data.iX - (sfinv_only and 2.2 or 2.6),
iY + (sfinv_only and 3.9 or 3.3),
2.2,
1,
"alternate",
data.show_usages and ESC(S("Usage")) or ESC(S("Recipe")),
data.rnum,
ESC(S("of")),
#data.recipes)
if width > GRID_LIMIT or rows > GRID_LIMIT then
fs[#fs + 1] = fmt(FMT.label,
(data.iX / 2) - 2,
@ -518,17 +529,6 @@ local function get_recipe_fs(data, iY)
end
end
fs[#fs + 1] = fmt("button[%f,%f;%f,%f;%s;%s %u %s %u]",
data.iX - (sfinv_only and 2.2 or 2.6),
iY + (sfinv_only and 3.9 or 3.3),
2.2,
1,
"alternate",
data.show_usages and ESC(S("Usage")) or ESC(S("Recipe")),
data.rnum,
ESC(S("of")),
#data.recipes)
return concat(fs)
end
@ -1140,7 +1140,7 @@ for x = 1, 6 do
for i = 1, 10 - x do
cr[x][i] = {}
for j = 1, 10 - x do
cr[x][i][j] = "group:sand"
cr[x][i][j] = "group:wood"
end
end