Update GetItemLinkByName to use C_Item API

Replace vanilla GetItemInfo and manual link construction with C_Item.GetItemNameByID and C_Item.GetItemInfo
This commit is contained in:
Brues
2026-07-20 15:11:50 -05:00
parent 8cdced5ec0
commit 801935130e
+4 -4
View File
@@ -385,10 +385,10 @@ end
-- returns: [string] entire itemLink for the given item
function pfUI.api.GetItemLinkByName(name)
for itemID = 1, 25818 do
local itemName, hyperLink, itemQuality = GetItemInfo(itemID)
if (itemName and itemName == name) then
local _, _, _, hex = GetItemQualityColor(tonumber(itemQuality))
return hex.. "|H"..hyperLink.."|h["..itemName.."]|h|r"
local itemName = C_Item.GetItemNameByID(itemID)
if itemName and itemName == name then
local _, itemLink = C_Item.GetItemInfo(itemID)
return itemLink
end
end
end