Craft guide : adjust yield and group labels positions
This commit is contained in:
parent
468a0068d5
commit
1984e28b02
@ -109,7 +109,7 @@ function worktable:craftguide_formspec(meta, pagenum, item, recipe_num, filter)
|
|||||||
local rows = math.ceil(table.maxn(items) / width) -- Lua 5.3 removed `table.maxn`, use `xdecor.maxn` in case of failure.
|
local rows = math.ceil(table.maxn(items) / width) -- Lua 5.3 removed `table.maxn`, use `xdecor.maxn` in case of failure.
|
||||||
|
|
||||||
local function is_group(item)
|
local function is_group(item)
|
||||||
if item:find("^group:") then return "G" end
|
if item:find("^group:") then return "\nG" end
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ function worktable:craftguide_formspec(meta, pagenum, item, recipe_num, filter)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local yield = minetest.get_all_craft_recipes(item)[recipe_num].output:match("%s(%d+)") or ""
|
local yield = minetest.get_all_craft_recipes(item)[recipe_num].output:match("%s(%d+)") or ""
|
||||||
formspec = formspec.."item_image_button[2.5,5;1,1;"..item..";"..item..";"..yield.."]"..
|
formspec = formspec.."item_image_button[2.5,5;1,1;"..item..";"..item..";\n\n\t\t\t\t"..yield.."]"..
|
||||||
"image[3.5,5;1,1;gui_furnace_arrow_bg.png^[transformR90]"
|
"image[3.5,5;1,1;gui_furnace_arrow_bg.png^[transformR90]"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ function worktable.fields(pos, _, fields)
|
|||||||
worktable:craftguide_items(meta, nil)
|
worktable:craftguide_items(meta, nil)
|
||||||
worktable:craftguide_formspec(meta, 1, nil, 1, "")
|
worktable:craftguide_formspec(meta, 1, nil, 1, "")
|
||||||
elseif fields.alternate then
|
elseif fields.alternate then
|
||||||
local item = formspec:match("item_image_button%[.*;([%w_:]+);.*%]") or ""
|
local item = formspec:match("image_button%[.*;([%w_:]+);.*%]") or ""
|
||||||
local recipe_num = tonumber(formspec:match("Recipe%s(%d+)")) or 1
|
local recipe_num = tonumber(formspec:match("Recipe%s(%d+)")) or 1
|
||||||
recipe_num = recipe_num + 1
|
recipe_num = recipe_num + 1
|
||||||
worktable:craftguide_formspec(meta, pagenum, item, recipe_num, filter)
|
worktable:craftguide_formspec(meta, pagenum, item, recipe_num, filter)
|
||||||
|
Loading…
Reference in New Issue
Block a user