From 7a4eeaff13b06c93ef671b7a455c7f9e79800700 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Feb 2017 04:45:25 +0100 Subject: Add icon for shapeless recipes --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 548c460..5643741 100644 --- a/init.lua +++ b/init.lua @@ -92,14 +92,20 @@ function craftguide:get_recipe(iY, xoffset, tooltip, item, recipe_num, recipes) recipe_num.." of "..recipes_total.."]" end local recipe_type = recipes[recipe_num].type + local items = recipes[recipe_num].items + local width = recipes[recipe_num].width + if recipe_type == "cooking" then formspec = formspec.. "image["..(xoffset-0.8)..","..(iY+1).. ".5;0.5,0.5;craftguide_furnace.png]" + -- Shapeless recipe + elseif recipe_type == "normal" and width == 0 then + formspec = formspec.. + "image["..(xoffset-0.8)..","..(iY+1).. + ".5;0.5,0.5;craftguide_shapeless.png]" end - local items = recipes[recipe_num].items - local width = recipes[recipe_num].width if width == 0 then width = min(3, #items) end local rows = ceil(maxn(items) / width) local btn_size, craftgrid_limit = 1, 5 -- cgit v1.2.3