From 7f44517701677af9dbaa33726e393b743f913db0 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Thu, 21 Feb 2019 01:54:15 +0100 Subject: [PATCH] Fix alternate button not shown for too large recipes --- init.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 2d97acd..9fb770d 100644 --- a/init.lua +++ b/init.lua @@ -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