diff --git a/RatingBuster.lua b/RatingBuster.lua index 32100db..711a491 100644 --- a/RatingBuster.lua +++ b/RatingBuster.lua @@ -1624,6 +1624,10 @@ do elseif case.set then name = C_Item.GetItemSetInfo(case.set) icon = [[Interface/PaperDollInfoFrame/UI-EquipmentManager-Toggle]] + elseif case.enchant then + name = StatLogic:GetEnchantText(case.enchant) + -- Currently, all enchant statMods are Death Knight Runeforges + icon = [[Interface/ICONS/Spell_DeathKnight_FrozenRuneWeapon]] end if name and icon then local source = "|T"..icon..":20|t"..name diff --git a/libs/StatLogic/StatLogic.lua b/libs/StatLogic/StatLogic.lua index c302664..eba5d20 100644 --- a/libs/StatLogic/StatLogic.lua +++ b/libs/StatLogic/StatLogic.lua @@ -1727,6 +1727,42 @@ function StatLogic:GetGemID(item) end end +do + local baseItemLink = "item:9333:" + C_Item.RequestLoadItemDataByID(baseItemLink) + + local function GetBaseItemText() + tip:ClearLines() + tip:SetHyperlink(baseItemLink) + local itemText = {} + for i = 1, tip:NumLines() do + local text = tip.sides.left[i]:GetText() + if text then + itemText[i] = text + end + end + return itemText + end + local baseItemText + + ---@param enchantID integer + ---@return string + function StatLogic:GetEnchantText(enchantID) + if not baseItemText then + baseItemText = GetBaseItemText() + end + tip:ClearLines() + tip:SetHyperlink(baseItemLink .. enchantID) + for i = 1, tip:NumLines() do + local text = tip.sides.left[i]:GetText() + if text and baseItemText[i] ~= text then + return text + end + end + return "" + end +end + local function ConvertGenericStats(table) for generic, ratings in pairs(StatLogic.GenericStatMap) do if table[generic] then