Thread Tools Display Modes
07-06-14, 05:57 AM   #41
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Oh never mind, just found the root cause of that issue with a function that's trying to create a runaway quantity of frames.
  Reply With Quote
07-22-14, 09:32 AM   #42
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
does anyone have any idea what's causing this to happen to my bags? It nearly always occurs upon first login, and occasionally when opening the bags during gameplay - and only a ui reload will fix it.

This is the accompanying error via bugsack:

Code:
150x Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:51: <string>:"safecall Dispatcher[2]":1: chunk has too many syntax levels
<in C code>
Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:51: in function <Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:55: in function <Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:54>
Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:92: in function "Fire"
!BugGrabber-r198-release\BugGrabber.lua:130: in function <!BugGrabber\BugGrabber.lua:128>
!BugGrabber-r198-release\BugGrabber.lua:354: in function <!BugGrabber\BugGrabber.lua:297>
<in C code>
<in C code>
<in C code>
<in C code>
<in C code>
<in C code>
ContainerFrame.lua:175: in function "ContainerFrame_OnShow"
<string>:"*:OnShow":1: in function <string>:"*:OnShow":1
<in C code>
FrameXML\ContainerFrame.lua:603: in function "ContainerFrame_GenerateFrame"
FrameXML\ContainerFrame.lua:73: in function "ToggleBag"
FrameXML\ContainerFrame.lua:95: in function "ToggleBackpack"
FrameXML\ContainerFrame.lua:246: in function "OpenBackpack"
FrameXML\ContainerFrame.lua:896: in function "ToggleAllBags"
<string>:"OPENALLBAGS":1: in function <string>:"OPENALLBAGS":1

And this is all the code I use related to my bags:

