bags: only refresh if it has an item

This commit is contained in:
shagu
2016-11-26 00:51:25 +01:00
parent 4afe493b72
commit d63c6a68d8
+9 -1
View File
@@ -82,7 +82,9 @@ pfUI:RegisterModule("bags", function ()
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot=1, bagsize do
ContainerFrame_UpdateCooldown(bag, pfUI.bags[bag].slots[slot].frame)
if pfUI.bags[bag].slots[slot].frame.hasItem then
ContainerFrame_UpdateCooldown(bag, pfUI.bags[bag].slots[slot].frame)
end
end
end
end
@@ -253,6 +255,12 @@ pfUI:RegisterModule("bags", function ()
SetItemButtonCount(pfUI.bags[bag].slots[slot].frame, count)
SetItemButtonDesaturated(pfUI.bags[bag].slots[slot].frame, locked, 0.5, 0.5, 0.5)
if texture then
pfUI.bags[bag].slots[slot].frame.hasItem = 1
else
pfUI.bags[bag].slots[slot].frame.hasItem = nil
end
-- bankframe does not support cooldowns
if bag ~= -1 then
ContainerFrame_UpdateCooldown(bag, pfUI.bags[bag].slots[slot].frame)