View Single Post
08-22-21, 12:38 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
DuffedUI replaces OpenAllBagsMatchingContext with an empty function, but the Blizzard UI expects a number returned from that function.

Here's the function called when you open the Soulbind UI:

Lua Code:
  1. function SoulbindViewerMixin:OnShow() -- line 85
  2.     FrameUtil.RegisterFrameForEvents(self, SoulbindViewerEvents);
  3.  
  4.     self:UpdateButtons();
  5.  
  6.     PlaySound(SOUNDKIT.SOULBINDS_OPEN_UI);
  7.    
  8.     self:UpdateBackgrounds();
  9.  
  10.     if C_Soulbinds.CanModifySoulbind() then
  11.         ItemButtonUtil.OpenAndFilterBags(self); -- line 95
  12.     end
  13.  
  14.     self:CheckTutorials();
  15. end

Here's what that function calls to open bags:

Lua Code:
  1. function ItemButtonUtil.OpenAndFilterBags(frame) -- line 62
  2.     ItemButtonUtil.TriggerEvent(ItemButtonUtil.Event.ItemContextChanged);
  3.  
  4.     local openedCount = OpenAllBagsMatchingContext(frame); -- line 65
  5.     frame.closeBagsOnHide = openedCount > 0; -- line 66
  6. end

When OpenAllBagsMatchingContext is called, it goes through the bags and counts which ones are opening:

Lua Code:
  1. function OpenAllBagsMatchingContext(frame)
  2.     local count = 0;
  3.     for i = 0, NUM_BAG_FRAMES do
  4.         if ItemButtonUtil.GetItemContextMatchResultForContainer(i) == ItemButtonUtil.ItemContextMatchResult.Match then
  5.             if not IsBagOpen(i) then
  6.                 OpenBag(i);
  7.                 count = count + 1;
  8.             end
  9.         end
  10.     end
  11.  
  12.     if frame and not FRAME_THAT_OPENED_BAGS then
  13.         FRAME_THAT_OPENED_BAGS = frame:GetName();
  14.     end
  15.  
  16.     return count;
  17. end

The source of the issue is the very last line of the code you linked:
OpenAllBagsMatchingContext = D['Noop']
Based on common code practices, D['Noop'] should be equal to function()end.

This error can be fixed by changing that line to the following:
OpenAllBagsMatchingContext = function() return 0 end
  Reply With Quote