Lua Code:
  1. -- Bags ---------------------------------------------------------------------------------
  2.  
  3. -- border colouring for bags ------------------------------------------------------------
  4. -- by item quality (uncommon+)
  5. -- or quest item
  6. -- else default grey
  7.  
  8.      local function ColourBagBorders(self, slotID)
  9.         local quality, texture, _
  10.         local questtext = _G[self:GetName().."IconQuestTexture"]
  11.  
  12.         if slotID then
  13.             quality, _, _, _, _, _, _, texture = select(3, GetItemInfo(slotID))
  14.         end
  15.  
  16.         if texture then
  17.             if ((questtext) and (questtext:IsShown())) then
  18.                 self:SetBeautyBorderColor(248/255, 98/255, 86/255)
  19.             elseif ((quality) and (quality >= 2)) then
  20.                 local r, g, b = GetItemQualityColor(quality)
  21.                 self:SetBeautyBorderColor(r, g, b)
  22.                     else
  23.                 self:SetBeautyBorderColor(103/255, 103/255, 103/255)
  24.             end
  25.         else
  26.             self:SetBeautyBorderColor(103/255, 103/255, 103/255)
  27.         end
  28.     end  
  29.    
  30.  
  31.  
  32. -- backpack click functionality ---------------------------------------------------------
  33.  
  34.     -- open/close all bags on click
  35.     function BackpackButton_OnClick(self)
  36.          if (not PutItemInBackpack()) then
  37.                  ToggleAllBags();
  38.          end
  39.         BackpackButton_UpdateChecked(self)
  40.     end
  41.    
  42.     -- open/close just the backpack on shift-click
  43.     -- might try and make this do something more useful later
  44.     function BackpackButton_OnModifiedClick(self)
  45.         if (IsModifiedClick("OPENALLBAGS")) then
  46.             if (GetInventoryItemTexture("player", self:GetID())) then
  47.                 ToggleBackpack();
  48.             end
  49.         end
  50.         BackpackButton_UpdateChecked(self)
  51.     end
  52.        
  53.    
  54.    
  55. -- implement ----------------------------------------------------------------------------
  56.  
  57.     local SkinBagButtons = CreateFrame("Frame", nil, UIParent)
  58.     SkinBagButtons:RegisterEvent("PLAYER_ENTERING_WORLD")
  59.     SkinBagButtons:RegisterEvent("UNIT_INVENTORY_CHANGED")
  60.     SkinBagButtons:RegisterEvent("ITEM_PUSH")
  61.     SkinBagButtons:RegisterEvent("BAG_UPDATE")
  62.     SkinBagButtons:RegisterEvent("ITEM_LOCK_CHANGED")
  63.     SkinBagButtons:RegisterEvent("BAG_CLOSED")
  64.    
  65.     SkinBagButtons:SetScript("OnEvent", function(self, event)
  66.    
  67.         -- 6.0 ONLY!
  68.         -- "clean up bags" button
  69.         local bagsort = BagItemAutoSortButton
  70.         if (bagsort) then
  71.             bagsort:CreateBeautyBorder(14)  
  72.             bagsort:SetBeautyBorderColor(103/255, 103/255, 103/255)
  73.             --bagsort:SetBeautyBorderPadding(3, 3, 3, 3, 3, 3, 3, 3)
  74.             bagsort:SetBeautyBorderDraw("OVERLAY")
  75.         end
  76.        
  77.         -- bag buttons
  78.         for i = 1, 12 do
  79.             local con = _G["ContainerFrame"..i]
  80.             for k = 1, MAX_CONTAINER_ITEMS do
  81.                 local item = "ContainerFrame"..i.."Item"..k
  82.                 local button = _G[item]
  83.                 local buq = _G[item.."IconQuestTexture"]
  84.                 local bucount =  _G[item.."Count"]
  85.                 local buic = _G[item.."IconTexture"]
  86.  
  87.                 if (button) and not button.skinned then
  88.                     --buq:SetAlpha(0)
  89.                     button:CreateBeautyBorder(22)  
  90.                     button:SetBeautyBorderPadding(3, 3, 3, 3, 3, 3, 3, 3)
  91.                     button:SetBeautyBorderDraw("OVERLAY")
  92.                     button:SetNormalTexture("")
  93.                     button:SetPushedTexture("")
  94.                     button:SetHighlightTexture("")
  95.                     buic:SetTexCoord(.1, .9, .1, .9)
  96.                     bucount:SetDrawLayer("OVERLAY", 7)
  97.                     bucount:SetJustifyH("CENTER")
  98.                     bucount:ClearAllPoints()
  99.                     bucount:SetPoint("CENTER", item, "BOTTOM", 1, 1)
  100.                     bucount:SetFont(STANDARD_TEXT_FONT, 15, "THINOUTLINE")
  101.                     button.skinned = true
  102.                 end
  103.             end
  104.         end
  105.        
  106.         -- colouring borders
  107.         local function bagcolourupdate(self)
  108.             local name = self:GetName()
  109.             local id = self:GetID()
  110.            
  111.             for i = 1, self.size, 1 do
  112.                 local button = _G[name.."Item"..i]
  113.                 local itemID = GetContainerItemID(id, button:GetID())
  114.                 ColourBagBorders(button, itemID)
  115.             end
  116.         end
  117.        
  118.         hooksecurefunc("ContainerFrame_Update", function(self)
  119.             bagcolourupdate(self)
  120.         end)
  121.        
  122.         hooksecurefunc("BagSlotButton_OnClick", function(self)
  123.             bagcolourupdate(self)
  124.         end)
  125.  
  126.         -- Backpack tokens
  127.         for i = 1, 3 do
  128.             local bpt = _G["BackpackTokenFrameToken"..i]
  129.             local bptic = _G["BackpackTokenFrameToken"..i.."Icon"]
  130.             local bptcount = _G["BackpackTokenFrameToken"..i.."Count"]
  131.            
  132.             if (bpt) then
  133.                 bpt:CreateBeautyBorder(12)  
  134.                 bpt:SetBeautyBorderColor(103/255, 103/255, 103/255)
  135.                 bpt:SetBeautyBorderPadding(-35, 3, 3, 3, -35, 3, 3, 3)
  136.                 bpt:SetBeautyBorderDraw("OVERLAY")
  137.                 bpt:SetScale(1.02)
  138.                    
  139.                 bptic:ClearAllPoints()
  140.                 bptic:SetPoint("RIGHT", bpt, "RIGHT", 0, 0)
  141.                 bptic:SetTexCoord(.1, .9, .1, .9)
  142.                
  143.                 bptcount:ClearAllPoints()
  144.                 bptcount:SetPoint("RIGHT", bptic, "LEFT", -5, 1)
  145.             end
  146.         end        
  147.     end)

Despite much combing over of it on my part I can't figure out what the issue is still. My only guess is that it might be related to the fact that i'm overwriting default blizzard functions for secure frames when I change BackpackButton_OnClick and BackpackButton_OnModifiedClick - which the last few lines of bugsack's error report would corroborate. But then that used to blame a lootframe update for the issue, so frankly I don't know what to think.

Last edited by ObbleYeah : 07-22-14 at 09:40 AM.
  Reply With Quote
07-23-14, 03:51 AM   #43
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
I should really post in here sooner rather than agonising over a month - since as ever I found the issue almost immediately afterward! Just moved the colouring function and secure hooks out of the OnEvent and everything is right as rain.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » UI Screenshots, Feedback and Design Discussion » in progress

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off