From 0228f77cb29973c595b33470d6dba927cca21c04 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 19 Sep 2017 18:42:06 +0200 Subject: [PATCH] Show v6 icon for unique red sand recipe --- mods/HELP/mcl_craftguide/init.lua | 32 +++++++++++++++++- .../textures/mcl_craftguide_v6.png | Bin 0 -> 167 bytes 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 mods/HELP/mcl_craftguide/textures/mcl_craftguide_v6.png diff --git a/mods/HELP/mcl_craftguide/init.lua b/mods/HELP/mcl_craftguide/init.lua index fecd7f657..18667ff34 100644 --- a/mods/HELP/mcl_craftguide/init.lua +++ b/mods/HELP/mcl_craftguide/init.lua @@ -191,6 +191,7 @@ function craftguide:get_recipe(iY, xoffset, tooltip_raw, item, recipe_num, recip local items = recipes[recipe_num].items local width = recipes[recipe_num].width + local output = recipes[recipe_num].output local cooking_time = 10 local is_shapeless = false if recipe_type == "normal" and width == 0 then @@ -202,18 +203,48 @@ function craftguide:get_recipe(iY, xoffset, tooltip_raw, item, recipe_num, recip end end + --[[ Recipe type symbols ]] + + -- Cooking (furnace) if recipe_type == "cooking" then cooking_time = width width = 1 formspec = formspec.. "image["..(xoffset-0.8)..","..(iY+1).. ".5;0.5,0.5;default_furnace_front_active.png]" + -- Shapeless recipes (intertwined arrows) elseif is_shapeless then formspec = formspec.. "image["..(xoffset-0.8)..","..(iY+1).. ".5;0.5,0.5;craftguide_shapeless.png]" end + -- Recipe only available in v6 (“v6” icon) + -- TODO/FIXME: This only works for the unique red sand recipe. + -- Remove this when red sand becomes regularily available. + local v6_only_recipe = false + if output == "mcl_core:redsand 8" and + width == 3 and + items[1] == "mcl_core:sand" and + items[2] == "mcl_core:sand" and + items[3] == "mcl_core:sand" and + items[4] == "mcl_core:sand" and + items[5] == "mcl_dye:red" and + items[6] == "mcl_core:sand" and + items[7] == "mcl_core:sand" and + items[8] == "mcl_core:sand" and + items[9] == "mcl_core:sand" then + v6_only_recipe = true + end + + if v6_only_recipe then + formspec = formspec.. + "image["..(xoffset-0.8)..","..(iY+2.75).. + ".5;0.5,0.5;mcl_craftguide_v6.png]" + end + + -- Render slots + local rows = ceil(maxn(items) / width) local btn_size, craftgrid_limit = 1, 5 @@ -257,7 +288,6 @@ function craftguide:get_recipe(iY, xoffset, tooltip_raw, item, recipe_num, recip ";"..item_r..";"..label.."]"..tltip end end - local output = recipes[recipe_num].output local label = "" if recipes[recipe_num]._is_toolrepair then tooltip_raw = tooltip_raw .. "\n" .. core.colorize("#00FF00", string.format("Repaired by %.0f%%", (mcl_core.repair*100))) diff --git a/mods/HELP/mcl_craftguide/textures/mcl_craftguide_v6.png b/mods/HELP/mcl_craftguide/textures/mcl_craftguide_v6.png new file mode 100644 index 0000000000000000000000000000000000000000..50511b9e7defebc5f7b499a71109ea31198ca57c GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaP3?%1DUd;wloB=)|u0T2|DXFNa$l>ejJRpa$ zB*-tA!Qt7BG$6;v)5S5Qg0Z)Iqu>Dp4(6*5er6=F+wk(rDFwT=n6+wtIX=JTwDI2! zn}gX_i?9{jHFC&q@O-1rZaOLPV8i^ZHIsE!uS8}ZWaK&Y^Zwq9ere8meA*L%<}!G? L`njxgN@xNA!Fn|0 literal 0 HcmV?d00001