Commit a29e8574 authored by Azilroka's avatar Azilroka
Browse files

Bag Update

parent edd3ed86
......@@ -63,10 +63,6 @@ function B:SizeAndPositionBagBar()
button:Size(bagBarSize)
button:ClearAllPoints()
button:SetShown(i == 1 and justBackpack or not justBackpack)
if i == 1 then
button.Count:SetShown(GetCVarBool('displayFreeBagSlots'))
button.Count:SetText(CalculateTotalNumberOfFreeBagSlots())
end
if sortDirection == 'ASCENDING'then
if i == 1 then firstButton = button else lastButton = button end
......@@ -117,6 +113,12 @@ function B:SizeAndPositionBagBar()
end
B.BagBar.mover:SetSize(B.BagBar.backdrop:GetSize())
B:UpdateMainButtonCount()
end
function B:UpdateMainButtonCount()
B.BagBar.buttons[1].Count:SetShown(GetCVarBool('displayFreeBagSlots'))
B.BagBar.buttons[1].Count:SetText(CalculateTotalNumberOfFreeBagSlots())
end
function B:LoadBagBar()
......@@ -178,6 +180,6 @@ function B:LoadBagBar()
E:CreateMover(B.BagBar, 'BagsMover', L["Bags"], nil, nil, nil, nil, nil, 'bags,general')
B.BagBar:SetPoint('BOTTOMLEFT', B.BagBar.mover)
B:RegisterEvent('BAG_SLOT_FLAGS_UPDATED', 'SizeAndPositionBagBar')
B:RegisterEvent('BAG_UPDATE_DELAYED', 'SizeAndPositionBagBar')
B:RegisterEvent('BAG_UPDATE_DELAYED', 'UpdateMainButtonCount')
B:SizeAndPositionBagBar()
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment