mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 20:43:42 +01:00
Merge pull request #15 from Wuzzy2/shapeless
Add icon for shapeless recipes
This commit is contained in:
commit
452b05d450
10
init.lua
10
init.lua
@ -92,14 +92,20 @@ function craftguide:get_recipe(iY, xoffset, tooltip, item, recipe_num, recipes)
|
|||||||
recipe_num.." of "..recipes_total.."]"
|
recipe_num.." of "..recipes_total.."]"
|
||||||
end
|
end
|
||||||
local recipe_type = recipes[recipe_num].type
|
local recipe_type = recipes[recipe_num].type
|
||||||
|
local items = recipes[recipe_num].items
|
||||||
|
local width = recipes[recipe_num].width
|
||||||
|
|
||||||
if recipe_type == "cooking" then
|
if recipe_type == "cooking" then
|
||||||
formspec = formspec..
|
formspec = formspec..
|
||||||
"image["..(xoffset-0.8)..","..(iY+1)..
|
"image["..(xoffset-0.8)..","..(iY+1)..
|
||||||
".5;0.5,0.5;craftguide_furnace.png]"
|
".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
|
end
|
||||||
|
|
||||||
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 width = min(3, #items) end
|
||||||
local rows = ceil(maxn(items) / width)
|
local rows = ceil(maxn(items) / width)
|
||||||
local btn_size, craftgrid_limit = 1, 5
|
local btn_size, craftgrid_limit = 1, 5
|
||||||
|
BIN
textures/craftguide_shapeless.png
Normal file
BIN
textures/craftguide_shapeless.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 227 B |
Loading…
Reference in New Issue
Block a user