@@ -308,11 +308,7 @@ function containerProto:CreateReagentTabButton()
308
308
self .BagSlotButton :SetChecked (False )
309
309
end
310
310
self .Title :SetText (self .isReagentBank and REAGENT_BANK or L [" Bank" ])
311
- self :PauseUpdates ()
312
- for bag in pairs (previousBags ) do
313
- self :UpdateContent (bag )
314
- end
315
- self :ResumeUpdates ()
311
+ addon :SendMessage (' AdiBags_BagSetupChanged' )
316
312
end ,
317
313
function (_ , tooltip )
318
314
if not IsReagentBankUnlocked () then
@@ -391,6 +387,7 @@ function containerProto:OnShow()
391
387
self :RegisterEvent (' AUCTION_MULTISELL_UPDATE' )
392
388
self :RegisterEvent (' AUCTION_MULTISELL_FAILURE' , " ResumeUpdates" )
393
389
self :RegisterMessage (' AdiBags_SpellIsTargetingChanged' )
390
+ self :RegisterMessage (' AdiBags_BagSetupChanged' )
394
391
self :ResumeUpdates ()
395
392
containerParentProto .OnShow (self )
396
393
end
@@ -408,7 +405,19 @@ function containerProto:ResumeUpdates()
408
405
self .paused = false
409
406
self :RegisterMessage (' AdiBags_BagUpdated' , ' BagsUpdated' )
410
407
self :Debug (' ResumeUpdates' )
411
- for bag in pairs (self :GetBagIds ()) do
408
+ return self :AdiBags_BagSetupChanged ()
409
+ end
410
+
411
+ function containerProto :PauseUpdates ()
412
+ if self .paused then return end
413
+ self :Debug (' PauseUpdates' )
414
+ self :UnregisterMessage (' AdiBags_BagUpdated' )
415
+ self .paused = true
416
+ end
417
+
418
+ function containerProto :AdiBags_BagSetupChanged ()
419
+ self :Debug (' BagSetupChanged' )
420
+ for bag in pairs (self .content ) do
412
421
self :UpdateContent (bag )
413
422
end
414
423
if self .filtersChanged then
@@ -419,13 +428,6 @@ function containerProto:ResumeUpdates()
419
428
self :LayoutSections (true )
420
429
end
421
430
422
- function containerProto :PauseUpdates ()
423
- if self .paused then return end
424
- self :Debug (' PauseUpdates' )
425
- self :UnregisterMessage (' AdiBags_BagUpdated' )
426
- self .paused = true
427
- end
428
-
429
431
function containerProto :AUCTION_MULTISELL_UPDATE (event , current , total )
430
432
if current == total then
431
433
self :ResumeUpdates ()
554
556
-- Bag content scanning
555
557
---- ----------------------------------------------------------------------------
556
558
557
- local GetDistinctItemID = addon .GetDistinctItemID
558
- local IsValidItemLink = addon .IsValidItemLink
559
-
560
559
function containerProto :UpdateContent (bag )
561
560
self :Debug (' UpdateContent' , bag )
562
561
local added , removed , changed = self .added , self .removed , self .changed
@@ -567,7 +566,7 @@ function containerProto:UpdateContent(bag)
567
566
for slot = 1 , newSize do
568
567
local itemId = GetContainerItemID (bag , slot )
569
568
local link = GetContainerItemLink (bag , slot )
570
- if not itemId or (link and IsValidItemLink (link )) then
569
+ if not itemId or (link and addon . IsValidItemLink (link )) then
571
570
local slotData = content [slot ]
572
571
if not slotData then
573
572
slotData = {
@@ -589,7 +588,7 @@ function containerProto:UpdateContent(bag)
589
588
link , count = false , 0
590
589
end
591
590
592
- if GetDistinctItemID ( slotData .link ) ~= GetDistinctItemID ( link ) then
591
+ if slotData .link ~= link then
593
592
removed [slotData .slotId ] = slotData .link
594
593
slotData .count = count
595
594
slotData .link = link
0 commit comments