Skip to content

Commit eeed5a5

Browse files
committed
Add Cloak of Infinite Potential thread count
1 parent 36ecf53 commit eeed5a5

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

Modules/ImprovedCharacterScreen.lua

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ local function addiLvlDisplay(button, itemLevel, itemQuality)
2323
end
2424

2525
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')
3027
button.ilvlText:Hide()
3128
end
3229

33-
button.ilvlOverlay:SetFrameLevel(button:GetFrameLevel() + 1)
3430
button.ilvlText:ClearAllPoints()
3531
button.ilvlText:SetPoint(module.DB.position)
3632
SUI.Font:Format(button.ilvlText, module.DB.fontSize, 'CharacterScreen')
@@ -65,7 +61,32 @@ local function UpdateItemSlotButton(button, unit)
6561
if not item or item:IsItemEmpty() then return end
6662

6763
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
6873
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
6990
end)
7091
end
7192
end

0 commit comments

Comments
 (0)