mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-17 18:20:49 +00:00
use GetContainerItemCharges from classicapi
This commit is contained in:
+10
-9
@@ -698,19 +698,20 @@ pfUI:RegisterModule("bags", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local itemID = C_Container.GetContainerItemID(bag, slot)
|
||||||
|
|
||||||
local texture, count, locked, quality = GetContainerItemInfo(bag, slot)
|
local texture, count, locked, quality = GetContainerItemInfo(bag, slot)
|
||||||
|
|
||||||
-- Nampower 4.1.4+: spellChargesRemaining gives accurate charge count for
|
|
||||||
-- charged items (e.g. Brilliant Mana Oil).
|
if count == 1 then
|
||||||
-- Only use it when stackCount == 1 and spellChargesRemaining > 1,
|
local charges = C_Container.GetContainerItemCharges(bag, slot)
|
||||||
-- otherwise we'd override normal stack counts.
|
if charges > 1 then
|
||||||
if GetBagItem then
|
count = charges
|
||||||
local ok, itemInfo = pcall(GetBagItem, bag, slot)
|
|
||||||
if ok and itemInfo and itemInfo.stackCount == 1 and itemInfo.spellChargesRemaining and itemInfo.spellChargesRemaining > 1 then
|
|
||||||
count = itemInfo.spellChargesRemaining
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local _, _, q, _, _, _, itype = GetItemInfo(C_Container.GetContainerItemID(bag, slot))
|
|
||||||
|
|
||||||
|
local _, _, q, _, _, _, itype = GetItemInfo(itemID)
|
||||||
|
|
||||||
-- running advanced item color scan
|
-- running advanced item color scan
|
||||||
if C.appearance.bags.borderonlygear == "0" and texture and quality and quality < 1 then
|
if C.appearance.bags.borderonlygear == "0" and texture and quality and quality < 1 then
|
||||||
|
|||||||
Reference in New Issue
Block a user