Skip to content

Commit 34bb232

Browse files
p-ouellettesfan5
authored andcommittedMar 17, 2021
mtg_craftguide: Fix incorrect item tooltips
This happened when the same item was visible twice and one of them was a group item. Fix it by ensuring that buttons that should have different tooltips don't have the same element name.
1 parent 2c9733a commit 34bb232

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

Diff for: ‎mods/mtg_craftguide/init.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,13 @@ local function recipe_fs(fs, data)
242242
for i, item in pairs(recipe.items) do
243243
local x, y = coords(i - 1, width)
244244

245+
local elem_name = item
245246
local groups = extract_groups(item)
246247
if groups then
247248
item = groups_to_item(groups)
249+
elem_name = esc(item.."."..table.concat(groups, "+"))
248250
end
249-
item_button_fs(fs, base_x + x, base_y + y, item, item, groups)
251+
item_button_fs(fs, base_x + x, base_y + y, item, elem_name, groups)
250252
end
251253

252254
if shapeless or recipe.method == "cooking" then
@@ -378,7 +380,7 @@ local function on_receive_fields(player, fields)
378380
local item
379381
for field in pairs(fields) do
380382
if field:find(":") then
381-
item = field
383+
item = field:match("[%w_:]+")
382384
break
383385
end
384386
end

0 commit comments

Comments
 (0)
Please sign in to comment.