mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-23 03:13:44 +01:00
Fix alternate button not shown for too large recipes
This commit is contained in:
parent
5e4a362a15
commit
7f44517701
24
init.lua
24
init.lua
@ -392,6 +392,17 @@ local function get_recipe_fs(data, iY)
|
|||||||
local rows = ceil(maxn(recipe.items) / width)
|
local rows = ceil(maxn(recipe.items) / width)
|
||||||
local rightest, btn_size, s_btn_size = 0, 1.1
|
local rightest, btn_size, s_btn_size = 0, 1.1
|
||||||
|
|
||||||
|
fs[#fs + 1] = fmt("button[%f,%f;%f,%f;%s;%s %u %s %u]",
|
||||||
|
data.iX - (sfinv_only and 2.2 or 2.6),
|
||||||
|
iY + (sfinv_only and 3.9 or 3.3),
|
||||||
|
2.2,
|
||||||
|
1,
|
||||||
|
"alternate",
|
||||||
|
data.show_usages and ESC(S("Usage")) or ESC(S("Recipe")),
|
||||||
|
data.rnum,
|
||||||
|
ESC(S("of")),
|
||||||
|
#data.recipes)
|
||||||
|
|
||||||
if width > GRID_LIMIT or rows > GRID_LIMIT then
|
if width > GRID_LIMIT or rows > GRID_LIMIT then
|
||||||
fs[#fs + 1] = fmt(FMT.label,
|
fs[#fs + 1] = fmt(FMT.label,
|
||||||
(data.iX / 2) - 2,
|
(data.iX / 2) - 2,
|
||||||
@ -518,17 +529,6 @@ local function get_recipe_fs(data, iY)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
fs[#fs + 1] = fmt("button[%f,%f;%f,%f;%s;%s %u %s %u]",
|
|
||||||
data.iX - (sfinv_only and 2.2 or 2.6),
|
|
||||||
iY + (sfinv_only and 3.9 or 3.3),
|
|
||||||
2.2,
|
|
||||||
1,
|
|
||||||
"alternate",
|
|
||||||
data.show_usages and ESC(S("Usage")) or ESC(S("Recipe")),
|
|
||||||
data.rnum,
|
|
||||||
ESC(S("of")),
|
|
||||||
#data.recipes)
|
|
||||||
|
|
||||||
return concat(fs)
|
return concat(fs)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1140,7 +1140,7 @@ for x = 1, 6 do
|
|||||||
for i = 1, 10 - x do
|
for i = 1, 10 - x do
|
||||||
cr[x][i] = {}
|
cr[x][i] = {}
|
||||||
for j = 1, 10 - x do
|
for j = 1, 10 - x do
|
||||||
cr[x][i][j] = "group:sand"
|
cr[x][i][j] = "group:wood"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user