@@ -23,14 +23,10 @@ local function addiLvlDisplay(button, itemLevel, itemQuality)
23
23
end
24
24
25
25
if not button .ilvlText then
26
- local overlayFrame = CreateFrame (' FRAME' , nil , button )
27
- overlayFrame :SetAllPoints ()
28
- button .ilvlOverlay = overlayFrame
29
- button .ilvlText = overlayFrame :CreateFontString (' $parentItemLevel' , ' OVERLAY' )
26
+ button .ilvlText = button .SUIOverlay :CreateFontString (' $parentItemLevel' , ' OVERLAY' )
30
27
button .ilvlText :Hide ()
31
28
end
32
29
33
- button .ilvlOverlay :SetFrameLevel (button :GetFrameLevel () + 1 )
34
30
button .ilvlText :ClearAllPoints ()
35
31
button .ilvlText :SetPoint (module .DB .position )
36
32
SUI .Font :Format (button .ilvlText , module .DB .fontSize , ' CharacterScreen' )
@@ -65,7 +61,32 @@ local function UpdateItemSlotButton(button, unit)
65
61
if not item or item :IsItemEmpty () then return end
66
62
67
63
item :ContinueOnItemLoad (function ()
64
+ -- Create overlay frame if it doesn't exist
65
+ if not button .SUIOverlay then
66
+ local overlayFrame = CreateFrame (' FRAME' , nil , button )
67
+ overlayFrame :SetAllPoints ()
68
+ overlayFrame :SetFrameLevel (button :GetFrameLevel () + 1 )
69
+ button .SUIOverlay = overlayFrame
70
+ end
71
+
72
+ -- Add item level text to the overlay frame
68
73
addiLvlDisplay (button , item :GetCurrentItemLevel (), item :GetItemQuality ())
74
+
75
+ -- Add Text next to item if its Cloak of Infinite Potential
76
+ if string.match (item :GetItemName (), ' Cloak of Infinite Potential' ) and SUI :IsModuleEnabled (module ) then
77
+ local c , ThreadCount = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 148 }, 0
78
+ for i = 1 , 9 do
79
+ ThreadCount = ThreadCount + C_CurrencyInfo .GetCurrencyInfo (2853 + c [i ]).quantity
80
+ end
81
+ -- print('Total threads updated: ' .. ThreadCount)
82
+ if not button .threadCount then
83
+ button .threadCount = button .SUIOverlay :CreateFontString (' $parentItemLevel' , ' OVERLAY' )
84
+ SUI .Font :Format (button .threadCount , module .DB .fontSize - 2 , ' CharacterScreen' )
85
+ button .threadCount :ClearAllPoints ()
86
+ button .threadCount :SetPoint (' LEFT' , button .SUIOverlay , ' RIGHT' , 2 , 0 )
87
+ end
88
+ button .threadCount :SetFormattedText (' Threads:\n ' .. ThreadCount )
89
+ end
69
90
end )
70
91
end
71
92
end
0 commit comments