Skip to content

Commit

Permalink
Minor Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
doadin committed Jul 1, 2024
1 parent cd59b56 commit c9f273f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
4 changes: 0 additions & 4 deletions Baggins-Filtering.lua
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,6 @@ function Baggins:ForceFullUpdate()
self:CheckSlotsChanged(-2,true)
end
self:CheckSlotsChanged(-1,true)
self:CategoriesChanged()
end

function Baggins:CategoriesChanged()
self:Baggins_CategoriesChanged()
end

Expand Down
20 changes: 9 additions & 11 deletions Baggins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,6 @@ function Baggins:OnEnable()
self:RunBagUpdates()
end

function Baggins:FixInit()
self:ForceFullUpdate()
self:RebuildSectionLayouts()
self:UpdateBags()
end

function Baggins:Baggins_CategoriesChanged()
self:UpdateBags()
self.doInitialBankUpdate = true
Expand Down Expand Up @@ -714,7 +708,7 @@ end

function Baggins:OnBankOpened()
if self.doInitialBankUpdate then
self.doInitialBankUpdate = nil
self.doInitialBankUpdate = false
Baggins:ForceFullBankUpdate()
end
self.bankIsOpen = true
Expand Down Expand Up @@ -4076,10 +4070,14 @@ function Baggins:OpenBag(bagid,_) --bagid,noupdate
-- reuse self.doInitialUpdate to only run once
-- this fixes the duplicate stacks bug upon login
if self.doInitialUpdate then
-- this time we set to nil so this only runs the first time
self.doInitialUpdate = nil
-- rebuild layouts to fix duplicate stacks
self:ScheduleForNextFrame('FixInit')
-- this time we set to nil so this only runs the first time
self.doInitialUpdate = false
-- rebuild layouts to fix duplicate stacks
--self:ScheduleForNextFrame('FixInit')
--same
self:ForceFullUpdate()
self:RebuildSectionLayouts()
self:UpdateBags()
end
PlaySound(862)
end
Expand Down

0 comments on commit c9f273f

Please sign in to comment.