From 4c1caed41b626b32cc9efc446195d472adad57d5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 5 Feb 2017 23:43:15 +0100 Subject: [PATCH] Craftguide: Add icon for shapeless recipes --- mods/craftguide/init.lua | 20 ++++++++++++------ .../textures/craftguide_furnace.png | Bin 3365 -> 0 bytes .../textures/craftguide_shapeless.png | Bin 0 -> 228 bytes 3 files changed, 14 insertions(+), 6 deletions(-) delete mode 100644 mods/craftguide/textures/craftguide_furnace.png create mode 100644 mods/craftguide/textures/craftguide_shapeless.png diff --git a/mods/craftguide/init.lua b/mods/craftguide/init.lua index d1b07c4b1e..4d019e4a03 100644 --- a/mods/craftguide/init.lua +++ b/mods/craftguide/init.lua @@ -100,21 +100,29 @@ function craftguide:get_recipe(iY, xoffset, tooltip, item, recipe_num, recipes) recipe_num.." of "..recipes_total.."]" end local recipe_type = recipes[recipe_num].type - if recipe_type == "cooking" then - formspec = formspec.. - "image["..(xoffset-0.8)..","..(iY+1).. - ".5;0.5,0.5;craftguide_furnace.png]" - end local items = recipes[recipe_num].items local width = recipes[recipe_num].width - if width == 0 then + local is_shapeless = false + if recipe_type == "normal" and width == 0 then + is_shapeless = true if #items <= 4 then width = 2 else width = min(3, #items) end end + + if recipe_type == "cooking" then + formspec = formspec.. + "image["..(xoffset-0.8)..","..(iY+1).. + ".5;0.5,0.5;default_furnace_front_active.png]" + elseif is_shapeless then + formspec = formspec.. + "image["..(xoffset-0.8)..","..(iY+1).. + ".5;0.5,0.5;craftguide_shapeless.png]" + end + local rows = ceil(maxn(items) / width) local btn_size, craftgrid_limit = 1, 5 diff --git a/mods/craftguide/textures/craftguide_furnace.png b/mods/craftguide/textures/craftguide_furnace.png deleted file mode 100644 index 4c12e506cc9d5a9710cce3aa8def69472843ced7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3365 zcmV+=4chXFP)uJ@VVD_U zC<6{NG_fI~0ue<-1QkJoA_k0xBC#Thg@9ne9*`iQ#9$OrQF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!>8Vnp_!%ZFMuQtP7^@2y!`xN^#B0`HsCkZe;`{=05#2Ne8-St3gmbRL1-W_ zlY)pdqqznkfWQX)`1TFV0U2X44WbyV(Hm$$J;abx&me}w0L)T=0Al*|=@Zy5An=6& zqH$6H#C9<7h8S>Six9(%(-1W<0MZK(KrA<|-2`U}eJM6@pv?v<`U<4;rveSw`VOLU vstUtIvpWovPD2tC2prybm;sas0RjvFZ@tbr+q_-f00000NkvXXu0mjf0QXLO diff --git a/mods/craftguide/textures/craftguide_shapeless.png b/mods/craftguide/textures/craftguide_shapeless.png new file mode 100644 index 0000000000000000000000000000000000000000..511652fd0d6c494758ab25d86498f31ca5e8e067 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1#^NA%Cx&(BWL^R}OiAAEE({E- zdXmbbNq%pe!D9B#o>Fdh=kcm}Hkv*(wUN}%F!_&nv#NzbXU`H+n z1&+^atDF9_TemDpnRZ2S@5yT=QWw=3HHEuGIOYc^C`W2;d(morLOn%G+x5PW=#7RO zrF&;EE)07m