Fix tooltip for replacements

This commit is contained in:
Jean-Patrick Guerrero
2019-09-10 12:37:39 +02:00
parent fc3f1fece2
commit 84795a6523
3 changed files with 13 additions and 2 deletions

View File

@ -466,8 +466,15 @@ local function get_tooltip(item, info)
if info.replace then
local def = reg_items[info.replace]
tooltip = add(S("Replaced by @1 on crafting",
clrz("yellow", get_desc(def, info.replace))))
local desc = clrz("yellow", get_desc(def, info.replace))
if info.cooktime then
tooltip = add(S("Replaced by @1 on smelting", desc))
elseif info.burntime then
tooltip = add(S("Replaced by @1 on burning", desc))
else
tooltip = add(S("Replaced by @1 on crafting", desc))
end
end
return fmt("tooltip[%s;%s]", item, ESC(tooltip))