Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions EllesmereUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,27 @@ do
return text, map[key or ""] or W
end

-- Crest bonuses identify the crafting tier independently of quality and
-- overlapping item levels. Midnight S2 Hero/Myth: 13835/13836.
-- Source: https://www.raidbots.com/static/data/live/bonuses.json
local craftedColors = { [13835] = HE, [13836] = MY }
function EllesmereUI.GetCraftedTrackColor(itemLink)
if type(itemLink) ~= "string" then return nil end
local payload = itemLink:match("item:([^|]+)")
if not payload then return nil end
local index, lastBonus = 0, 13
for field in (payload .. ":"):gmatch("([^:]*):") do
index = index + 1
if index == 13 then
lastBonus = 13 + (tonumber(field) or 0)
elseif index > 13 then
if index > lastBonus then break end
local color = craftedColors[tonumber(field)]
if color then return color end
end
end
end

-- Item-level text color: custom override > upgrade-track hue > item rarity >
-- white. Shared by character sheet, inspect sheet and equipment flyout.
function EllesmereUI.GetItemLevelColor(itemLink, itemQuality)
Expand Down
9 changes: 8 additions & 1 deletion EllesmereUIBags/EllesmereUIBags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ do
if GetUpgradeTrack and _trackRank then
local _, color = GetUpgradeTrack(d.itemLink)
rank = color and _trackRank[color] or 0
local craftedColor = EUI.GetCraftedTrackColor(d.itemLink)
if craftedColor then
rank = _trackRank[craftedColor]
ilvl = C_Item.GetDetailedItemLevelInfo(d.itemLink) or ilvl
end
end
c = { name = name or "", quality = quality or 0, ilvl = ilvl or 0,
itemType = itemType or "", rank = rank, complete = name ~= nil }
Expand Down Expand Up @@ -3070,7 +3075,7 @@ local function RenderButton(btn, data, _, col, row, startX, currentY, _, interac
local trackColor = data._giTrackColor
if BP().itemlevelUseCustomColor and BP().itemlevelCustomColor then
r, g, b = BP().itemlevelCustomColor.r, BP().itemlevelCustomColor.g, BP().itemlevelCustomColor.b
elseif rankText ~= "" and trackColor then
elseif trackColor then
r, g, b = trackColor.r, trackColor.g, trackColor.b
else
r, g, b = GetItemQualityColor(data._giQuality or 1)
Expand Down Expand Up @@ -5577,6 +5582,8 @@ function EUI_Bags:RefreshInventory()
if rankText and rankText ~= "" then
d._giTrackRank = rankText
d._giTrackColor = trackColor
elseif d._giIlvl and not (BP().itemlevelUseCustomColor and BP().itemlevelCustomColor) then
d._giTrackColor = EUI.GetCraftedTrackColor(itemLink)
end
end
-- Warbound check (warbank dim overlay) + WuE bind check (gear only, when bind-type text is enabled).
Expand Down
5 changes: 5 additions & 0 deletions EllesmereUIBags/EllesmereUIBags_Bank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2443,6 +2443,11 @@ function EUI_Bank:RefreshBank()
r, g, b = BP().itemlevelCustomColor.r, BP().itemlevelCustomColor.g, BP().itemlevelCustomColor.b
elseif rankText and rankText ~= "" and trackColor then
r, g, b = trackColor.r, trackColor.g, trackColor.b
else
local craftedColor = EUI.GetCraftedTrackColor(itemLink)
if craftedColor then
r, g, b = craftedColor.r, craftedColor.g, craftedColor.b
end
end
end
if not r then
Expand Down