mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-04 04:30:01 +00:00
bags: display shaguscore values on bag items
This commit is contained in:
committed by
shagu
parent
268b17f722
commit
cff11e2c26
@@ -365,6 +365,12 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
|
||||
pfUI.bags[bag].slots[slot].bag = bag
|
||||
pfUI.bags[bag].slots[slot].slot = slot
|
||||
pfUI.bags[bag].slots[slot].frame:SetID(slot)
|
||||
|
||||
if ShaguScore then
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText = pfUI.bags[bag].slots[slot].frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText:SetFont(pfUI.font_default, 12, "OUTLINE")
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText:SetPoint("BOTTOMRIGHT", 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local texture, count, locked, quality = GetContainerItemInfo(bag, slot)
|
||||
@@ -430,6 +436,25 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
|
||||
end
|
||||
end
|
||||
|
||||
-- add shaguscore if we have it
|
||||
if ShaguScore and pfUI.bags[bag].slots[slot].frame.scoreText then
|
||||
if quality and quality > 0 then
|
||||
local link = GetContainerItemLink(bag, slot)
|
||||
local r,g,b = GetItemQualityColor(quality)
|
||||
local _, _, itemID = string.find(link, "item:(%d+):%d+:%d+:%d+")
|
||||
local itemLevel = ShaguScore.Database[tonumber(itemID)] or 0
|
||||
local score = ShaguScore:Calculate(vslot, quality, itemLevel)
|
||||
if score and score > 0 then
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText:SetText(score)
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText:SetTextColor(r, g, b)
|
||||
else
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.bags[bag].slots[slot].frame.scoreText:SetText("")
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.bags[bag].slots[slot].frame:Show()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user