From 6caf054dc81b0e70f73361f3adc4eb86d70fd316 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 5 Feb 2017 23:14:28 +0100 Subject: [PATCH] =?UTF-8?q?Craftguide:=20Squeeze=20shapeless=20recipes=20i?= =?UTF-8?q?n=202=C3=972=20grid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/craftguide/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/craftguide/init.lua b/mods/craftguide/init.lua index 769f1c95..db7b436e 100644 --- a/mods/craftguide/init.lua +++ b/mods/craftguide/init.lua @@ -108,7 +108,13 @@ function craftguide:get_recipe(iY, xoffset, tooltip, item, recipe_num, recipes) local items = recipes[recipe_num].items 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 btn_size, craftgrid_limit = 1, 5