Fix tooltip

This commit is contained in:
Jean-Patrick Guerrero 2019-10-15 15:30:52 +02:00
parent b12502a7da
commit 77dbe040b8
1 changed files with 5 additions and 7 deletions

View File

@ -637,12 +637,10 @@ local function get_tooltip(name, info)
groupstr = concat(groupstr, ", ")
tooltip = S("Any item belonging to the group(s): @1", groupstr)
return fmt("tooltip[%s;%s]", name, ESC(tooltip))
else
tooltip = get_desc(name)
end
tooltip = get_desc(name)
local function add(str)
return fmt("%s\n%s", tooltip, str)
end
@ -825,7 +823,7 @@ local function get_grid_fs(fs, rcp, spacing)
for j = 1, #replacements do
local replacement = replacements[j]
if replacement[1] == name then
label = "\nR"
label = (label ~= "" and "\n" or "") .. label .. "\nR"
replace = replacement[2]
end
end
@ -833,7 +831,7 @@ local function get_grid_fs(fs, rcp, spacing)
fs[#fs + 1] = fmt(FMT.item_image_button,
X, Y + (sfinv_only and 0.7 or 0),
btn_size, btn_size, item, name, ESC(label))
btn_size, btn_size, item, item, ESC(label))
local infos = {
unknown = not reg_items[name] or nil,
@ -844,7 +842,7 @@ local function get_grid_fs(fs, rcp, spacing)
}
if next(infos) then
fs[#fs + 1] = get_tooltip(name, infos)
fs[#fs + 1] = get_tooltip(item, infos)
end
if CORE_VERSION >= 510 and not large_recipe then