Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Strip item count in replacement tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbith committed Jul 12, 2020
1 parent 95e1aea commit e6d1857
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ local function get_tooltip(item, info, lang_code)

if info.replace then
for i = 1, #info.replace do
local rpl = info.replace[i]
local rpl = match(info.replace[i], "%S+")
local desc = clr("#ff0", get_desc(rpl, lang_code))

if info.cooktime then
Expand Down Expand Up @@ -1026,17 +1026,25 @@ local function get_grid_fs(lang_code, fs, rcp, spacing)
local label = groups and "\nG" or ""
local replace

if rcp.replacements then
for j = 1, #rcp.replacements do
local replacement = rcp.replacements[j]
if replacement[1] == name then
replace = replace or {}
for j = 1, #(rcp.replacements or {}) do
local replacement = rcp.replacements[j]
if replacement[1] == name then
replace = replace or {}

if j == 1 then
label = fmt("%s%s\nR",
label ~= "" and "\n" or "", label)
if j == 1 then
label = fmt("%s%s\nR", label ~= "" and "\n" or "", label)
end

local added

for _, v in ipairs(replace) do
if replacement[2] == v then
added = true
break
end
end

if not added then
replace[#replace + 1] = replacement[2]
end
end
Expand Down

0 comments on commit e6d1857

Please sign in to comment.