Ok, for those who have same issue when creating overlay, I fixed it with this code
Lua Code:
function poseDot()
for bag = 0,4 do
for slot = 1, GetContainerNumSlots(bag) do
local myBag = bag+1
local mySlot = GetContainerNumSlots(bag) - (slot - 1)
local button = _G["ContainerFrame"..myBag.."Item"..mySlot]
if button.overlay then
button.overlay:SetShown(false)
button.overlay = nil
end
local itemLink = GetContainerItemLink(bag, slot)
if itemLink then
local weightCalcResult = weightCalculation(itemLink)
if weightCalcResult[1] ~= nil and weightCalcResult[1] > 0 or weightCalcResult[2] ~= nil and weightCalcResult[2] > 0 then
-- create overlay texture if it doesn't exit for the button
if not button.overlay then
button.overlay = button:CreateTexture(nil,"OVERLAY")
button.overlay:SetSize(18,18)
button.overlay:SetPoint("TOPLEFT")
button.overlay:SetTexture("Interface\\AddOns\\GearHelper\\Textures\\flecheUp")
--button.overlay:SetTexture("Interface\\Common\\Indicator-Green")
button.overlay:SetShown(true)
end
end
end
end
end
ContainerFrame_UpdateAll()
end
and I call my function in
function allEvents:ITEM_PUSH( bag, icone )
and
function allEvents:BAG_UPDATE( bagID )