@@ -29,20 +29,20 @@ TooltipHelper.config = (
2929 end
3030)()
3131
32- TooltipHelper .magnumOpus . recipes = {
32+ TooltipHelper .magnumOpusRecipes = {
3333 [" Drug_HP3" ] = {
34- { name = " Drug_HP1" , row = 0 , y = 0 },
35- { name = " Drug_HP1" , row = 1 , y = 0 },
36- { name = " Drug_HP2" , row = 0 , y = 1 }
34+ { name = " Drug_HP1" , row = 0 , col = 0 },
35+ { name = " Drug_HP1" , row = 1 , col = 0 },
36+ { name = " Drug_HP2" , row = 0 , col = 1 }
3737 },
3838 [" misc_jore14" ] = {
39- { name = " misc_jore12" , row = 0 , y = 0 }
39+ { name = " misc_jore12" , row = 0 , col = 0 }
4040 },
4141 [" misc_jore15" ] = {
42- { name = " misc_jore13" , row = 0 , y = 0 },
43- { name = " misc_jore13" , row = 0 , y = 1 },
44- { name = " misc_jore13" , row = 1 , y = 0 },
45- { name = " misc_jore13" , row = 1 , y = 1 }
42+ { name = " misc_jore13" , row = 0 , col = 0 },
43+ { name = " misc_jore13" , row = 0 , col = 1 },
44+ { name = " misc_jore13" , row = 1 , col = 0 },
45+ { name = " misc_jore13" , row = 1 , col = 1 }
4646 },
4747 [" Hat_628042" ] = {
4848 { name = " wood_01" , row = 0 , col = 0 },
@@ -1405,14 +1405,15 @@ function MAGNUM_OPUS_TRANSMUTED_FROM(invItem)
14051405
14061406 local invItemClassName = invItem .ClassName
14071407
1408- for k , v in pairs (TooltipHelper .magnumOpus .recipes ) do
1409- local targetItemClassName = k ;
1410- if targetItemClassName == invItemClassName then
1411- local items = v
1408+ for k , v in pairs (TooltipHelper .magnumOpusRecipes ) do
1409+ if k == invItemClassName then
1410+ local items = v ;
1411+ local itemQty = # v
1412+
14121413 local ingredients = {}
14131414
1414- for m = 1 , # items do
1415- local item = items [m ][" name" ]
1415+ for m = 1 , # v do
1416+ local item = v [m ][" name" ]
14161417
14171418 if ingredients [item ] == nil then
14181419 ingredients [item ] = 1
@@ -1423,29 +1424,25 @@ function MAGNUM_OPUS_TRANSMUTED_FROM(invItem)
14231424 end
14241425
14251426 -- Handle targetItems with multiple ingredients
1426- for k , v in pairs (ingredients ) do
1427- local className = k
1428- local qty = v
1427+ for className , quantity in pairs (ingredients ) do
14291428 local item = GetClass (" Item" , className )
14301429 local itemName = dictionary .ReplaceDicIDInCompStr (item .Name )
1431- text = toIMCTemplate (qty .. " x" .. addIcon (itemName , item .Icon ), labelColor ) .. newLine
1430+ text = toIMCTemplate (quantity .. " x" .. addIcon (itemName , item .Icon ), labelColor ) .. newLine
14321431 end
14331432
14341433 text = text .. " "
14351434
1436- local itemQty = # items
14371435 for x = 0 , itemQty - 1 do
14381436 for y = 0 , itemQty - 1 do
14391437 local icon = " {img nomalitem_tooltip_bg 24 24}{/} " ;
14401438 local isItemFound = false
14411439
1442- for j = 1 , # items do
1443- local item = items [j ]
1444- local rowSlot = item [" row" ]
1445- local colSlot = item [" rol" ]
1446- local name = item [" name" ]
1440+ for j = 1 , itemQty do
1441+ local rowSlot = items [j ][" row" ]
1442+ local colSlot = items [j ][" col" ]
1443+ local name = items [j ][" name" ]
14471444
1448- if rowSlot == tostring ( x ) and colSlot == tostring ( y ) then
1445+ if rowSlot == x and colSlot == y then
14491446 isItemFound = true
14501447 end
14511448
@@ -1481,7 +1478,7 @@ function MAGNUM_OPUS_TRANSMUTES_INTO(invItem)
14811478 local targetItems = {}
14821479 local invItemClassName = invItem .ClassName
14831480
1484- for k , v in pairs (TooltipHelper .magnumOpus . recipes ) do
1481+ for k , v in pairs (TooltipHelper .magnumOpusRecipes ) do
14851482 local targetItemClassName = k ;
14861483 local items = v
14871484
@@ -1591,7 +1588,7 @@ end
15911588
15921589function RENDER_MAGNUM_OPUS (tooltipFrame , buffer , invItem , text )
15931590 if TooltipHelper .config .showMagnumOpus then
1594- text = CREATE_MAGNUM_OPUS_SECTION (invItem )
1591+ text = RENDER_MAGNUM_OPUS_SECTION (invItem )
15951592 if text ~= " " then
15961593 table.insert (buffer ,text )
15971594 end
0 commit comments