mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-23 03:13:44 +01:00
Fix crash in sfinv mode
This commit is contained in:
parent
d87c64618c
commit
aa9f7d6da3
11
init.lua
11
init.lua
@ -752,9 +752,11 @@ local function get_output_fs(data, fs, L)
|
|||||||
1.1, 1.1, PNG.selected)
|
1.1, 1.1, PNG.selected)
|
||||||
end
|
end
|
||||||
|
|
||||||
fs[#fs + 1] = fmt("item_image_button[%f,%f;%f,%f;%s;_%s;%s]",
|
local _name = sfinv_only and name or fmt("_%s", name)
|
||||||
|
|
||||||
|
fs[#fs + 1] = fmt("item_image_button[%f,%f;%f,%f;%s;%s;%s]",
|
||||||
output_X, YOFFSET + (sfinv_only and 0.7 or 0) + L.spacing,
|
output_X, YOFFSET + (sfinv_only and 0.7 or 0) + L.spacing,
|
||||||
1.1, 1.1, item, name, "")
|
1.1, 1.1, item, _name, "")
|
||||||
|
|
||||||
local infos = {
|
local infos = {
|
||||||
unknown = not reg_items[name] or nil,
|
unknown = not reg_items[name] or nil,
|
||||||
@ -764,7 +766,7 @@ local function get_output_fs(data, fs, L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if next(infos) then
|
if next(infos) then
|
||||||
fs[#fs + 1] = get_tooltip(fmt("_%s", name), infos)
|
fs[#fs + 1] = get_tooltip(_name, infos)
|
||||||
end
|
end
|
||||||
|
|
||||||
if infos.burntime then
|
if infos.burntime then
|
||||||
@ -946,7 +948,7 @@ local function get_panels(data, fs)
|
|||||||
xu = max(-0.3, -((#xu - 3) * 0.05))
|
xu = max(-0.3, -((#xu - 3) * 0.05))
|
||||||
xr = max(-0.3, -((#xr - 3) * 0.05))
|
xr = max(-0.3, -((#xr - 3) * 0.05))
|
||||||
|
|
||||||
local is_recipe = k == 2
|
local is_recipe = sfinv_only and not data.show_usages or k == 2
|
||||||
local lbl
|
local lbl
|
||||||
|
|
||||||
if not sfinv_only and rn == 0 then
|
if not sfinv_only and rn == 0 then
|
||||||
@ -1544,6 +1546,7 @@ end)
|
|||||||
local function fields(player, _f)
|
local function fields(player, _f)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local data = pdata[name]
|
local data = pdata[name]
|
||||||
|
--print(dump(_f))
|
||||||
|
|
||||||
if _f.clear then
|
if _f.clear then
|
||||||
reset_data(data)
|
reset_data(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user