@@ -36,6 +36,7 @@ local UnitGUID = UnitGUID
3636local UnitHealthMax = UnitHealthMax
3737local UnitLevel = UnitLevel
3838local UnitName = UnitName
39+ local GetServerExpansionLevel = GetServerExpansionLevel
3940
4041local HEALTH = HEALTH
4142local LEVEL = LEVEL
@@ -53,6 +54,7 @@ local Enum_ItemQuality_Common = Enum.ItemQuality.Common
5354local guids , inspecting = {}, false
5455
5556local LABEL_COLOR = C .GetRGBFromTemplate (" cyan-300" )
57+ local CURRENT_EXPANSION_ID = GetServerExpansionLevel ()
5658
5759local DISPLAY_SLOTS = {}
5860for slotIndex , slotName in ipairs (W .EquipmentSlots ) do
@@ -82,12 +84,25 @@ local function GetUnitSlotItemInfo(unit, slotIndex)
8284 return
8385 end
8486
85- local name , _ , quality , level , _ , type , subType , _ , itemEquipLoc , tex , _ , _ , _ , _ , _ , set = C_Item_GetItemInfo (link )
87+ local name , _ , quality , level , _ , type , subType , _ , itemEquipLoc , tex , _ , _ , _ , _ , expansionID , set , isCraftingReagent =
88+ C_Item_GetItemInfo (link )
89+
90+ local craftingAtlas
91+ local cleanLink = gsub (link , " |h%[(.+)%]|h" , function (raw )
92+ local name = gsub (raw , " (%s*)(|A:.-|a)" , function (_ , atlasString )
93+ craftingAtlas = gsub (atlasString , " |A:(.-):%d+:%d+::%d+|a" , " %1" )
94+ return " "
95+ end )
96+ return " |h" .. name .. " |h"
97+ end )
8698
8799 return {
100+ cleanLink = cleanLink ,
101+ craftingAtlas = craftingAtlas ,
102+ expansionID = expansionID ,
103+ isCraftingReagent = isCraftingReagent ,
88104 level = level ,
89105 link = link ,
90- noBracketsLink = gsub (link , " h%[(.+)%]|h" , " h%1|h" ),
91106 name = name ,
92107 quality = quality ,
93108 set = set ,
@@ -454,11 +469,9 @@ function I:BuildInspectItemListFrame(parent)
454469 )
455470 line .ItemTextureFrame :SetTemplate ()
456471
457- line .ItemTextureFrame .TierSetIndicator = line .ItemTextureFrame :CreateFontString (nil , " OVERLAY" )
458- F .SetFontOutline (line .ItemTextureFrame .TierSetIndicator , F .GetCompatibleFont (" Chivo Mono" ), 20 )
459- line .ItemTextureFrame .TierSetIndicator :Point (" CENTER" , line .ItemTextureFrame .Texture , " TOPRIGHT" , 1 , - 1 )
460- line .ItemTextureFrame .TierSetIndicator :SetTextColor (C .ExtractRGBFromTemplate (" pink-500" ))
461- line .ItemTextureFrame .TierSetIndicator :SetText (" *" )
472+ line .ItemTextureFrame .SpecialIndicator = line .ItemTextureFrame :CreateFontString (nil , " OVERLAY" )
473+ F .SetFontOutline (line .ItemTextureFrame .SpecialIndicator , F .GetCompatibleFont (" Chivo Mono" ), 20 )
474+ line .ItemTextureFrame .SpecialIndicator :Point (" CENTER" , line .ItemTextureFrame .Texture , " TOPRIGHT" , 1 , - 2 )
462475
463476 -- Item Name
464477 line .ItemName = line :CreateFontString (nil , " ARTWORK" )
@@ -550,7 +563,7 @@ function I:ShowInspectItemListFrame(unit, parent, ilevel)
550563
551564 if itemInfo and itemInfo .level > 0 then
552565 line .ItemLevel :SetText (format (" %d" , itemInfo .level ))
553- line .ItemName :SetText (itemInfo .noBracketsLink or itemInfo .link or itemInfo .name )
566+ line .ItemName :SetText (itemInfo .cleanLink or itemInfo .link or itemInfo .name )
554567 else
555568 line .ItemLevel :SetText (" " )
556569 line .ItemName :SetText (L [" Not Equipped" ])
@@ -575,10 +588,23 @@ function I:ShowInspectItemListFrame(unit, parent, ilevel)
575588 line .ItemTextureFrame :Hide ()
576589 end
577590
578- if self .db .icon .enable and self .db .icon .tierSetIndicator and itemInfo and itemInfo .set and itemInfo .set > 0 then
579- line .ItemTextureFrame .TierSetIndicator :Show ()
591+ if self .db .icon .enable and self .db .icon .specialIndicator and itemInfo then
592+ if itemInfo .set and itemInfo .set > 0 then
593+ if itemInfo .expansionID >= CURRENT_EXPANSION_ID then
594+ line .ItemTextureFrame .SpecialIndicator :SetTextColor (C .ExtractRGBFromTemplate (" pink-500" ))
595+ else
596+ line .ItemTextureFrame .SpecialIndicator :SetTextColor (C .ExtractRGBFromTemplate (" gray-400" ))
597+ end
598+ line .ItemTextureFrame .SpecialIndicator :SetText (" *" )
599+ line .ItemTextureFrame .SpecialIndicator :Show ()
600+ elseif itemInfo .craftingAtlas then
601+ line .ItemTextureFrame .SpecialIndicator :SetText (" |A:" .. itemInfo .craftingAtlas .. " :8:8|a" )
602+ line .ItemTextureFrame .SpecialIndicator :Show ()
603+ else
604+ line .ItemTextureFrame .SpecialIndicator :Hide ()
605+ end
580606 else
581- line .ItemTextureFrame .TierSetIndicator :Hide ()
607+ line .ItemTextureFrame .SpecialIndicator :Hide ()
582608 end
583609
584610 -- Update colors for some expansion special items
0 commit comments